projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Test wxTE_PROCESS_ENTER in the combobox page of the widgets sample.
[wxWidgets.git]
/
src
/
osx
/
checkbox_osx.cpp
diff --git
a/src/osx/checkbox_osx.cpp
b/src/osx/checkbox_osx.cpp
index f248aff651193072420831c28b1dfee617f02049..c82b404313dbf86ac1066eed3f00825571387550 100644
(file)
--- a/
src/osx/checkbox_osx.cpp
+++ b/
src/osx/checkbox_osx.cpp
@@
-1,5
+1,5
@@
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
-// Name: src/osx/c
arbon/checkbo
x.cpp
+// Name: src/osx/c
heckbox_os
x.cpp
// Purpose: wxCheckBox
// Author: Stefan Csomor
// Modified by:
// Purpose: wxCheckBox
// Author: Stefan Csomor
// Modified by:
@@
-16,7
+16,6
@@
#include "wx/checkbox.h"
#include "wx/osx/private.h"
#include "wx/checkbox.h"
#include "wx/osx/private.h"
-IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl)
IMPLEMENT_DYNAMIC_CLASS(wxBitmapCheckBox, wxCheckBox)
// Single check box item
IMPLEMENT_DYNAMIC_CLASS(wxBitmapCheckBox, wxCheckBox)
// Single check box item
@@
-28,15
+27,16
@@
bool wxCheckBox::Create(wxWindow *parent,
long style,
const wxValidator& validator,
const wxString& name)
long style,
const wxValidator& validator,
const wxString& name)
-{
-
m_macIsUserPane = false
;
-
+{
+
DontCreatePeer()
;
+
if ( !wxCheckBoxBase::Create(parent, id, pos, size, style, validator, name) )
return false;
m_labelOrig = m_label = label ;
if ( !wxCheckBoxBase::Create(parent, id, pos, size, style, validator, name) )
return false;
m_labelOrig = m_label = label ;
- m_peer = wxWidgetImpl::CreateCheckBox( this, parent, id, label, pos, size, style, GetExtraStyle() ) ;
+ WXValidateStyle( &style );
+ SetPeer(wxWidgetImpl::CreateCheckBox( this, parent, id, label, pos, size, style, GetExtraStyle() )) ;
MacPostControlCreate(pos, size) ;
MacPostControlCreate(pos, size) ;
@@
-72,12
+72,12
@@
void wxCheckBox::Command(wxCommandEvent & event)
wxCheckBoxState wxCheckBox::DoGet3StateValue() const
{
wxCheckBoxState wxCheckBox::DoGet3StateValue() const
{
- return (wxCheckBoxState)
m_peer
->GetValue() ;
+ return (wxCheckBoxState)
GetPeer()
->GetValue() ;
}
void wxCheckBox::DoSet3StateValue(wxCheckBoxState val)
{
}
void wxCheckBox::DoSet3StateValue(wxCheckBoxState val)
{
-
m_peer
->SetValue( val ) ;
+
GetPeer()
->SetValue( val ) ;
}
bool wxCheckBox::OSXHandleClicked( double WXUNUSED(timestampsec) )
}
bool wxCheckBox::OSXHandleClicked( double WXUNUSED(timestampsec) )
@@
-85,11
+85,11
@@
bool wxCheckBox::OSXHandleClicked( double WXUNUSED(timestampsec) )
bool sendEvent = true;
wxCheckBoxState newState = Get3StateValue();
bool sendEvent = true;
wxCheckBoxState newState = Get3StateValue();
- if ( !
m_peer
->ButtonClickDidStateChange() )
+ if ( !
GetPeer()
->ButtonClickDidStateChange() )
{
wxCheckBoxState origState ;
{
wxCheckBoxState origState ;
-
newState =
origState = Get3StateValue();
+ origState = Get3StateValue();
switch (origState)
{
switch (origState)
{
@@
-110,15
+110,25
@@
bool wxCheckBox::OSXHandleClicked( double WXUNUSED(timestampsec) )
default:
break;
}
default:
break;
}
+
if (newState == origState)
sendEvent = false;
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)
{
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 );
event.SetInt( newState );
event.SetEventObject( this );
ProcessCommand( event );