-
- wxCommandEvent event (wxEVT_COMMAND_RADIOBUTTON_SELECTED, item->GetId());
- event.SetEventObject(item);
-
- item->ProcessCommand (event);
+
+ //based on mac/radiobut.cpp
+ wxRadioButton* old = item->ClearSelections();
+ item->SetValue(true);
+
+ if ( old )
+ {
+ wxCommandEvent event(wxEVT_COMMAND_RADIOBUTTON_SELECTED,
+ old->GetId() );
+ event.SetEventObject(old);
+ event.SetInt( false );
+ old->ProcessCommand(event);
+ }
+ wxCommandEvent event2(wxEVT_COMMAND_RADIOBUTTON_SELECTED, item->GetId() );
+ event2.SetEventObject(item);
+ event2.SetInt( true );
+ item->ProcessCommand(event2);
+}
+
+wxRadioButton* wxRadioButton::AddInCycle(wxRadioButton *cycle)
+{
+ if (cycle == NULL)
+ {
+ m_cycle = this;
+ }
+ else
+ {
+ wxRadioButton* current = cycle;
+ while ( current->m_cycle != cycle )
+ current = current->m_cycle;
+ m_cycle = cycle;
+ current->m_cycle = this;
+ }
+
+ return cycle;