+ Widget parentWidget = (Widget) parent->GetClientWidget();
+
+ wxString label1(wxStripMenuCodes(title));
+
+ Widget formWidget = XtVaCreateManagedWidget (name.c_str(),
+ xmFormWidgetClass, parentWidget,
+ XmNmarginHeight, 0,
+ XmNmarginWidth, 0,
+ NULL);
+
+ m_formWidget = (WXWidget) formWidget;
+
+ XmFontList fontList = (XmFontList) m_font.GetFontList(1.0, XtDisplay(parentWidget));
+ if (label1 != "")
+ {
+ wxXmString text(label1);
+ (void)XtVaCreateManagedWidget(label1.c_str(),
+#if wxUSE_GADGETS
+ style & wxCOLOURED ? xmLabelWidgetClass
+ : xmLabelGadgetClass,
+ formWidget,
+#else
+ xmLabelWidgetClass, formWidget,
+#endif
+ XmNfontList, fontList,
+ XmNlabelString, text(),
+ NULL);
+ }
+
+ Widget frameWidget = XtVaCreateManagedWidget ("frame",
+ xmFrameWidgetClass, formWidget,
+ XmNshadowType, XmSHADOW_IN,
+// XmNmarginHeight, 0,
+// XmNmarginWidth, 0,
+ NULL);
+
+ m_frameWidget = (WXWidget) frameWidget;
+
+ Arg args[3];
+
+ m_majorDim = (n + m_majorDim - 1) / m_majorDim;
+
+ XtSetArg (args[0], XmNorientation, ((style & wxHORIZONTAL) == wxHORIZONTAL ?
+ XmHORIZONTAL : XmVERTICAL));
+ XtSetArg (args[1], XmNnumColumns, m_majorDim);
+
+ Widget radioBoxWidget = XmCreateRadioBox (frameWidget, "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,
+ XmNrightAttachment, 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_font = parent->GetFont();
+ ChangeFont(FALSE);