From: Stefan Csomor Date: Thu, 31 May 2001 05:42:50 +0000 (+0000) Subject: adapted to new sending for radiobutton events for unselecting too X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/493c9f6bb22eef04391998cb1770cf32f1cc6efc adapted to new sending for radiobutton events for unselecting too git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10387 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/carbon/radiobox.cpp b/src/mac/carbon/radiobox.cpp index 3c4c07e73e..905618716f 100644 --- a/src/mac/carbon/radiobox.cpp +++ b/src/mac/carbon/radiobox.cpp @@ -38,12 +38,15 @@ END_EVENT_TABLE() void wxRadioBox::OnRadioButton( wxCommandEvent &outer ) { + if ( outer.IsChecked() ) + { wxCommandEvent event(wxEVT_COMMAND_RADIOBOX_SELECTED, m_windowId); int i = GetSelection() ; event.SetInt( i ); event.SetString( GetString( i ) ); event.SetEventObject( this ); ProcessCommand(event); + } } wxRadioBox::wxRadioBox() diff --git a/src/mac/carbon/radiobut.cpp b/src/mac/carbon/radiobut.cpp index 8ce7963ab1..99d51f705c 100644 --- a/src/mac/carbon/radiobut.cpp +++ b/src/mac/carbon/radiobut.cpp @@ -71,7 +71,6 @@ void wxRadioButton::SetValue(bool val) return ; ::SetControlValue( m_macControl , val ) ; - Refresh() ; if (val) { cycle=this->NextInCycle(); @@ -82,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 @@ -98,10 +101,6 @@ 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); } wxRadioButton *wxRadioButton::AddInCycle(wxRadioButton *cycle) diff --git a/src/mac/radiobox.cpp b/src/mac/radiobox.cpp index 3c4c07e73e..905618716f 100644 --- a/src/mac/radiobox.cpp +++ b/src/mac/radiobox.cpp @@ -38,12 +38,15 @@ END_EVENT_TABLE() void wxRadioBox::OnRadioButton( wxCommandEvent &outer ) { + if ( outer.IsChecked() ) + { wxCommandEvent event(wxEVT_COMMAND_RADIOBOX_SELECTED, m_windowId); int i = GetSelection() ; event.SetInt( i ); event.SetString( GetString( i ) ); event.SetEventObject( this ); ProcessCommand(event); + } } wxRadioBox::wxRadioBox() diff --git a/src/mac/radiobut.cpp b/src/mac/radiobut.cpp index 8ce7963ab1..99d51f705c 100644 --- a/src/mac/radiobut.cpp +++ b/src/mac/radiobut.cpp @@ -71,7 +71,6 @@ void wxRadioButton::SetValue(bool val) return ; ::SetControlValue( m_macControl , val ) ; - Refresh() ; if (val) { cycle=this->NextInCycle(); @@ -82,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 @@ -98,10 +101,6 @@ 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); } wxRadioButton *wxRadioButton::AddInCycle(wxRadioButton *cycle)