- 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);
+
+ m_mainWidget =
+ DoCreateScrollBar( (WXWidget)parentWidget,
+ (wxOrientation)(style & (wxHORIZONTAL|wxVERTICAL)),
+ (void (*)())wxScrollBarCallback );
+
+ AttachWidget (parent, m_mainWidget, (WXWidget) NULL,
+ pos.x, pos.y, newSize.x, newSize.y);