X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b0351fc91ec11f36961b24440056660dc17b8718..c94ad3c365a7a2b12346258f3d6b26432f36fd8d:/src/gtk/radiobox.cpp diff --git a/src/gtk/radiobox.cpp b/src/gtk/radiobox.cpp index d972100b26..7d2f23a120 100644 --- a/src/gtk/radiobox.cpp +++ b/src/gtk/radiobox.cpp @@ -12,6 +12,9 @@ #endif #include "wx/radiobox.h" + +#if wxUSE_RADIOBOX + #include "wx/dialog.h" #include "wx/frame.h" @@ -40,7 +43,7 @@ static void gtk_radiobutton_clicked_callback( GtkWidget *WXUNUSED(widget), wxRad { if (g_isIdle) wxapp_install_idle_handler(); - if (!rb->HasVMT()) return; + if (!rb->m_hasVMT) return; if (g_blockEventsOnDrag) return; if (rb->m_alreadySent) @@ -68,7 +71,7 @@ BEGIN_EVENT_TABLE(wxRadioBox, wxControl) EVT_SIZE(wxRadioBox::OnSize) END_EVENT_TABLE() -wxRadioBox::wxRadioBox(void) +wxRadioBox::wxRadioBox() { } @@ -84,7 +87,9 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title, PreCreation( parent, id, pos, size, style, name ); +#if wxUSE_VALIDATORS SetValidator( validator ); +#endif m_widget = gtk_frame_new( title.mbc_str() ); @@ -109,8 +114,8 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title, GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this ); gtk_myfixed_put( GTK_MYFIXED(m_parent->m_wxwindow), - GTK_WIDGET(m_radio), - m_x+10, m_y+10+(i*24), 10, 10 ); + GTK_WIDGET(m_radio), + m_x+10, m_y+10+(i*24), 10, 10 ); } wxSize ls = LayoutItems(); @@ -120,9 +125,7 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title, if (newSize.y == -1) newSize.y = ls.y; SetSize( newSize.x, newSize.y ); - m_parent->AddChild( this ); - - (m_parent->m_insertCallback)( m_parent, this ); + m_parent->DoAddChild( this ); PostCreation(); @@ -137,7 +140,7 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title, return TRUE; } -wxRadioBox::~wxRadioBox(void) +wxRadioBox::~wxRadioBox() { wxNode *node = m_boxes.First(); while (node) @@ -150,9 +153,9 @@ wxRadioBox::~wxRadioBox(void) void wxRadioBox::OnSize( wxSizeEvent &event ) { - wxControl::OnSize( event ); - LayoutItems(); + + event.Skip(); } wxSize wxRadioBox::LayoutItems() @@ -182,7 +185,7 @@ wxSize wxRadioBox::LayoutItems() if (len > max_len) max_len = len; gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), button, m_x+x, m_y+y ); - y += 20; + y += 22; node = node->Next(); if (!node) break; @@ -249,7 +252,7 @@ bool wxRadioBox::Show( bool show ) wxWindow::Show( show ); - if ((m_windowStyle & wxNO_BORDER) == 0) + if ((m_windowStyle & wxNO_BORDER) != 0) gtk_widget_hide( m_widget ); wxNode *node = m_boxes.First(); @@ -389,9 +392,10 @@ void wxRadioBox::SetLabel( int WXUNUSED(item), wxBitmap *WXUNUSED(bitmap) ) wxFAIL_MSG(_T("wxRadioBox::SetLabel not implemented.")); } -void wxRadioBox::Enable( bool enable ) +bool wxRadioBox::Enable( bool enable ) { - wxControl::Enable( enable ); + if ( !wxControl::Enable( enable ) ) + return FALSE; wxNode *node = m_boxes.First(); while (node) @@ -402,6 +406,8 @@ void wxRadioBox::Enable( bool enable ) gtk_widget_set_sensitive( label, enable ); node = node->Next(); } + + return TRUE; } void wxRadioBox::Enable( int item, bool enable ) @@ -515,3 +521,5 @@ bool wxRadioBox::IsOwnGtkWindow( GdkWindow *window ) return FALSE; } + +#endif