X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2e0e025ecd13ae6d1470e72b428e934748ce66d6..5c5ab9ebc3a7dd441c9e3b25cb3daf8f733c374f:/src/gtk1/radiobox.cpp diff --git a/src/gtk1/radiobox.cpp b/src/gtk1/radiobox.cpp index ec667046fe..352ec74493 100644 --- a/src/gtk1/radiobox.cpp +++ b/src/gtk1/radiobox.cpp @@ -18,9 +18,10 @@ #include "wx/dialog.h" #include "wx/frame.h" -#include "gdk/gdk.h" -#include "gtk/gtk.h" -#include "gdk/gdkkeysyms.h" +#include +#include +#include + #include "wx/gtk/win_gtk.h" //----------------------------------------------------------------------------- @@ -179,6 +180,16 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title, m_x+10, m_y+10+(i*24), 10, 10 ); } + m_parent->DoAddChild( this ); + + PostCreation(); + + ApplyWidgetStyle(); + + SetLabel( title ); + + SetFont( parent->GetFont() ); + wxSize ls = LayoutItems(); wxSize newSize = size; @@ -186,15 +197,8 @@ 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->DoAddChild( this ); - - PostCreation(); - - SetLabel( title ); - SetBackgroundColour( parent->GetBackgroundColour() ); SetForegroundColour( parent->GetForegroundColour() ); - SetFont( parent->GetFont() ); Show( TRUE ); @@ -405,11 +409,11 @@ void wxRadioBox::SetSelection( int n ) GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() ); - DisableEvents(); + GtkDisableEvents(); gtk_toggle_button_set_state( button, 1 ); - EnableEvents(); + GtkEnableEvents(); } int wxRadioBox::GetSelection(void) const @@ -575,7 +579,7 @@ void wxRadioBox::SetNumberOfRowsOrCols( int WXUNUSED(n) ) wxFAIL_MSG(wxT("wxRadioBox::SetNumberOfRowsOrCols not implemented.")); } -void wxRadioBox::DisableEvents() +void wxRadioBox::GtkDisableEvents() { wxNode *node = m_boxes.First(); while (node) @@ -587,7 +591,7 @@ void wxRadioBox::DisableEvents() } } -void wxRadioBox::EnableEvents() +void wxRadioBox::GtkEnableEvents() { wxNode *node = m_boxes.First(); while (node) @@ -618,6 +622,19 @@ void wxRadioBox::ApplyWidgetStyle() } } +#if wxUSE_TOOLTIPS +void wxRadioBox::ApplyToolTip( GtkTooltips *tips, const wxChar *tip ) +{ + wxNode *node = m_boxes.First(); + while (node) + { + GtkWidget *widget = GTK_WIDGET( node->Data() ); + gtk_tooltips_set_tip( tips, widget, wxConvCurrent->cWX2MB(tip), (gchar*) NULL ); + node = node->Next(); + } +} +#endif // wxUSE_TOOLTIPS + bool wxRadioBox::IsOwnGtkWindow( GdkWindow *window ) { if (window == m_widget->window) return TRUE;