\input wbuildmac.tex
\Class{XfwfButton}
 The {\tt XfwfButton} widget is a simple button with a
single callback {\tt activate{\underline}callback}. Except for that
callback, all resources are inherited from the
{\tt XfwfLabel} widget. Subclasses provide buttons of
other, more specialized types.  {\tt XfwfButton} inherits
its 3D frame from {\tt XfwfFrame}, the location
specification resources from {\tt XfwfBoard} and the
multi-line label from {\tt XfwfLabel}.

The implementation is also very simple, since nearly
all code is inherited from {\tt XfwfLabel}. There are no
new or redefined methods. In fact, just three lines of
actual code suffice to implement the widget: Object
Oriented Programming at its best!




\Publicvars
\Table{XfwfButton}
XtNactivateCallback&XtCActivateCallback&Callback&NULL \cr
\endTable
\Section
\Publicvar{XtNactivateCallback}
 The {\tt activate{\underline}callback} is invoked from the
{\tt activate} function, which is normally bound to a
mouse click. The {\tt call{\underline}data} argument of the callbacks
routines is filled with a pointer to the event that
triggered the action.



\HCode
\Code
{\langle}Callback{\rangle} XtCallbackList  activateCallback = NULL \endCode
\endHCode


\Section
\Publicvar{XtNframeWidth}
 The default {\tt frameWidth} is set to 2 pixels.



\HCode
\Code
Dimension  frameWidth = 2 \endCode
\endHCode


\End\Table{XfwfLabel}
XtNlabel&XtCLabel&String &NULL \cr
XtNfont&XtCFont&FontStruct&XtDefaultFont \cr
XtNforeground&XtCForeground&Pixel &XtDefaultForeground \cr
XtNalignment&XtCAlignment&Alignment &0 \cr
XtNmargin&XtCMargin&Int &2 \cr
XtNshrinkToFit&XtCShrinkToFit&Boolean &False \cr
\endTable
\Table{XfwfBoard}
XtNcursor&XtCCursor&Cursor &None \cr
XtNabs{\underline}x&XtCAbs{\underline}x&Int &0 \cr
XtNrel{\underline}x&XtCRel{\underline}x&Float &"0.0"\cr
XtNabs{\underline}y&XtCAbs{\underline}y&Int &0 \cr
XtNrel{\underline}y&XtCRel{\underline}y&Float &"0.0"\cr
XtNabs{\underline}width&XtCAbs{\underline}width&Int &0 \cr
XtNrel{\underline}width&XtCRel{\underline}width&Float &"1.0"\cr
XtNabs{\underline}height&XtCAbs{\underline}height&Int &0 \cr
XtNrel{\underline}height&XtCRel{\underline}height&Float &"1.0"\cr
XtNhunit&XtCHunit&Int &1 \cr
XtNvunit&XtCVunit&Int &1 \cr
XtNlocation&XtCLocation&String &NULL \cr
\endTable
\Table{XfwfFrame}
XtNframeType&XtCFrameType&FrameType &XfwfRaised \cr
XtNframeWidth&XtCFrameWidth&Dimension &0 \cr
XtNframeOffset&XtCFrameOffset&Dimension &0 \cr
XtNshadowScheme&XtCShadowScheme&ShadowScheme &XfwfAuto \cr
XtNlightColor&XtCLightColor&Pixel &XtDefaultBackground \cr
XtNdarkColor&XtCDarkColor&Pixel &XtDefaultForeground \cr
XtNlightStipple&XtCLightStipple&Bitmap &NULL \cr
XtNdarkStipple&XtCDarkStipple&Bitmap &NULL \cr
\endTable
\Table{XfwfCommon}
XtNhighlighted&XtCHighlighted&Boolean &False \cr
XtNselected&XtCSelected&Boolean &False \cr
XtNtext&XtCText&String &NULL \cr
XtNhandlers&XtCHandlers&Program *&NULL \cr
\endTable
\Table{Composite}
XtNchildren&XtCChildren&WidgetList &NULL \cr
insertPosition&XtCInsertPosition&XTOrderProc &NULL \cr
numChildren&XtCNumChildren&Cardinal &0 \cr
\endTable
\Table{Core}
XtNx&XtCX&Position &0 \cr
XtNy&XtCY&Position &0 \cr
XtNwidth&XtCWidth&Dimension &0 \cr
XtNheight&XtCHeight&Dimension &0 \cr
borderWidth&XtCBorderWidth&Dimension &0 \cr
XtNcolormap&XtCColormap&Colormap &NULL \cr
XtNdepth&XtCDepth&Int &0 \cr
destroyCallback&XtCDestroyCallback&XTCallbackList &NULL \cr
XtNsensitive&XtCSensitive&Boolean &True \cr
XtNtranslations&XtCTranslations&XTTranslations &NULL \cr
ancestorSensitive&XtCAncestorSensitive&Boolean &False \cr
accelerators&XtCAccelerators&XTTranslations &NULL \cr
borderColor&XtCBorderColor&Pixel &0 \cr
borderPixmap&XtCBorderPixmap&Pixmap &NULL \cr
background&XtCBackground&Pixel &0 \cr
backgroundPixmap&XtCBackgroundPixmap&Pixmap &NULL \cr
mappedWhenManaged&XtCMappedWhenManaged&Boolean &True \cr
XtNscreen&XtCScreen&Screen *&NULL \cr
\endTable
\Translations
\Section
 By default, the {\tt activate} action is bound to a
mouse click.



\Code
{\langle}Btn1Down{\rangle},{\langle}Btn1Up{\rangle}: activate() \endCode


\End\Actions
\Section
\Action{activate} The {\tt activate} action just calls the
{\tt activate{\underline}callback} functions, passing the {\tt XEvent}
pointer in the {\tt call{\underline}data} argument.



\HCode
\Code
void activate({\dollar}, XEvent* event, String* params, Cardinal* num{\underline}params)
{\lbrace}
    XtCallCallbackList({\dollar}, {\dollar}activateCallback, event);
{\rbrace}\endCode
\endHCode


\End\bye
