+ m_windowId = id;
+
+ int x = pos.x;
+ int y = pos.y;
+ int width = size.x;
+ int height = size.y;
+
+ if (width == -1)
+ {
+ if (style & wxHORIZONTAL)
+ width = 140;
+ else
+ width = 12;
+ }
+ if (height == -1)
+ {
+ if (style & wxVERTICAL)
+ height = 140;
+ else
+ height = 12;
+ }
+
+ Widget parentWidget = (Widget) parent->GetClientWidget();
+ int direction = (style & wxHORIZONTAL) ? XmHORIZONTAL: XmVERTICAL;
+
+ Widget scrollBarWidget = XtVaCreateManagedWidget("scrollBarWidget",
+ xmScrollBarWidgetClass, parentWidget,
+ XmNorientation, direction,
+ NULL);
+
+ m_mainWidget = (Widget) scrollBarWidget;
+
+ XtAddCallback(scrollBarWidget, XmNvalueChangedCallback, (XtCallbackProc)wxScrollBarCallback, (XtPointer)this);
+ XtAddCallback(scrollBarWidget, XmNdragCallback, (XtCallbackProc)wxScrollBarCallback, (XtPointer)this);
+ XtAddCallback(scrollBarWidget, XmNdecrementCallback, (XtCallbackProc)wxScrollBarCallback, (XtPointer)this);
+ XtAddCallback(scrollBarWidget, XmNincrementCallback, (XtCallbackProc)wxScrollBarCallback, (XtPointer)this);
+ XtAddCallback(scrollBarWidget, XmNpageDecrementCallback, (XtCallbackProc)wxScrollBarCallback, (XtPointer)this);
+ XtAddCallback(scrollBarWidget, XmNpageIncrementCallback, (XtCallbackProc)wxScrollBarCallback, (XtPointer)this);
+ XtAddCallback(scrollBarWidget, XmNtoTopCallback, (XtCallbackProc)wxScrollBarCallback, (XtPointer)this);
+ XtAddCallback(scrollBarWidget, XmNtoBottomCallback, (XtCallbackProc)wxScrollBarCallback, (XtPointer)this);
+
+ SetCanAddEventHandler(TRUE);
+ AttachWidget (parent, m_mainWidget, (WXWidget) NULL, x, y, width, height);
+ ChangeBackgroundColour();