#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
19 files changed:
void SetNumberOfRowsOrCols( int n );
void SetFont( const wxFont &font );
void SetNumberOfRowsOrCols( int n );
void SetFont( const wxFont &font );
+ void OnSize( wxSizeEvent &event );
+
// implementation
bool m_alreadySent;
// implementation
bool m_alreadySent;
+ DECLARE_EVENT_TABLE()
+
};
#endif // __GTKRADIOBOXH__
};
#endif // __GTKRADIOBOXH__
void SetNumberOfRowsOrCols( int n );
void SetFont( const wxFont &font );
void SetNumberOfRowsOrCols( int n );
void SetFont( const wxFont &font );
+ void OnSize( wxSizeEvent &event );
+
// implementation
bool m_alreadySent;
// implementation
bool m_alreadySent;
+ DECLARE_EVENT_TABLE()
+
};
#endif // __GTKRADIOBOXH__
};
#endif // __GTKRADIOBOXH__
wxStatusBar::~wxStatusBar(void)
{
wxStatusBar::~wxStatusBar(void)
{
if ( m_statusWidths )
delete[] m_statusWidths;
if ( m_statusWidths )
delete[] m_statusWidths;
void wxButton::SetFont( const wxFont &font )
{
void wxButton::SetFont( const wxFont &font )
{
+ if (((wxFont*)&font)->Ok())
+ m_font = font;
+ else
+ m_font = *wxSWISS_FONT;
+
GtkButton *bin = GTK_BUTTON( m_widget );
GtkWidget *label = bin->child;
GtkButton *bin = GTK_BUTTON( m_widget );
GtkWidget *label = bin->child;
void wxCheckBox::SetFont( const wxFont &font )
{
void wxCheckBox::SetFont( const wxFont &font )
{
+ if (((wxFont*)&font)->Ok())
+ m_font = font;
+ else
+ m_font = *wxSWISS_FONT;
GtkButton *bin = GTK_BUTTON( m_widget );
GtkWidget *label = bin->child;
GtkButton *bin = GTK_BUTTON( m_widget );
GtkWidget *label = bin->child;
IMPLEMENT_DYNAMIC_CLASS(wxRadioBox,wxControl)
IMPLEMENT_DYNAMIC_CLASS(wxRadioBox,wxControl)
+BEGIN_EVENT_TABLE(wxRadioBox, wxControl)
+ EVT_SIZE(wxRadioBox::OnSize)
+END_EVENT_TABLE()
+
wxRadioBox::wxRadioBox(void)
{
}
wxRadioBox::wxRadioBox(void)
{
}
+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 );
bool wxRadioBox::Show( bool show )
{
wxWindow::Show( show );
void wxRadioButton::SetFont( const wxFont &font )
{
void wxRadioButton::SetFont( const wxFont &font )
{
+ if (((wxFont*)&font)->Ok())
+ m_font = font;
+ else
+ m_font = *wxSWISS_FONT;
GtkButton *bin = GTK_BUTTON( m_widget );
GtkWidget *label = bin->child;
GtkButton *bin = GTK_BUTTON( m_widget );
GtkWidget *label = bin->child;
wxStaticBox::wxStaticBox(void)
{
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 );
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,
bool wxStaticBox::Create( wxWindow *parent, wxWindowID id, const wxString &label,
const wxPoint &pos, const wxSize &size,
Show( TRUE );
return TRUE;
Show( TRUE );
return TRUE;
wxStaticText::wxStaticText(void)
{
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 );
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,
bool wxStaticText::Create( wxWindow *parent, wxWindowID id, const wxString &label,
const wxPoint &pos, const wxSize &size,
Show( TRUE );
return TRUE;
Show( TRUE );
return TRUE;
wxString wxStaticText::GetLabel(void) const
{
wxString wxStaticText::GetLabel(void) const
{
gtk_label_get( GTK_LABEL(m_widget), &str );
wxString tmp( str );
return tmp;
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 );
void wxStaticText::SetLabel( const wxString &label )
{
wxControl::SetLabel(label);
gtk_label_set( GTK_LABEL(m_widget), m_label );
void wxTextCtrl::SetFont( const wxFont &font )
{
void wxTextCtrl::SetFont( const wxFont &font )
{
+ if (((wxFont*)&font)->Ok())
+ m_font = font;
+ else
+ m_font = *wxSWISS_FONT;
GtkStyle *style = (GtkStyle*) NULL;
if (!m_hasOwnStyle)
GtkStyle *style = (GtkStyle*) NULL;
if (!m_hasOwnStyle)
void wxWindow::SetFont( const wxFont &font )
{
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;
m_font = font;
else
m_font = *wxSWISS_FONT;
- GtkStyle *style = (GtkStyle`*) NULL;
+ GtkStyle *style = (GtkStyle*) NULL;
if (!m_hasOwnStyle)
{
m_hasOwnStyle = TRUE;
if (!m_hasOwnStyle)
{
m_hasOwnStyle = TRUE;
style->font = gdk_font_ref( m_font.GetInternalFont( 1.0 ) );
gtk_widget_set_style( m_widget, style );
style->font = gdk_font_ref( m_font.GetInternalFont( 1.0 ) );
gtk_widget_set_style( m_widget, style );
}
wxFont *wxWindow::GetFont(void)
}
wxFont *wxWindow::GetFont(void)
void wxButton::SetFont( const wxFont &font )
{
void wxButton::SetFont( const wxFont &font )
{
+ if (((wxFont*)&font)->Ok())
+ m_font = font;
+ else
+ m_font = *wxSWISS_FONT;
+
GtkButton *bin = GTK_BUTTON( m_widget );
GtkWidget *label = bin->child;
GtkButton *bin = GTK_BUTTON( m_widget );
GtkWidget *label = bin->child;
void wxCheckBox::SetFont( const wxFont &font )
{
void wxCheckBox::SetFont( const wxFont &font )
{
+ if (((wxFont*)&font)->Ok())
+ m_font = font;
+ else
+ m_font = *wxSWISS_FONT;
GtkButton *bin = GTK_BUTTON( m_widget );
GtkWidget *label = bin->child;
GtkButton *bin = GTK_BUTTON( m_widget );
GtkWidget *label = bin->child;
IMPLEMENT_DYNAMIC_CLASS(wxRadioBox,wxControl)
IMPLEMENT_DYNAMIC_CLASS(wxRadioBox,wxControl)
+BEGIN_EVENT_TABLE(wxRadioBox, wxControl)
+ EVT_SIZE(wxRadioBox::OnSize)
+END_EVENT_TABLE()
+
wxRadioBox::wxRadioBox(void)
{
}
wxRadioBox::wxRadioBox(void)
{
}
+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 );
bool wxRadioBox::Show( bool show )
{
wxWindow::Show( show );
void wxRadioButton::SetFont( const wxFont &font )
{
void wxRadioButton::SetFont( const wxFont &font )
{
+ if (((wxFont*)&font)->Ok())
+ m_font = font;
+ else
+ m_font = *wxSWISS_FONT;
GtkButton *bin = GTK_BUTTON( m_widget );
GtkWidget *label = bin->child;
GtkButton *bin = GTK_BUTTON( m_widget );
GtkWidget *label = bin->child;
wxStaticBox::wxStaticBox(void)
{
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 );
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,
bool wxStaticBox::Create( wxWindow *parent, wxWindowID id, const wxString &label,
const wxPoint &pos, const wxSize &size,
Show( TRUE );
return TRUE;
Show( TRUE );
return TRUE;
wxStaticText::wxStaticText(void)
{
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 );
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,
bool wxStaticText::Create( wxWindow *parent, wxWindowID id, const wxString &label,
const wxPoint &pos, const wxSize &size,
Show( TRUE );
return TRUE;
Show( TRUE );
return TRUE;
wxString wxStaticText::GetLabel(void) const
{
wxString wxStaticText::GetLabel(void) const
{
gtk_label_get( GTK_LABEL(m_widget), &str );
wxString tmp( str );
return tmp;
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 );
void wxStaticText::SetLabel( const wxString &label )
{
wxControl::SetLabel(label);
gtk_label_set( GTK_LABEL(m_widget), m_label );
void wxTextCtrl::SetFont( const wxFont &font )
{
void wxTextCtrl::SetFont( const wxFont &font )
{
+ if (((wxFont*)&font)->Ok())
+ m_font = font;
+ else
+ m_font = *wxSWISS_FONT;
GtkStyle *style = (GtkStyle*) NULL;
if (!m_hasOwnStyle)
GtkStyle *style = (GtkStyle*) NULL;
if (!m_hasOwnStyle)
void wxWindow::SetFont( const wxFont &font )
{
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;
m_font = font;
else
m_font = *wxSWISS_FONT;
- GtkStyle *style = (GtkStyle`*) NULL;
+ GtkStyle *style = (GtkStyle*) NULL;
if (!m_hasOwnStyle)
{
m_hasOwnStyle = TRUE;
if (!m_hasOwnStyle)
{
m_hasOwnStyle = TRUE;
style->font = gdk_font_ref( m_font.GetInternalFont( 1.0 ) );
gtk_widget_set_style( m_widget, style );
style->font = gdk_font_ref( m_font.GetInternalFont( 1.0 ) );
gtk_widget_set_style( m_widget, style );
}
wxFont *wxWindow::GetFont(void)
}
wxFont *wxWindow::GetFont(void)