- // we are a stand-alone radiobutton and have
- // the group flag indicating we have to collect
- // the other radiobuttons belonging to this one
-
- bool reached_this = FALSE;
- wxRadioButton *m_radioButtonCycle = NULL;
- m_radioButtonCycle = AddInCycle( m_radioButtonCycle );
-
- wxWindow *parent = GetParent();
- wxNode *node = parent->GetChildren().First();
- while (node)
- {
- wxWindow *child = (wxWindow*) node->Data();
-
- node = node->Next();
-
- // start searching behind current radiobutton
- if (!reached_this)
- {
- reached_this = (this == child);
- continue;
- }
-
- if (child->IsKindOf( CLASSINFO ( wxRadioButton ) ))
- {
- wxRadioButton *rb = (wxRadioButton*) child;
-
- // already reached next group
- if (rb->HasFlag(wxRB_GROUP)) break;
-
- // part of a radiobox
- if (rb->NextInCycle()) break;
-
- m_radioButtonCycle = rb->AddInCycle( m_radioButtonCycle );
- }
- }
-
+ wxWindow *child = node->GetData();
+ if (child->IsKindOf( CLASSINFO( wxRadioButton ) ) )
+ {
+ chief = (wxRadioButton*) child;
+ if (child->HasFlag(wxRB_GROUP)) break;
+ }
+ node = node->GetPrevious();