/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#pragma implementation "statbox.h"
#endif
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#pragma implementation "statbox.h"
#endif
IMPLEMENT_DYNAMIC_CLASS(wxStaticBox, wxControl)
BEGIN_EVENT_TABLE(wxStaticBox, wxControl)
IMPLEMENT_DYNAMIC_CLASS(wxStaticBox, wxControl)
BEGIN_EVENT_TABLE(wxStaticBox, wxControl)
m_labelWidget = (WXWidget) 0;
m_backgroundColour = parent->GetBackgroundColour();
m_foregroundColour = parent->GetForegroundColour();
m_labelWidget = (WXWidget) 0;
m_backgroundColour = parent->GetBackgroundColour();
m_foregroundColour = parent->GetForegroundColour();
Widget parentWidget = (Widget) parent->GetClientWidget();
Widget formWidget = XtVaCreateManagedWidget ((char*) (const char*) name,
Widget parentWidget = (Widget) parent->GetClientWidget();
Widget formWidget = XtVaCreateManagedWidget ((char*) (const char*) name,
wxString label1(wxStripMenuCodes(label));
XmString text = XmStringCreateSimple ((char*) (const char*) label1);
m_labelWidget = (WXWidget) XtVaCreateManagedWidget ((char*) (const char*) label1,
wxString label1(wxStripMenuCodes(label));
XmString text = XmStringCreateSimple ((char*) (const char*) label1);
m_labelWidget = (WXWidget) XtVaCreateManagedWidget ((char*) (const char*) label1,
- xmFrameWidgetClass, formWidget,
- XmNshadowType, XmSHADOW_IN,
-// XmNmarginHeight, 0,
-// XmNmarginWidth, 0,
- NULL);
+ xmFrameWidgetClass, formWidget,
+ XmNshadowType, XmSHADOW_IN,
+ //XmNmarginHeight, 0,
+ //XmNmarginWidth, 0,
+ NULL);
- XmNtopAttachment, XmATTACH_FORM,
- XmNleftAttachment, XmATTACH_FORM,
- XmNrightAttachment, XmATTACH_FORM,
- XmNalignment, XmALIGNMENT_BEGINNING,
- NULL);
+ XmNtopAttachment, XmATTACH_FORM,
+ XmNleftAttachment, XmATTACH_FORM,
+ XmNrightAttachment, XmATTACH_FORM,
+ XmNalignment, XmALIGNMENT_BEGINNING,
+ NULL);
- XmNtopAttachment, hasLabel ? XmATTACH_WIDGET : XmATTACH_FORM,
- XmNtopWidget, hasLabel ? (Widget) m_labelWidget : formWidget,
- XmNbottomAttachment, XmATTACH_FORM,
- XmNleftAttachment, XmATTACH_FORM,
- XmNrightAttachment, XmATTACH_FORM,
- NULL);
+ XmNtopAttachment, hasLabel ? XmATTACH_WIDGET : XmATTACH_FORM,
+ XmNtopWidget, hasLabel ? (Widget) m_labelWidget : formWidget,
+ XmNbottomAttachment, XmATTACH_FORM,
+ XmNleftAttachment, XmATTACH_FORM,
+ XmNrightAttachment, XmATTACH_FORM,
+ NULL);
- 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);
+wxStaticBox::~wxStaticBox()
+{
+ DetachWidget(m_formWidget);
+ DetachWidget(m_mainWidget);
+ XtDestroyWidget((Widget) m_mainWidget);
+ if (m_labelWidget)
+ XtDestroyWidget((Widget) m_labelWidget);
+ XtDestroyWidget((Widget) m_formWidget);
+
+ m_mainWidget = (WXWidget) 0;
+ m_labelWidget = (WXWidget) 0;
+ m_formWidget = (WXWidget) 0;
+}
+
XmString text = XmStringCreateSimple ((char*) (const char*) label1);
XtVaSetValues ((Widget) m_labelWidget,
XmString text = XmStringCreateSimple ((char*) (const char*) label1);
XtVaSetValues ((Widget) m_labelWidget,
-void wxStaticBox::SetSize(int x, int y, int width, int height, int sizeFlags)
+void wxStaticBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
- wxControl::SetSize (x, y, width, height, sizeFlags);
+ wxControl::DoSetSize (x, y, width, height, sizeFlags);
if (width > -1)
XtVaSetValues ((Widget) m_mainWidget, XmNwidth, width,
if (width > -1)
XtVaSetValues ((Widget) m_mainWidget, XmNwidth, width,
if (height > -1)
XtVaSetValues ((Widget) m_mainWidget, XmNheight, height - yy,
if (height > -1)
XtVaSetValues ((Widget) m_mainWidget, XmNheight, height - yy,