]> git.saurik.com Git - wxWidgets.git/commitdiff
fixes #12220
authorStefan Csomor <csomor@advancedconcepts.ch>
Tue, 26 Apr 2011 17:14:50 +0000 (17:14 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Tue, 26 Apr 2011 17:14:50 +0000 (17:14 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/checkbox_osx.cpp

index 9d4191de73e5bd997a9b6ac0a9b951154735b5bf..cda4a37d2ebc82c03aee7233e6275044887695ba 100644 (file)
@@ -110,14 +110,24 @@ bool wxCheckBox::OSXHandleClicked( double WXUNUSED(timestampsec) )
             default:
                 break;
         }
+        
         if (newState == origState)
             sendEvent = false;
+        else
+            Set3StateValue( newState );
     }
-
+    else
+    {
+        // in case we cannot avoid this user state change natively (eg cocoa) we intercept it here
+        if ( newState == wxCHK_UNDETERMINED && !Is3rdStateAllowedForUser() )
+        {
+            newState = wxCHK_CHECKED;
+            Set3StateValue( newState );
+        }
+    }
+    
     if (sendEvent)
     {
-        Set3StateValue( newState );
-
         wxCommandEvent event( wxEVT_COMMAND_CHECKBOX_CLICKED, m_windowId );
         event.SetInt( newState );
         event.SetEventObject( this );