+ if( parent ) parent->AddChild( this );
+
+ Widget parentWidget = (Widget) parent->GetClientWidget();
+ m_mainWidget = (WXWidget) XtVaCreateManagedWidget( "XmArrowButton",
+ xmArrowButtonWidgetClass,
+ parentWidget,
+ XmNarrowDirection, arrow_dir,
+ XmNborderWidth, 0,
+ NULL );
+
+ XtAddCallback( (Widget) m_mainWidget,
+ XmNactivateCallback, (XtCallbackProc) SpinButtonCallback,
+ (XtPointer) this );
+ XtAddCallback( (Widget) m_mainWidget,
+ XmNarmCallback, (XtCallbackProc) StartTimerCallback,
+ (XtPointer) this );
+ XtAddCallback( (Widget) m_mainWidget,
+ XmNactivateCallback, (XtCallbackProc) StopTimerCallback,
+ (XtPointer) this );
+
+ AttachWidget( parent, m_mainWidget, (WXWidget) NULL,
+ pos.x, pos.y, size.x, size.y );
+
+ return TRUE;
+}
+
+// ----------------------------------------------------------------------------
+// wxSpinButton
+// ----------------------------------------------------------------------------
+
+IMPLEMENT_DYNAMIC_CLASS(wxSpinButton, wxControl);
+IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxNotifyEvent);
+
+static void CalcSizes( wxPoint pt, wxSize sz,
+ wxPoint& pt1, wxSize& sz1,
+ wxPoint& pt2, wxSize& sz2,
+ bool isVertical )
+{
+ typedef int wxSize::* CDPTR1;
+ typedef int wxPoint::* CDPTR2;
+
+ sz1 = sz2 = sz;
+ pt2 = pt1 = pt;
+
+ CDPTR1 szm = isVertical ? &wxSize::y : &wxSize::x;
+ CDPTR2 ptm = isVertical ? &wxPoint::y : &wxPoint::x;
+ int dim = sz.*szm, half = dim/2;
+
+ sz1.*szm = half;
+ sz2.*szm = dim - half;
+ pt2.*ptm += half + 1;
+}
+
+bool wxSpinButton::Create( wxWindow *parent, wxWindowID id,
+ const wxPoint& pos, const wxSize& size,
+ long style, const wxString& name )
+{