]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/checkbox.cpp
Initialize wxCSConv immediately instead of deferring it.
[wxWidgets.git] / src / gtk / checkbox.cpp
index 17c3ff9548378cbcd8bf29a216069e6ca55263cf..5faa27c19bf3850faaca00f232b4efd9109457fa 100644 (file)
@@ -67,7 +67,7 @@ static void gtk_checkbox_toggled_callback(GtkWidget *widget, wxCheckBox *cb)
             }
             else
             {
-                wxFAIL_MSG(_T("3state wxCheckBox in unexpected state!"));
+                wxFAIL_MSG(wxT("3state wxCheckBox in unexpected state!"));
             }
 
             cb->GTKEnableEvents();
@@ -105,6 +105,7 @@ bool wxCheckBox::Create(wxWindow *parent,
                         const wxValidator& validator,
                         const wxString &name )
 {
+    WXValidateStyle( &style );
     if (!PreCreation( parent, pos, size ) ||
         !CreateBase( parent, id, pos, size, style, validator, name ))
     {
@@ -112,11 +113,6 @@ bool wxCheckBox::Create(wxWindow *parent,
         return false;
     }
 
-    wxASSERT_MSG( (style & wxCHK_ALLOW_3RD_STATE_FOR_USER) == 0 ||
-                  (style & wxCHK_3STATE) != 0,
-                  wxT("Using wxCHK_ALLOW_3RD_STATE_FOR_USER")
-                  wxT(" style flag for a 2-state checkbox is useless") );
-
     if ( style & wxALIGN_RIGHT )
     {
         // VZ: as I don't know a way to create a right aligned checkbox with
@@ -171,7 +167,7 @@ void wxCheckBox::SetValue( bool state )
 
     if (state == GetValue())
         return;
+
     GTKDisableEvents();
 
     gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(m_widgetCheckbox), state );
@@ -217,17 +213,13 @@ void wxCheckBox::SetLabel( const wxString& label )
 
 bool wxCheckBox::Enable( bool enable )
 {
-    bool isEnabled = IsEnabled();
-
-    if ( !wxControl::Enable( enable ) )
+    if (!base_type::Enable(enable))
         return false;
 
     gtk_widget_set_sensitive( m_widgetLabel, enable );
 
-    if (!isEnabled && enable)
-    {
+    if (enable)
         GTKFixSensitivity();
-    }
 
     return true;
 }
@@ -243,11 +235,6 @@ GdkWindow *wxCheckBox::GTKGetWindow(wxArrayGdkWindows& WXUNUSED(windows)) const
     return GTK_BUTTON(m_widgetCheckbox)->event_window;
 }
 
-wxSize wxCheckBox::DoGetBestSize() const
-{
-    return wxControl::DoGetBestSize();
-}
-
 // static
 wxVisualAttributes
 wxCheckBox::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))