m_labelWidget = (WXWidget) 0;
m_backgroundColour = parent->GetBackgroundColour();
m_foregroundColour = parent->GetForegroundColour();
+ m_windowFont = parent->GetFont();
SetName(name);
if (hasLabel)
{
+ XmFontList fontList = (XmFontList) m_windowFont.GetFontList(1.0, XtDisplay(parentWidget));
+
wxString label1(wxStripMenuCodes(label));
XmString text = XmStringCreateSimple ((char*) (const char*) label1);
m_labelWidget = (WXWidget) XtVaCreateManagedWidget ((char*) (const char*) label1,
xmLabelWidgetClass, formWidget,
+ XmNfontList, fontList,
XmNlabelString, text,
NULL);
XmStringFree (text);
XmNrightAttachment, XmATTACH_FORM,
NULL);
- m_mainWidget = (Widget) formWidget;
+ m_mainWidget = (WXWidget) frameWidget;
+ m_formWidget = (WXWidget) formWidget;
SetCanAddEventHandler(TRUE);
- AttachWidget (parent, m_mainWidget, (WXWidget) frameWidget, pos.x, pos.y, size.x, size.y);
+ AttachWidget (parent, (WXWidget) frameWidget, (WXWidget) formWidget, pos.x, pos.y, size.x, size.y);
ChangeBackgroundColour();
return TRUE;
}
+wxStaticBox::~wxStaticBox()
+{
+ DetachWidget(m_formWidget);
+}
+
void wxStaticBox::SetLabel(const wxString& label)
{
if (!m_labelWidget)
void wxStaticBox::ChangeBackgroundColour()
{
wxWindow::ChangeBackgroundColour();
+ if (m_labelWidget)
+ DoChangeBackgroundColour(m_labelWidget, m_backgroundColour);
}
void wxStaticBox::ChangeForegroundColour()
{
wxWindow::ChangeForegroundColour();
+ if (m_labelWidget)
+ DoChangeForegroundColour(m_labelWidget, m_foregroundColour);
}