/*
** Generated by X-Designer
*/

/*
** X-Designer-generated prelude.
** Do not edit lines before "End of X-Designer generated prelude"
** Lines beginning ** X-Designer Stub indicate a stub
** which will not be output on re-generation
*/

/*
**LIBS: -lXm -lXt -lX11
*/

#include <stdlib.h>
#include <X11/Xatom.h>
#include <X11/Intrinsic.h>
#include <X11/Shell.h>

#include <Xm/Xm.h>
#include <Xm/SSpinB.h>
#include <Xm/SpinB.h>

#include "SpinBox.h"

/* End of X-Designer generated prelude */

/*
** Patch to CDE SpinBox
*/

#ifdef S_SUNOS5
static _XmConst char spinBoxTranslations[] = "\
<Btn1Down>: SpinBArm()\n\
<Btn1Up>: SpinBDisarm()\n\
<EnterWindow>: SpinBEnter()\n\
<LeaveWindow>: SpinBLeave()\n\
:<Key>osfUp: SpinBNext()\n\
:<Key>osfDown: SpinBPrior()\n\
:<Key>osfLeft: SpinBLeft()\n\
:<Key>osfRight: SpinBRight()\n\
:<KeyUp>osfUp: SpinBDisarm()\n\
:<KeyUp>osfDown: SpinBDisarm()\n\
:<KeyUp>osfLeft: SpinBDisarm()\n\
:<KeyUp>osfRight: SpinBDisarm()\n\
:<Key>osfBeginLine: SpinBFirst()\n\
:<Key>osfEndLine: SpinBLast()" ;

static _XmConst char spinBoxAccelerators[] =
"\043override\n\
<Key>osfUp: SpinBNext()\n\
<Key>osfDown: SpinBPrior()\n\
<KeyUp>osfUp: SpinBDisarm()\n\
<KeyUp>osfDown: SpinBDisarm()\n\
<Key>osfLeft: SpinBLeft()\n\
<Key>osfRight: SpinBRight()\n\
<KeyUp>osfLeft: SpinBDisarm()\n\
<KeyUp>osfRight: SpinBDisarm()\n\
<Key>osfBeginLine: SpinBFirst()\n\
<Key>osfEndLine: SpinBLast()" ;
#endif /* S_SUNOS5 */

/*
** X-Designer Stub OnCreateSpinBox
*/

void OnCreateSpinBox(Widget w, XtPointer client_data, XtPointer call_data)
{
#ifdef S_SUNOS5
	 static XtTranslations translations = (XtTranslations) 0 ;
	 static XtAccelerators accelerators = (XtAccelerators) 0 ;

	 WidgetList children = (WidgetList) 0 ;
	 Cardinal numChildren = (Cardinal) 0 ;
	 int index = 0 ;

	 if (translations == (XtTranslations) 0) {
		 translations = XtParseTranslationTable(spinBoxTranslations) ;
	 }

	 if (accelerators == (XtAccelerators) 0) {
		 accelerators = XtParseAcceleratorTable(spinBoxAccelerators) ;
	 }

	 XtOverrideTranslations(w, translations) ;

	 XtVaSetValues(w, XmNaccelerators, accelerators, NULL) ;

	 XtVaGetValues(w, XmNchildren, &children, XmNnumChildren, &numChildren, NULL) ;

	 if (children != (WidgetList) 0) {
		 for (index = 0 ; index < numChildren ; index++) {
			 XtInstallAccelerators(children[index], w) ;
		 }
	 }
#endif /* S_SUNOS5 */
}
