X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/80fdcdb90ef779185492dab676d461fc34933312..71a09c3579dd5cb4cd8fa7fdc143561cbff74e12:/src/osx/checkbox_osx.cpp diff --git a/src/osx/checkbox_osx.cpp b/src/osx/checkbox_osx.cpp index 9d4191de73..6e4d58a680 100644 --- a/src/osx/checkbox_osx.cpp +++ b/src/osx/checkbox_osx.cpp @@ -4,7 +4,6 @@ // Author: Stefan Csomor // Modified by: // Created: 04/01/98 -// RCS-ID: $Id$ // Copyright: (c) Stefan Csomor // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -89,7 +88,7 @@ bool wxCheckBox::OSXHandleClicked( double WXUNUSED(timestampsec) ) { wxCheckBoxState origState ; - newState = origState = Get3StateValue(); + origState = Get3StateValue(); switch (origState) { @@ -110,15 +109,25 @@ 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 ); + wxCommandEvent event( wxEVT_CHECKBOX, m_windowId ); event.SetInt( newState ); event.SetEventObject( this ); ProcessCommand( event );