git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor 2011-04-26 17:14:50 +00:00
parent c141046071
commit 91116a35f2

View File

@ -110,14 +110,24 @@ bool wxCheckBox::OSXHandleClicked( double WXUNUSED(timestampsec) )
default: default:
break; break;
} }
if (newState == origState) if (newState == origState)
sendEvent = false; 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) if (sendEvent)
{ {
Set3StateValue( newState );
wxCommandEvent event( wxEVT_COMMAND_CHECKBOX_CLICKED, m_windowId ); wxCommandEvent event( wxEVT_COMMAND_CHECKBOX_CLICKED, m_windowId );
event.SetInt( newState ); event.SetInt( newState );
event.SetEventObject( this ); event.SetEventObject( this );