- wxCommandEvent event (wxEVT_COMMAND_RADIOBUTTON_SELECTED, item->GetId());
- event.SetEventObject(item);
+ //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)
+{
+ wxRadioButton* next;
+ wxRadioButton* current;
+
+ if (cycle == NULL)
+ {
+ m_cycle = this;
+ return this;
+ }
+ else
+ {
+ current = cycle;
+ while ((next = current->m_cycle) != cycle)
+ current = current->m_cycle;
+ m_cycle = cycle;
+ current->m_cycle = this;
+ return cycle;
+ }
+}