SetFont() the second
#ifdefed SetFont() in Statusbars destructor wxRadioBox setsize corrected (Still only simple layout) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@685 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
f4ada56822
commit
3f659fd6b1
@ -81,6 +81,8 @@ class wxRadioBox: public wxControl
|
||||
void SetNumberOfRowsOrCols( int n );
|
||||
void SetFont( const wxFont &font );
|
||||
|
||||
void OnSize( wxSizeEvent &event );
|
||||
|
||||
// implementation
|
||||
|
||||
bool m_alreadySent;
|
||||
@ -89,6 +91,8 @@ class wxRadioBox: public wxControl
|
||||
|
||||
GtkRadioButton *m_radio;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
};
|
||||
|
||||
#endif // __GTKRADIOBOXH__
|
||||
|
@ -81,6 +81,8 @@ class wxRadioBox: public wxControl
|
||||
void SetNumberOfRowsOrCols( int n );
|
||||
void SetFont( const wxFont &font );
|
||||
|
||||
void OnSize( wxSizeEvent &event );
|
||||
|
||||
// implementation
|
||||
|
||||
bool m_alreadySent;
|
||||
@ -89,6 +91,8 @@ class wxRadioBox: public wxControl
|
||||
|
||||
GtkRadioButton *m_radio;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
};
|
||||
|
||||
#endif // __GTKRADIOBOXH__
|
||||
|
@ -62,7 +62,9 @@ wxStatusBar::wxStatusBar(void)
|
||||
|
||||
wxStatusBar::~wxStatusBar(void)
|
||||
{
|
||||
#ifdef __WXMSW__
|
||||
SetFont(wxNullFont);
|
||||
#endif
|
||||
|
||||
if ( m_statusWidths )
|
||||
delete[] m_statusWidths;
|
||||
|
@ -105,8 +105,11 @@ void wxButton::Enable( bool enable )
|
||||
|
||||
void wxButton::SetFont( const wxFont &font )
|
||||
{
|
||||
m_font = font;
|
||||
|
||||
if (((wxFont*)&font)->Ok())
|
||||
m_font = font;
|
||||
else
|
||||
m_font = *wxSWISS_FONT;
|
||||
|
||||
GtkButton *bin = GTK_BUTTON( m_widget );
|
||||
GtkWidget *label = bin->child;
|
||||
|
||||
|
@ -91,7 +91,10 @@ bool wxCheckBox::GetValue(void) const
|
||||
|
||||
void wxCheckBox::SetFont( const wxFont &font )
|
||||
{
|
||||
m_font = font;
|
||||
if (((wxFont*)&font)->Ok())
|
||||
m_font = font;
|
||||
else
|
||||
m_font = *wxSWISS_FONT;
|
||||
|
||||
GtkButton *bin = GTK_BUTTON( m_widget );
|
||||
GtkWidget *label = bin->child;
|
||||
|
@ -53,6 +53,10 @@ static void gtk_radiobutton_clicked_callback( GtkWidget *WXUNUSED(widget), wxRad
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxRadioBox,wxControl)
|
||||
|
||||
BEGIN_EVENT_TABLE(wxRadioBox, wxControl)
|
||||
EVT_SIZE(wxRadioBox::OnSize)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
wxRadioBox::wxRadioBox(void)
|
||||
{
|
||||
}
|
||||
@ -118,6 +122,24 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void wxRadioBox::OnSize( wxSizeEvent &WXUNUSED(event) )
|
||||
{
|
||||
int x = m_x+5;
|
||||
int y = m_y+15;
|
||||
|
||||
GSList *item = gtk_radio_button_group( m_radio );
|
||||
while (item)
|
||||
{
|
||||
GtkWidget *button = GTK_WIDGET( item->data );
|
||||
|
||||
gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), button, x, y );
|
||||
|
||||
y += 20;
|
||||
|
||||
item = item->next;
|
||||
}
|
||||
}
|
||||
|
||||
bool wxRadioBox::Show( bool show )
|
||||
{
|
||||
wxWindow::Show( show );
|
||||
|
@ -88,7 +88,10 @@ bool wxRadioButton::GetValue(void) const
|
||||
|
||||
void wxRadioButton::SetFont( const wxFont &font )
|
||||
{
|
||||
m_font = font;
|
||||
if (((wxFont*)&font)->Ok())
|
||||
m_font = font;
|
||||
else
|
||||
m_font = *wxSWISS_FONT;
|
||||
|
||||
GtkButton *bin = GTK_BUTTON( m_widget );
|
||||
GtkWidget *label = bin->child;
|
||||
|
@ -22,14 +22,14 @@ IMPLEMENT_DYNAMIC_CLASS(wxStaticBox,wxControl)
|
||||
|
||||
wxStaticBox::wxStaticBox(void)
|
||||
{
|
||||
};
|
||||
}
|
||||
|
||||
wxStaticBox::wxStaticBox( wxWindow *parent, wxWindowID id, const wxString &label,
|
||||
const wxPoint &pos, const wxSize &size,
|
||||
long style, const wxString &name )
|
||||
{
|
||||
Create( parent, id, label, pos, size, style, name );
|
||||
};
|
||||
}
|
||||
|
||||
bool wxStaticBox::Create( wxWindow *parent, wxWindowID id, const wxString &label,
|
||||
const wxPoint &pos, const wxSize &size,
|
||||
@ -47,4 +47,4 @@ bool wxStaticBox::Create( wxWindow *parent, wxWindowID id, const wxString &label
|
||||
Show( TRUE );
|
||||
|
||||
return TRUE;
|
||||
};
|
||||
}
|
||||
|
@ -23,14 +23,14 @@ IMPLEMENT_DYNAMIC_CLASS(wxStaticText,wxControl)
|
||||
|
||||
wxStaticText::wxStaticText(void)
|
||||
{
|
||||
};
|
||||
}
|
||||
|
||||
wxStaticText::wxStaticText( wxWindow *parent, wxWindowID id, const wxString &label,
|
||||
const wxPoint &pos, const wxSize &size,
|
||||
long style, const wxString &name )
|
||||
{
|
||||
Create( parent, id, label, pos, size, style, name );
|
||||
};
|
||||
}
|
||||
|
||||
bool wxStaticText::Create( wxWindow *parent, wxWindowID id, const wxString &label,
|
||||
const wxPoint &pos, const wxSize &size,
|
||||
@ -95,7 +95,7 @@ bool wxStaticText::Create( wxWindow *parent, wxWindowID id, const wxString &labe
|
||||
Show( TRUE );
|
||||
|
||||
return TRUE;
|
||||
};
|
||||
}
|
||||
|
||||
wxString wxStaticText::GetLabel(void) const
|
||||
{
|
||||
@ -103,11 +103,11 @@ wxString wxStaticText::GetLabel(void) const
|
||||
gtk_label_get( GTK_LABEL(m_widget), &str );
|
||||
wxString tmp( str );
|
||||
return tmp;
|
||||
};
|
||||
}
|
||||
|
||||
void wxStaticText::SetLabel( const wxString &label )
|
||||
{
|
||||
wxControl::SetLabel(label);
|
||||
|
||||
gtk_label_set( GTK_LABEL(m_widget), m_label );
|
||||
};
|
||||
}
|
||||
|
@ -431,7 +431,10 @@ bool wxTextCtrl::IsOwnGtkWindow( GdkWindow *window )
|
||||
|
||||
void wxTextCtrl::SetFont( const wxFont &font )
|
||||
{
|
||||
m_font = font;
|
||||
if (((wxFont*)&font)->Ok())
|
||||
m_font = font;
|
||||
else
|
||||
m_font = *wxSWISS_FONT;
|
||||
|
||||
GtkStyle *style = (GtkStyle*) NULL;
|
||||
if (!m_hasOwnStyle)
|
||||
|
@ -1926,20 +1926,12 @@ bool wxWindow::IsOwnGtkWindow( GdkWindow *window )
|
||||
|
||||
void wxWindow::SetFont( const wxFont &font )
|
||||
{
|
||||
m_font = font;
|
||||
|
||||
// Unfortunately this results in a crash in GTK on deletion
|
||||
// of windows, e.g. the wxStatusBar in Dialog Editor.
|
||||
#if 0
|
||||
|
||||
// ADDED BY JACS: not sure if this is the right thing to do,
|
||||
// but will avoid a segv when SetFont(wxNullFont) is called.
|
||||
if (((wxFont*) &font)->Ok())
|
||||
if (((wxFont*)&font)->Ok())
|
||||
m_font = font;
|
||||
else
|
||||
m_font = *wxSWISS_FONT;
|
||||
|
||||
GtkStyle *style = (GtkStyle`*) NULL;
|
||||
GtkStyle *style = (GtkStyle*) NULL;
|
||||
if (!m_hasOwnStyle)
|
||||
{
|
||||
m_hasOwnStyle = TRUE;
|
||||
@ -1954,7 +1946,6 @@ void wxWindow::SetFont( const wxFont &font )
|
||||
style->font = gdk_font_ref( m_font.GetInternalFont( 1.0 ) );
|
||||
|
||||
gtk_widget_set_style( m_widget, style );
|
||||
#endif
|
||||
}
|
||||
|
||||
wxFont *wxWindow::GetFont(void)
|
||||
|
@ -105,8 +105,11 @@ void wxButton::Enable( bool enable )
|
||||
|
||||
void wxButton::SetFont( const wxFont &font )
|
||||
{
|
||||
m_font = font;
|
||||
|
||||
if (((wxFont*)&font)->Ok())
|
||||
m_font = font;
|
||||
else
|
||||
m_font = *wxSWISS_FONT;
|
||||
|
||||
GtkButton *bin = GTK_BUTTON( m_widget );
|
||||
GtkWidget *label = bin->child;
|
||||
|
||||
|
@ -91,7 +91,10 @@ bool wxCheckBox::GetValue(void) const
|
||||
|
||||
void wxCheckBox::SetFont( const wxFont &font )
|
||||
{
|
||||
m_font = font;
|
||||
if (((wxFont*)&font)->Ok())
|
||||
m_font = font;
|
||||
else
|
||||
m_font = *wxSWISS_FONT;
|
||||
|
||||
GtkButton *bin = GTK_BUTTON( m_widget );
|
||||
GtkWidget *label = bin->child;
|
||||
|
@ -53,6 +53,10 @@ static void gtk_radiobutton_clicked_callback( GtkWidget *WXUNUSED(widget), wxRad
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxRadioBox,wxControl)
|
||||
|
||||
BEGIN_EVENT_TABLE(wxRadioBox, wxControl)
|
||||
EVT_SIZE(wxRadioBox::OnSize)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
wxRadioBox::wxRadioBox(void)
|
||||
{
|
||||
}
|
||||
@ -118,6 +122,24 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void wxRadioBox::OnSize( wxSizeEvent &WXUNUSED(event) )
|
||||
{
|
||||
int x = m_x+5;
|
||||
int y = m_y+15;
|
||||
|
||||
GSList *item = gtk_radio_button_group( m_radio );
|
||||
while (item)
|
||||
{
|
||||
GtkWidget *button = GTK_WIDGET( item->data );
|
||||
|
||||
gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), button, x, y );
|
||||
|
||||
y += 20;
|
||||
|
||||
item = item->next;
|
||||
}
|
||||
}
|
||||
|
||||
bool wxRadioBox::Show( bool show )
|
||||
{
|
||||
wxWindow::Show( show );
|
||||
|
@ -88,7 +88,10 @@ bool wxRadioButton::GetValue(void) const
|
||||
|
||||
void wxRadioButton::SetFont( const wxFont &font )
|
||||
{
|
||||
m_font = font;
|
||||
if (((wxFont*)&font)->Ok())
|
||||
m_font = font;
|
||||
else
|
||||
m_font = *wxSWISS_FONT;
|
||||
|
||||
GtkButton *bin = GTK_BUTTON( m_widget );
|
||||
GtkWidget *label = bin->child;
|
||||
|
@ -22,14 +22,14 @@ IMPLEMENT_DYNAMIC_CLASS(wxStaticBox,wxControl)
|
||||
|
||||
wxStaticBox::wxStaticBox(void)
|
||||
{
|
||||
};
|
||||
}
|
||||
|
||||
wxStaticBox::wxStaticBox( wxWindow *parent, wxWindowID id, const wxString &label,
|
||||
const wxPoint &pos, const wxSize &size,
|
||||
long style, const wxString &name )
|
||||
{
|
||||
Create( parent, id, label, pos, size, style, name );
|
||||
};
|
||||
}
|
||||
|
||||
bool wxStaticBox::Create( wxWindow *parent, wxWindowID id, const wxString &label,
|
||||
const wxPoint &pos, const wxSize &size,
|
||||
@ -47,4 +47,4 @@ bool wxStaticBox::Create( wxWindow *parent, wxWindowID id, const wxString &label
|
||||
Show( TRUE );
|
||||
|
||||
return TRUE;
|
||||
};
|
||||
}
|
||||
|
@ -23,14 +23,14 @@ IMPLEMENT_DYNAMIC_CLASS(wxStaticText,wxControl)
|
||||
|
||||
wxStaticText::wxStaticText(void)
|
||||
{
|
||||
};
|
||||
}
|
||||
|
||||
wxStaticText::wxStaticText( wxWindow *parent, wxWindowID id, const wxString &label,
|
||||
const wxPoint &pos, const wxSize &size,
|
||||
long style, const wxString &name )
|
||||
{
|
||||
Create( parent, id, label, pos, size, style, name );
|
||||
};
|
||||
}
|
||||
|
||||
bool wxStaticText::Create( wxWindow *parent, wxWindowID id, const wxString &label,
|
||||
const wxPoint &pos, const wxSize &size,
|
||||
@ -95,7 +95,7 @@ bool wxStaticText::Create( wxWindow *parent, wxWindowID id, const wxString &labe
|
||||
Show( TRUE );
|
||||
|
||||
return TRUE;
|
||||
};
|
||||
}
|
||||
|
||||
wxString wxStaticText::GetLabel(void) const
|
||||
{
|
||||
@ -103,11 +103,11 @@ wxString wxStaticText::GetLabel(void) const
|
||||
gtk_label_get( GTK_LABEL(m_widget), &str );
|
||||
wxString tmp( str );
|
||||
return tmp;
|
||||
};
|
||||
}
|
||||
|
||||
void wxStaticText::SetLabel( const wxString &label )
|
||||
{
|
||||
wxControl::SetLabel(label);
|
||||
|
||||
gtk_label_set( GTK_LABEL(m_widget), m_label );
|
||||
};
|
||||
}
|
||||
|
@ -431,7 +431,10 @@ bool wxTextCtrl::IsOwnGtkWindow( GdkWindow *window )
|
||||
|
||||
void wxTextCtrl::SetFont( const wxFont &font )
|
||||
{
|
||||
m_font = font;
|
||||
if (((wxFont*)&font)->Ok())
|
||||
m_font = font;
|
||||
else
|
||||
m_font = *wxSWISS_FONT;
|
||||
|
||||
GtkStyle *style = (GtkStyle*) NULL;
|
||||
if (!m_hasOwnStyle)
|
||||
|
@ -1926,20 +1926,12 @@ bool wxWindow::IsOwnGtkWindow( GdkWindow *window )
|
||||
|
||||
void wxWindow::SetFont( const wxFont &font )
|
||||
{
|
||||
m_font = font;
|
||||
|
||||
// Unfortunately this results in a crash in GTK on deletion
|
||||
// of windows, e.g. the wxStatusBar in Dialog Editor.
|
||||
#if 0
|
||||
|
||||
// ADDED BY JACS: not sure if this is the right thing to do,
|
||||
// but will avoid a segv when SetFont(wxNullFont) is called.
|
||||
if (((wxFont*) &font)->Ok())
|
||||
if (((wxFont*)&font)->Ok())
|
||||
m_font = font;
|
||||
else
|
||||
m_font = *wxSWISS_FONT;
|
||||
|
||||
GtkStyle *style = (GtkStyle`*) NULL;
|
||||
GtkStyle *style = (GtkStyle*) NULL;
|
||||
if (!m_hasOwnStyle)
|
||||
{
|
||||
m_hasOwnStyle = TRUE;
|
||||
@ -1954,7 +1946,6 @@ void wxWindow::SetFont( const wxFont &font )
|
||||
style->font = gdk_font_ref( m_font.GetInternalFont( 1.0 ) );
|
||||
|
||||
gtk_widget_set_style( m_widget, style );
|
||||
#endif
|
||||
}
|
||||
|
||||
wxFont *wxWindow::GetFont(void)
|
||||
|
Loading…
Reference in New Issue
Block a user