X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cf1a9b45c7b70f217d3cc282ab77df8feaadcdeb..dd107c50be43e8d4dbdba20df162faf119a3781c:/src/mac/radiobut.cpp?ds=sidebyside diff --git a/src/mac/radiobut.cpp b/src/mac/radiobut.cpp index 94aad1efaf..99d51f705c 100644 --- a/src/mac/radiobut.cpp +++ b/src/mac/radiobut.cpp @@ -32,11 +32,13 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id, MacPreControlCreate( parent , id , label , pos , size ,style, validator , name , &bounds , title ) ; - m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , true , 0 , 0 , 1, + m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1, kControlRadioButtonProc , (long) this ) ; MacPostControlCreate() ; + m_cycle = this ; + if (HasFlag(wxRB_GROUP)) { AddInCycle( NULL ) ; @@ -65,9 +67,10 @@ void wxRadioButton::SetValue(bool val) { int i; wxRadioButton *cycle; - + if ( GetControlValue( m_macControl ) == val ) + return ; + ::SetControlValue( m_macControl , val ) ; - if (val) { cycle=this->NextInCycle(); @@ -78,6 +81,10 @@ void wxRadioButton::SetValue(bool val) } } } + wxCommandEvent event(wxEVT_COMMAND_RADIOBUTTON_SELECTED, m_windowId ); + event.SetEventObject(this); + event.SetInt( GetValue() ); + ProcessCommand(event); } bool wxRadioButton::GetValue() const @@ -93,11 +100,7 @@ void wxRadioButton::Command (wxCommandEvent & event) void wxRadioButton::MacHandleControlClick( ControlHandle control , SInt16 controlpart ) { - SetValue(true) ; - wxCommandEvent event(wxEVT_COMMAND_RADIOBUTTON_SELECTED, m_windowId ); - event.SetEventObject(this); - event.SetInt( GetValue() ); - ProcessCommand(event); + SetValue(true) ; } wxRadioButton *wxRadioButton::AddInCycle(wxRadioButton *cycle)