]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/radiobut.cpp
Put the call to CheckForKeyDown() back in to ProcessXEvent because key down events...
[wxWidgets.git] / src / gtk / radiobut.cpp
index 294820894fbbf55635d35b544a12f2ebd0c84d62..f7771f4ea6bbdf19bd8703b8f34a83d5e9bc97b0 100644 (file)
@@ -63,17 +63,14 @@ bool wxRadioButton::Create( wxWindow *parent, wxWindowID id, const wxString& lab
 {
     m_acceptsFocus = TRUE;
     m_needParent = TRUE;
-
-    wxSize newSize = size;
-
-    PreCreation( parent, id, pos, newSize, style, name );
-    
     m_isRadioButton = TRUE;
-  
-#if wxUSE_VALIDATORS
-    SetValidator( validator );
-#endif
 
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, validator, name ))
+    {
+        wxFAIL_MSG( _T("wxRadioButton creation failed") );
+       return FALSE;
+    }
 
     if (HasFlag(wxRB_GROUP))
     {
@@ -93,24 +90,25 @@ bool wxRadioButton::Create( wxWindow *parent, wxWindowID id, const wxString& lab
                 chief = (wxRadioButton*) child;
                 if (child->HasFlag(wxRB_GROUP)) break;
            }
-           if (chief)
-           {
-                /* we are part of the group started by chief */
-               m_radioButtonGroup = gtk_radio_button_group( GTK_RADIO_BUTTON(chief->m_widget) );
-           }
-           else
-           {
-                /* start a new group */
-                m_radioButtonGroup = (GSList*) NULL;
-           }
            node = node->GetPrevious();
         }
+       if (chief)
+       {
+            /* we are part of the group started by chief */
+           m_radioButtonGroup = gtk_radio_button_group( GTK_RADIO_BUTTON(chief->m_widget) );
+       }
+       else
+       {
+            /* start a new group */
+            m_radioButtonGroup = (GSList*) NULL;
+       }
     }
 
     m_widget = gtk_radio_button_new_with_label( m_radioButtonGroup, label.mbc_str() );
       
     SetLabel(label);
 
+    wxSize newSize = size;
     if (newSize.x == -1) newSize.x = 22+gdk_string_measure( m_widget->style->font, label.mbc_str() );
     if (newSize.y == -1) newSize.y = 26;
     SetSize( newSize.x, newSize.y );