...\" ** (c) Copyright 1993, 1994 Hewlett-Packard Company ...\" ** (c) Copyright 1993, 1994 International Business Machines Corp. ...\" ** (c) Copyright 1993, 1994 Sun Microsystems, Inc. ...\" ** (c) Copyright 1993, 1994 Novell, Inc ...\" ** ...\" ** ...\" ** ...\" ** (c) Copyright 1989, 1990, 1992 by Open Software Foundation, Inc. ...\" ** All Rights Reserved. ...\" ** ...\" ** (c) Copyright 1987, 1988, 1989, by Hewlett-Packard Company ...\" ** ...\" ** .TH XmDrawnButton 3X "" "" "" "" .ds )H Hewlett-Packard Company .ds ]W Motif Release 1.2: May 1992 .SH NAME \fIXmDrawnButton\fP \- The DrawnButton widget class .SH SYNOPSIS .nf .sS .iS \&#include .iE .sE .SH DESCRIPTION .fi The DrawnButton widget consists of an empty widget window surrounded by a shadow border. It provides the application developer with a graphics area that can have PushButton input semantics. .PP Callback types are defined for widget exposure and widget resize to allow the application to redraw or reposition its graphics. If the DrawnButton widget has a highlight and shadow thickness, the application should not draw in that area. To avoid drawing in the highlight and shadow area, create the graphics context with a clipping rectangle for drawing in the widget. The clipping rectangle should take into account the size of the widget's highlight thickness and shadow. .SS "Classes" DrawnButton inherits behavior and resources from \fICore\fP, \fIXmPrimitive\fP, and \fIXmLabel\fP Classes. .PP The class pointer is \fIxmDrawnButtonWidgetClass\fP. .PP The class name is \fIXmDrawnButton\fP. .SS "New Resources" The following table defines a set of widget resources used by the programmer to specify data. The programmer can also set the resource values for the inherited classes to set attributes for this widget. To reference a resource by name or by class in a .Xdefaults file, remove the \fIXmN\fP or \fIXmC\fP prefix and use the remaining letters. To specify one of the defined values for a resource in a .Xdefaults file, remove the \fIXm\fP prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words). The codes in the access column indicate if the given resource can be set at creation time (C), set by using \fIXtSetValues\fP (S), retrieved by using \fIXtGetValues\fP (G), or is not applicable (N/A). .P .sp 1 .in 0 .KS .TS center; cBp7 ssss lBp6 lBp6 lBp6 lBp6 lBp6 lp6 lp6 lp6 lp6 lp6. XmDrawnButton Resource Set Name Class Type Default Access _ XmNactivateCallback XmCCallback XtCallbackList NULL C XmNarmCallback XmCCallback XtCallbackList NULL C XmNdisarmCallback XmCCallback XtCallbackList NULL C XmNexposeCallback XmCCallback XtCallbackList NULL C XmNmultiClick XmCMultiClick unsigned char dynamic CSG XmNpushButtonEnabled XmCPushButtonEnabled Boolean False CSG XmNresizeCallback XmCCallback XtCallbackList NULL C XmNshadowType XmCShadowType unsigned char XmSHADOW_ETCHED_IN CSG .TE .KE .in .sp 1 .IP "\fIXmNactivateCallback\fP" Specifies the list of callbacks that is called when the widget becomes selected. The reason sent by the callback is \fIXmCR_ACTIVATE\fP. .IP "\fIXmNarmCallback\fP" Specifies the list of callbacks that is called when the widget becomes armed. The reason sent by the callback is \fIXmCR_ARM\fP. .IP "\fIXmNdisarmCallback\fP" Specifies the list of callbacks that is called when the widget becomes disarmed. The reason sent by the callback is \fIXmCR_DISARM\fP. .nL .ne 6 .IP "\fIXmNexposeCallback\fP" Specifies the list of callbacks that is called when the widget receives an exposure event. The reason sent by the callback is \fIXmCR_EXPOSE\fP. .IP "\fIXmNmultiClick\fP" If a button click is followed by another button click within the time span specified by the display's multi-click time, and this resource is set to \fIXmMULTICLICK_DISCARD\fP, do not process the second click. If this resource is set to \fIXmMULTICLICK_KEEP\fP, process the event and increment \fBclick_count\fP in the callback structure. When the button is not in a menu, the default value is \fIXmMULTICLICK_KEEP\fP. .IP "\fIXmNpushButtonEnabled\fP" Enables or disables the three-dimensional shadow drawing as in PushButton. .IP "\fIXmNresizeCallback\fP" Specifies the list of callbacks that is called when the widget receives a resize event. The reason sent by the callback is \fIXmCR_RESIZE\fP. The event returned for this callback is NULL. .IP "\fIXmNshadowType\fP" Describes the drawing style for the DrawnButton. This resource can have the following values: .wH .rS .TP \(bu \fIXmSHADOW_IN\fP \- draws the DrawnButton so that the shadow appears inset. This means that the bottom shadow visuals and top shadow visuals are reversed. .TP \(bu \fIXmSHADOW_OUT\fP \- draws the DrawnButton so that the shadow appears outset. .nL .ne 30 .TP \(bu \fIXmSHADOW_ETCHED_IN\fP \- draws the DrawnButton using a double line. This gives the effect of a line etched into the window. The thickness of the double line is equal to the value of \fIXmNshadowThickness\fP. .TP \(bu \fIXmSHADOW_ETCHED_OUT\fP \- draws the DrawnButton using a double line. This gives the effect of a line coming out of the window. The thickness of the double line is equal to the value of \fIXmNshadowThickness\fP. .wH .rE .SS "Inherited Resources" DrawnButton inherits behavior and resources from the following superclasses. For a complete description of each resource, refer to the man page for that superclass. .P .wH .in 0 .sp 1 .in 0 .KS .TS center; cBp7 ssss lBp6 lBp6 lBp6 lBp6 lBp6 lp6 lp6 lp6 lp6 lp6. XmLabel Resource Set Name Class Type Default Access _ XmNaccelerator XmCAccelerator String NULL N/A XmNacceleratorText XmCAcceleratorText XmString NULL N/A XmNalignment XmCAlignment unsigned char dynamic CSG XmNfontList XmCFontList XmFontList dynamic CSG XmNlabelInsensitivePixmap XmCLabelInsensitivePixmap Pixmap XmUNSPECIFIED_PIXMAP CSG XmNlabelPixmap XmCLabelPixmap Pixmap XmUNSPECIFIED_PIXMAP CSG XmNlabelString XmCXmString XmString "\e0" CSG XmNlabelType XmCLabelType unsigned char XmSTRING CSG XmNmarginBottom XmCMarginBottom Dimension 0 CSG XmNmarginHeight XmCMarginHeight Dimension 2 CSG XmNmarginLeft XmCMarginLeft Dimension 0 CSG XmNmarginRight XmCMarginRight Dimension 0 CSG XmNmarginTop XmCMarginTop Dimension 0 CSG XmNmarginWidth XmCMarginWidth Dimension 2 CSG .wH .tH XmNmnemonic XmCMnemonic KeySym NULL N/A XmNmnemonicCharSet XmCMnemonicCharSet String XmFONTLIST_DEFAULT_TAG N/A XmNrecomputeSize XmCRecomputeSize Boolean True CSG XmNstringDirection XmCStringDirection XmStringDirection dynamic CSG .TE .KE .in .sp 1 .wH .in .P .sp 1 .in 0 .KS .TS center; cBp7 ssss lBp6 lBp6 lBp6 lBp6 lBp6 lp6 lp6 lp6 lp6 lp6. XmPrimitive Resource Set Name Class Type Default Access _ XmNbottomShadowColor XmCBottomShadowColor Pixel dynamic CSG XmNbottomShadowPixmap XmCBottomShadowPixmap Pixmap XmUNSPECIFIED_PIXMAP CSG XmNforeground XmCForeground Pixel dynamic CSG XmNhelpCallback XmCCallback XtCallbackList NULL C XmNhighlightColor XmCHighlightColor Pixel dynamic CSG XmNhighlightOnEnter XmCHighlightOnEnter Boolean False CSG XmNhighlightPixmap XmCHighlightPixmap Pixmap dynamic CSG XmNhighlightThickness XmCHighlightThickness Dimension 2 CSG .wH .tH XmNnavigationType XmCNavigationType XmNavigationType XmNONE CSG XmNshadowThickness XmCShadowThickness Dimension 2 CSG XmNtopShadowColor XmCTopShadowColor Pixel dynamic CSG XmNtopShadowPixmap XmCTopShadowPixmap Pixmap dynamic CSG XmNtraversalOn XmCTraversalOn Boolean True CSG XmNunitType XmCUnitType unsigned char dynamic CSG XmNuserData XmCUserData XtPointer NULL CSG .TE .KE .in .sp 1 .P .wH .in 0 .sp 1 .in 0 .KS .TS center; cBp7 ssss lBp6 lBp6 lBp6 lBp6 lBp6 lp6 lp6 lp6 lp6 lp6. Core Resource Set Name Class Type Default Access _ XmNaccelerators XmCAccelerators XtAccelerators dynamic CSG XmNancestorSensitive XmCSensitive Boolean dynamic G XmNbackground XmCBackground Pixel dynamic CSG XmNbackgroundPixmap XmCPixmap Pixmap XmUNSPECIFIED_PIXMAP CSG XmNborderColor XmCBorderColor Pixel XtDefaultForeground CSG XmNborderPixmap XmCPixmap Pixmap XmUNSPECIFIED_PIXMAP CSG XmNborderWidth XmCBorderWidth Dimension 0 CSG XmNcolormap XmCColormap Colormap dynamic CG XmNdepth XmCDepth int dynamic CG XmNdestroyCallback XmCCallback XtCallbackList NULL C XmNheight XmCHeight Dimension dynamic CSG XmNinitialResourcesPersistent XmCInitialResourcesPersistent Boolean True C XmNmappedWhenManaged XmCMappedWhenManaged Boolean True CSG XmNscreen XmCScreen Screen * dynamic CG .wH .tH XmNsensitive XmCSensitive Boolean True CSG XmNtranslations XmCTranslations XtTranslations dynamic CSG XmNwidth XmCWidth Dimension dynamic CSG XmNx XmCPosition Position 0 CSG XmNy XmCPosition Position 0 CSG .TE .KE .in .sp 1 .wH .in .SS "Callback Information" A pointer to the following structure is passed to each callback: .sS .iS .ta .25i 1.1i .nf typedef struct { int \fBreason\fI; XEvent \fB* event\fI; Window \fBwindow\fI; int \fBclick_count\fI; } XmDrawnButtonCallbackStruct; .iE .sE .wH .fi .IP "\fBreason\fP" Indicates why the callback was invoked. .IP "\fBevent\fP" Points to the \fIXEvent\fP that triggered the callback. This is NULL for \fIXmNresizeCallback\fP. .nL .ne 15 .IP "\fBwindow\fP" Is set to the window ID in which the event occurred. .IP "\fBclick_count\fP" Contains the number of clicks in the last multiclick sequence if the \fIXmNmultiClick\fP resource is set to \fIXmMULTICLICK_KEEP\fP, otherwise it contains \fI1\fP. The activate callback is invoked for each click if \fIXmNmultiClick\fP is set to \fIXmMULTICLICK_KEEP\fP. .SS "Translations" XmDrawnButton includes translations from Primitive. Additional XmDrawnButton translations are listed below. These translations may not directly correspond to a translation table. .iS .ta 1.5i .nf BSelect Press: Arm() BSelect Click: Activate() Disarm() BSelect Release: Activate() Disarm() BSelect Press 2+: MultiArm() BSelect Release 2+: MultiActivate() KSelect: ArmAndActivate() KHelp: Help() .wH .fi .iE .nL .ne 30 .SS "Action Routines" The XmDrawnButton action routines are described below: .IP "\fIActivate()\fP:" If \fIXmNpushButtonEnabled\fP is True, redraws the shadow in the unselected state; otherwise, redraws the shadow according to \fIXmNshadowType\fP. ...\"Calls the \fIXmNexposeCallback\fP callbacks, then redraws the label. If the pointer is within the DrawnButton, calls the \fIXmNactivateCallback\fP callbacks. .IP "\fIArm()\fP:" If \fIXmNpushButtonEnabled\fP is True, redraws the shadow in the selected state; otherwise, redraws the shadow according to \fIXmNshadowType\fP. ...\"Calls the \fIXmNexposeCallback\fP callbacks, then redraws the label. Calls the callbacks for \fIXmNarmCallback\fP. .IP "\fIArmAndActivate()\fP:" If \fIXmNpushButtonEnabled\fP is True, redraws the shadow in the selected state; otherwise, redraws the shadow according to \fIXmNshadowType\fP. ...\"Calls the \fIXmNexposeCallback\fP callbacks, then redraws the label. Calls the callbacks for \fIXmNarmCallback\fP. .P Arranges for the following to happen, either immediately or at a later time: If \fIXmNpushButtonEnabled\fP is True, the shadow is redrawn in the unselected state; otherwise, the shadow is redrawn according to \fIXmNshadowType\fP. ...\"Calls the \fIXmNexposeCallback\fP callbacks, then redraws the label. The callbacks for \fIXmNactivateCallback\fP and \fIXmNdisarmCallback\fP are called. .IP "\fIDisarm()\fP:" Marks the DrawnButton as unselected and calls the callbacks for \fIXmNdisarmCallback\fP. .IP "\fIHelp()\fP:" Calls the callbacks for \fIXmNhelpCallback\fP if any exist. If there are no help callbacks for this widget, this action calls the help callbacks for the nearest ancestor that has them. .IP "\fIMultiActivate()\fP:" If \fIXmNmultiClick\fP is \fIXmMULTICLICK_DISCARD\fP, this action does nothing. .P If \fIXmNmultiClick\fP is \fIXmMULTICLICK_KEEP\fP, this action does the following: Increments \fBclick_count\fP in the callback structure. If \fIXmNpushButtonEnabled\fP is True, redraws the shadow in the unselected state; otherwise, redraws the shadow according to \fIXmNshadowType\fP. ...\"Calls the \fIXmNexposeCallback\fP callbacks, then redraws the label. If the pointer is within the DrawnButton, calls the \fIXmNactivateCallback\fP callbacks. Calls the callbacks for \fIXmNdisarmCallback\fP. .nL .ne 30 .IP "\fIMultiArm()\fP:" If \fIXmNmultiClick\fP is \fIXmMULTICLICK_DISCARD\fP, this action does nothing. .P If \fIXmNmultiClick\fP is \fIXmMULTICLICK_KEEP\fP, this action does the following: If \fIXmNpushButtonEnabled\fP is True, redraws the shadow in the selected state; otherwise, redraws the shadow according to \fIXmNshadowType\fP. ...\"Calls the \fIXmNexposeCallback\fP callbacks, then redraws the label. Calls the callbacks for \fIXmNarmCallback\fP. .SS "Additional Behavior" This widget has the additional behavior described below: .IP "\fI\fP:" Draws the shadow in its selected state if \fIXmNpushButtonEnabled\fP is True and if the cursor leaves and re-enters the window while \fIBSelect\fP is pressed. .IP "\fI\fP:" Draws the shadow in its unselected state if \fIXmNpushButtonEnabled\fP is True and if the cursor leaves the window while \fIBSelect\fP is pressed. .SS "Virtual Bindings" The bindings for virtual keys are vendor specific. For information about bindings for virtual buttons and keys, see \fIVirtualBindings(3X)\fP. .SH RELATED INFORMATION .na \fICore(3X)\fP, \fIXmCreateDrawnButton\fP, \fIXmLabel(3X)\fP, \fIXmPrimitive(3X)\fP, \fIXmPushButton\fP, and \fIXmSeparator(3X)\fP. .ad