+ Widget parentWidget = (Widget) parent->GetClientWidget();
+
+ wxString label1(wxStripMenuCodes(title));
+
+ XmString text = XmStringCreateSimple ((char*) (const char*) label1);
+
+ Widget formWidget = XtVaCreateManagedWidget ((char*) (const char*) name,
+ xmFormWidgetClass, parentWidget,
+ XmNmarginHeight, 0,
+ XmNmarginWidth, 0,
+ NULL);
+
+ m_formWidget = (WXWidget) formWidget;
+
+ XmFontList fontList = (XmFontList) m_windowFont.GetFontList(1.0, XtDisplay(parentWidget));
+ if (label1 != "")
+ {
+ text = XmStringCreateSimple ((char*) (const char*) label1);
+ Widget labelWidget = XtVaCreateManagedWidget ((char*) (const char*) label1,
+#if wxUSE_GADGETS
+ style & wxCOLOURED ?
+ xmLabelWidgetClass : xmLabelGadgetClass,
+ formWidget,
+#else
+ xmLabelWidgetClass, formWidget,
+#endif
+ XmNfontList, fontList,
+ XmNlabelString, text,
+ NULL);
+
+ XmStringFree (text);
+ }
+
+ Arg args[3];
+
+ majorDim = (n + majorDim - 1) / majorDim;
+
+ XtSetArg (args[0], XmNorientation, ((style & wxHORIZONTAL) == wxHORIZONTAL ?
+ XmHORIZONTAL : XmVERTICAL));
+ XtSetArg (args[1], XmNnumColumns, majorDim);
+
+ Widget radioBoxWidget = XmCreateRadioBox (formWidget, "radioBoxWidget", args, 2);
+ m_mainWidget = (WXWidget) radioBoxWidget;
+
+
+ if (m_labelWidget)
+ XtVaSetValues ((Widget) m_labelWidget,
+ XmNtopAttachment, XmATTACH_FORM,
+ XmNleftAttachment, XmATTACH_FORM,
+ XmNalignment, XmALIGNMENT_BEGINNING,
+ NULL);
+
+ XtVaSetValues (radioBoxWidget,
+ XmNtopAttachment, m_labelWidget ? XmATTACH_WIDGET : XmATTACH_FORM,
+ XmNtopWidget, m_labelWidget ? (Widget) m_labelWidget : formWidget,
+ XmNbottomAttachment, XmATTACH_FORM,
+ XmNleftAttachment, XmATTACH_FORM,
+ NULL);
+
+ // if (style & wxFLAT)
+ // XtVaSetValues (radioBoxWidget, XmNborderWidth, 1, NULL);
+
+ m_radioButtons = new WXWidget[n];
+ m_radioButtonLabels = new wxString[n];
+ int i;
+ for (i = 0; i < n; i++)
+ {
+ wxString str(wxStripMenuCodes(choices[i]));
+ m_radioButtonLabels[i] = str;
+ m_radioButtons[i] = (WXWidget) XtVaCreateManagedWidget ((char*) (const char*) str,
+#if wxUSE_GADGETS
+ xmToggleButtonGadgetClass, radioBoxWidget,
+#else
+ xmToggleButtonWidgetClass, radioBoxWidget,
+#endif
+ XmNfontList, fontList,
+ NULL);
+ XtAddCallback ((Widget) m_radioButtons[i], XmNvalueChangedCallback, (XtCallbackProc) wxRadioBoxCallback,
+ (XtCallbackProc) this);
+
+ }
+ SetSelection (0);
+
+ m_windowFont = parent->GetFont();
+ ChangeFont(FALSE);
+
+ XtManageChild (radioBoxWidget);
+
+ SetCanAddEventHandler(TRUE);
+ AttachWidget (parent, m_mainWidget, m_formWidget, pos.x, pos.y, size.x, size.y);