- Rect bounds ;
- Str255 title ;
-
- m_cycle=NULL;
-
- MacPreControlCreate( parent , id , label , pos , size ,style, validator , name , &bounds , title ) ;
-
- m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , true , 0 , 0 , 1,
- kControlRadioButtonProc , (long) this ) ;
-
- MacPostControlCreate() ;
-
- return TRUE;
+ if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
+ return false;
+
+ Rect bounds ;
+ Str255 title ;
+
+ MacPreControlCreate( parent , id , label , pos , size ,style, validator , name , &bounds , title ) ;
+
+ m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1,
+ kControlRadioButtonProc , (long) this ) ;
+
+ MacPostControlCreate() ;
+
+ m_cycle = this ;
+
+ if (HasFlag(wxRB_GROUP))
+ {
+ AddInCycle( NULL ) ;
+ }
+ else
+ {
+ /* search backward for last group start */
+ wxRadioButton *chief = (wxRadioButton*) NULL;
+ wxWindowList::Node *node = parent->GetChildren().GetLast();
+ while (node)
+ {
+ wxWindow *child = node->GetData();
+ if (child->IsKindOf( CLASSINFO( wxRadioButton ) ) )
+ {
+ chief = (wxRadioButton*) child;
+ if (child->HasFlag(wxRB_GROUP)) break;
+ }
+ node = node->GetPrevious();
+ }
+ AddInCycle( chief ) ;
+ }
+ return TRUE;