X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/179e085f05fab385b89a18281e115003de890388..5f7348ce627157e21bec507623ebd31c1e9dc762:/src/mac/carbon/radiobut.cpp?ds=inline diff --git a/src/mac/carbon/radiobut.cpp b/src/mac/carbon/radiobut.cpp index d3c4187940..a265da4e8c 100644 --- a/src/mac/carbon/radiobut.cpp +++ b/src/mac/carbon/radiobut.cpp @@ -19,9 +19,7 @@ #include "wx/radiobut.h" -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxRadioButton, wxControl) -#endif #include "wx/mac/uma.h" @@ -41,7 +39,7 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id, Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ; - m_peer = new wxMacControl() ; + m_peer = new wxMacControl(this) ; verify_noerr ( CreateRadioButtonControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , CFSTR("") , 0 , false /* no autotoggle */ , m_peer->GetControlRefAddr() ) ); @@ -110,28 +108,21 @@ wxInt32 wxRadioButton::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVE { // if already set -> no action if ( GetValue() ) - return noErr; + return noErr; - wxRadioButton *cycle, *old = NULL ; + wxRadioButton *cycle; cycle=this->NextInCycle(); if (cycle!=NULL) { - while (cycle!=this) { + while (cycle!=this) { if ( cycle->GetValue() ) { - old = cycle ; cycle->SetValue(false); - } - cycle=cycle->NextInCycle(); } + cycle=cycle->NextInCycle(); + } } - SetValue(true) ; + SetValue(true) ; - if ( old ) { - wxCommandEvent event(wxEVT_COMMAND_RADIOBUTTON_SELECTED, old->m_windowId ); - event.SetEventObject(old); - event.SetInt( false ); - old->ProcessCommand(event); - } wxCommandEvent event2(wxEVT_COMMAND_RADIOBUTTON_SELECTED, m_windowId ); event2.SetEventObject(this); event2.SetInt( true );