]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/checkbox.cpp
Implement clipboard api in gtk.
[wxWidgets.git] / src / gtk1 / checkbox.cpp
index a85a9b4acfedea5d1df16a0ae325e4c5867372b5..5d3dd8738cba17f98815338f68968dfbca64f9f0 100644 (file)
@@ -36,7 +36,8 @@ extern wxWindowGTK   *g_delayedFocus;
 //-----------------------------------------------------------------------------
 
 extern "C" {
 //-----------------------------------------------------------------------------
 
 extern "C" {
-static void gtk_checkbox_toggled_callback(GtkWidget *widget, wxCheckBox *cb)
+static void gtk_checkbox_toggled_callback(GtkWidget *WXUNUSED(widget),
+                                          wxCheckBox *cb)
 {
     if (g_isIdle) wxapp_install_idle_handler();
 
 {
     if (g_isIdle) wxapp_install_idle_handler();
 
@@ -49,7 +50,7 @@ static void gtk_checkbox_toggled_callback(GtkWidget *widget, wxCheckBox *cb)
     wxCommandEvent event(wxEVT_COMMAND_CHECKBOX_CLICKED, cb->GetId());
     event.SetInt(cb->GetValue());
     event.SetEventObject(cb);
     wxCommandEvent event(wxEVT_COMMAND_CHECKBOX_CLICKED, cb->GetId());
     event.SetInt(cb->GetValue());
     event.SetEventObject(cb);
-    cb->GetEventHandler()->ProcessEvent(event);
+    cb->HandleWindowEvent(event);
 }
 }
 
 }
 }
 
@@ -57,8 +58,6 @@ static void gtk_checkbox_toggled_callback(GtkWidget *widget, wxCheckBox *cb)
 // wxCheckBox
 //-----------------------------------------------------------------------------
 
 // wxCheckBox
 //-----------------------------------------------------------------------------
 
-IMPLEMENT_DYNAMIC_CLASS(wxCheckBox,wxControl)
-
 wxCheckBox::wxCheckBox()
 {
 }
 wxCheckBox::wxCheckBox()
 {
 }
@@ -76,6 +75,7 @@ bool wxCheckBox::Create(wxWindow *parent,
     m_acceptsFocus = true;
     m_blockEvent = false;
 
     m_acceptsFocus = true;
     m_blockEvent = false;
 
+    WXValidateStyle(&style);
     if (!PreCreation( parent, pos, size ) ||
         !CreateBase( parent, id, pos, size, style, validator, name ))
     {
     if (!PreCreation( parent, pos, size ) ||
         !CreateBase( parent, id, pos, size, style, validator, name ))
     {
@@ -83,11 +83,6 @@ bool wxCheckBox::Create(wxWindow *parent,
         return false;
     }
 
         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
     if ( style & wxALIGN_RIGHT )
     {
         // VZ: as I don't know a way to create a right aligned checkbox with