- wxCommandEvent event(wxEVT_COMMAND_RADIOBUTTON_SELECTED, m_windowId );
- event.SetEventObject(this);
- event.SetInt( GetValue() );
- ProcessCommand(event);
+
+ 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 );
+ ProcessCommand(event2);