'\" t .\" DrawnBut.sgm /main/11 1996/09/08 20:40:33 rws $ .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "XmDrawnButton" 3 .SH "NAME" \fBXmDrawnButton\fP \(em The DrawnButton widget class "XmDrawnButton" "widget class" "DrawnButton" .SH "SYNOPSIS" .PP .nf #include .fi .SH "DESCRIPTION" .PP 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\&. DrawnButton uses the \fBXmQTmenuSystem\fP and \fBXmQTspecifyRenderTable\fP traits, and holds the \fBXmQTactivatable\fP trait\&. .SS "Classes" .PP DrawnButton inherits behavior, resources, and traits from the \fBCore\fP, \fBPrimitive\fP, and \fBXmLabel\fP classes\&. .PP The class pointer is \fBxmDrawnButtonWidgetClass\fP\&. .PP The class name is \fBXmDrawnButton\fP\&. .SS "New Resources" .PP 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 \fB\&.Xdefaults\fP file, remove the \fBXmN\fP or \fBXmC\fP prefix and use the remaining letters\&. To specify one of the defined values for a resource in a \fB\&.Xdefaults\fP file, remove the \fBXm\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 \fBXtSetValues\fP (S), retrieved by using \fBXtGetValues\fP (G), or is not applicable (N/A)\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmDrawnButton Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNactivateCallbackXmCCallbackXtCallbackListNULLC _____ XmNarmCallbackXmCCallbackXtCallbackListNULLC _____ XmNdisarmCallbackXmCCallbackXtCallbackListNULLC _____ XmNexposeCallbackXmCCallbackXtCallbackListNULLC _____ XmNmultiClickXmCMultiClickunsigned chardynamicCSG _____ XmNpushButtonEnabledXmCPushButtonEnabledBooleanFalseCSG _____ XmNresizeCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowTypeXmCShadowTypeunsigned charXmSHADOW_ETCHED_INCSG _____ .TE .IP "\fBXmNactivateCallback\fP" 10 Specifies the list of callbacks that is called when the widget becomes selected\&. The reason sent by the callback is \fBXmCR_ACTIVATE\fP\&. This callback uses the \fBXmQTactivatable\fP trait\&. .IP "\fBXmNarmCallback\fP" 10 Specifies the list of callbacks that is called when the widget becomes armed\&. The reason sent by the callback is \fBXmCR_ARM\fP\&. .IP "\fBXmNdisarmCallback\fP" 10 Specifies the list of callbacks that is called when the widget becomes disarmed\&. The reason sent by the callback is \fBXmCR_DISARM\fP\&. .IP "\fBXmNexposeCallback\fP" 10 Specifies the list of callbacks that is called when the widget receives an exposure event\&. The reason sent by the callback is \fBXmCR_EXPOSE\fP\&. .IP "\fBXmNmultiClick\fP" 10 If a button click is followed by another button click within the time span specified by the display\&'s multiclick time, and this resource is set to \fBXmMULTICLICK_DISCARD\fP, the second click is not processed\&. If this resource is set to \fBXmMULTICLICK_KEEP\fP, the event is processed and \fIclick_count\fP is incremented in the callback structure\&. When the button is not in a menu, the default value is \fBXmMULTICLICK_KEEP\fP\&. .IP "\fBXmNpushButtonEnabled\fP" 10 Enables or disables the 3-dimensional shadow drawing as in PushButton\&. .IP "\fBXmNresizeCallback\fP" 10 Specifies the list of callbacks that is called when the widget receives a resize event\&. The reason sent by the callback is \fBXmCR_RESIZE\fP\&. The event returned for this callback is NULL\&. .IP "\fBXmNshadowType\fP" 10 Describes the drawing style for the DrawnButton\&. This resource can have the following values: .RS .IP "\fBXmSHADOW_IN\fP" 10 Draws the DrawnButton so that the shadow appears inset\&. This means that the bottom shadow visuals and top shadow visuals are reversed\&. .IP "\fBXmSHADOW_OUT\fP" 10 Draws the DrawnButton so that the shadow appears outset\&. .IP "\fBXmSHADOW_ETCHED_IN\fP" 10 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 \fBXmNshadowThickness\fP\&. .IP "\fBXmSHADOW_ETCHED_OUT\fP" 10 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 \fBXmNshadowThickness\fP\&. .RE .SS "Inherited Resources" .PP DrawnButton inherits behavior and resources from the superclasses described in the following tables\&. For a complete description of each resource, refer to the reference page for that superclass\&. .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmLabel Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorXmCAcceleratorStringNULLN/A _____ XmNacceleratorTextXmCAcceleratorTextXmStringNULLN/A _____ XmNalignmentXmCAlignmentunsigned chardynamicCSG _____ XmNfontListXmCFontListXmFontListdynamicCSG _____ XmNlabelInsensitivePixmapXmCLabelInsensitivePixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNlabelPixmapXmCLabelPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNlabelStringXmCXmStringXmString"\e0"CSG _____ XmNlabelTypeXmCLabelTypeunsigned charXmSTRINGCSG _____ XmNmarginBottomXmCMarginBottomDimension0CSG _____ XmNmarginHeightXmCMarginHeightDimension2CSG _____ XmNmarginLeftXmCMarginLeftDimension0CSG _____ XmNmarginRightXmCMarginRightDimension0CSG _____ XmNmarginTopXmCMarginTopDimension0CSG _____ XmNmarginWidthXmCMarginWidthDimension2CSG _____ XmNmnemonicXmCMnemonicKeySymNULLN/A _____ XmNmnemonicCharSetXmCMnemonicCharSetStringXmFONTLIST_DEFAULT_TAGN/A _____ XmNrecomputeSizeXmCRecomputeSizeBooleanTrueCSG _____ XmNrenderTableXmCRenderTableXmRenderTabledynamicCSG _____ XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBXmPrimitive Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG _____ XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNconvertCallbackXmCCallbackXtCallbackListNULLC _____ XmNforegroundXmCForegroundPixeldynamicCSG _____ XmNhelpCallbackXmCCallbackXtCallbackListNULLC _____ XmNhighlightColorXmCHighlightColorPixeldynamicCSG _____ XmNhighlightOnEnterXmCHighlightOnEnterBooleanFalseCSG _____ XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG _____ XmNhighlightThicknessXmCHighlightThicknessDimension2CSG _____ XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG _____ XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmNONECSG _____ XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC _____ XmNshadowThicknessXmCShadowThicknessDimension2CSG _____ XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG _____ XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG _____ XmNtraversalOnXmCTraversalOnBooleanTrueCSG _____ XmNunitTypeXmCUnitTypeunsigned chardynamicCSG _____ XmNuserDataXmCUserDataXtPointerNULLCSG _____ .TE .PP .TS tab() box; c s s s s l| l| l| l| l. \fBCore Resource Set\fP \fBName\fP\fBClass\fP\fBType\fP\fBDefault\fP\fBAccess\fP _____ XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG _____ XmNancestorSensitiveXmCSensitiveBooleandynamicG _____ XmNbackgroundXmCBackgroundPixeldynamicCSG _____ XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG _____ XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG _____ XmNborderWidthXmCBorderWidthDimension0CSG _____ XmNcolormapXmCColormapColormapdynamicCG _____ XmNdepthXmCDepthintdynamicCG _____ XmNdestroyCallbackXmCCallbackXtCallbackListNULLC _____ XmNheightXmCHeightDimensiondynamicCSG _____ XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleanTrueC _____ XmNmappedWhenManagedXmCMappedWhenManagedBooleanTrueCSG _____ XmNscreenXmCScreenScreen *dynamicCG _____ XmNsensitiveXmCSensitiveBooleanTrueCSG _____ XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG _____ XmNwidthXmCWidthDimensiondynamicCSG _____ XmNxXmCPositionPosition0CSG _____ XmNyXmCPositionPosition0CSG _____ .TE .SS "Callback Information" .PP A pointer to the following structure is passed to each callback: .PP .nf typedef struct { int \fIreason\fP; XEvent \fI* event\fP; Window \fIwindow\fP; int \fIclick_count\fP; } XmDrawnButtonCallbackStruct; .fi .IP "\fIreason\fP" 10 Indicates why the callback was invoked\&. .IP "\fIevent\fP" 10 Points to the \fBXEvent\fP that triggered the callback\&. This is NULL for \fBXmNresizeCallback\fP\&. .IP "\fIwindow\fP" 10 Is set to the window ID in which the event occurred\&. .IP "\fIclick_count\fP" 10 Contains the number of clicks in the last multiclick sequence if the \fBXmNmultiClick\fP resource is set to \fBXmMULTICLICK_KEEP\fP, otherwise it contains 1\&. The activate callback is invoked for each click if \fBXmNmultiClick\fP is set to \fBXmMULTICLICK_KEEP\fP\&. .SS "Translations" .PP XmDrawnButton includes translations from Primitive\&. Additional XmDrawnButton translations are described in the following list\&. The following key names are listed in the X standard key event translation table syntax\&. This format is the one used by Motif to specify the widget actions corresponding to a given key\&. A brief overview of the format is provided under \fBVirtualBindings\fP(3)\&. For a complete description of the format, please refer to the X Toolkit Instrinsics Documentation\&. .IP "\fBc\fP:" 10 ButtonTakeFocus() .IP "\fB\(apc\fP\fB\fP:" 10 Arm() .IP "\fB\(apc\fP\fB\fP\fB,\(apc\fP\fB\fP:" 10 Activate() Disarm() .IP "\fB\(apc\fP\fB\fP\fB(2+)\fP:" 10 MultiArm() .IP "\fB\(apc\fP\fB\fP\fB(2+)\fP:" 10 MultiActivate() .IP "\fB\(apc\fP\fB\fP:" 10 Activate() Disarm() .IP "\fB:\fP\fB\fP\fB\fP:" 10 PrimitiveParentActivate() .IP "\fB:\fP\fB\fP\fB\fP:" 10 PrimitiveParentCancel() .IP "\fB:\fP\fB\fP\fB\fP:" 10 ArmAndActivate() .IP "\fB:\fP\fB\fP\fB\fP:" 10 Help() .IP "\fB\(aps \(apm \(apa\fP \fB\fP\fBReturn\fP:" 10 PrimitiveParentActivate() .IP "\fB\(aps \(apm \(apa\fP \fB\fP\fBspace\fP:" 10 ArmAndActivate() .SS "Action Routines" .PP The \fBXmDrawnButton\fP action routines are .IP "Activate():" 10 If \fBXmNpushButtonEnabled\fP is True, redraws the shadow in the unselected state; otherwise, redraws the shadow according to \fBXmNshadowType\fP\&. If the pointer is within the DrawnButton, calls the \fBXmNactivateCallback\fP callbacks\&. .IP "Arm():" 10 If \fBXmNpushButtonEnabled\fP is True, redraws the shadow in the selected state; otherwise, redraws the shadow according to \fBXmNshadowType\fP\&. Calls the callbacks for \fBXmNarmCallback\fP\&. .IP "ArmAndActivate():" 10 If \fBXmNpushButtonEnabled\fP is True, redraws the shadow in the selected state; otherwise, redraws the shadow according to \fBXmNshadowType\fP\&. Calls the callbacks for \fBXmNarmCallback\fP\&. .IP "" 10 If \fBXmNpushButtonEnabled\fP is True, the shadow is redrawn in the unselected state; otherwise, the shadow is redrawn according to \fBXmNshadowType\fP\&. The callbacks for \fBXmNactivateCallback\fP and \fBXmNdisarmCallback\fP are called\&. These actions happen either immediately or at a later time\&. .IP "ButtonTakeFocus():" 10 Causes the PushButton to take keyboard focus when \fBCtrl\fP is pressed, without activating the widget\&. .IP "Disarm():" 10 Marks the DrawnButton as unselected and calls the callbacks for \fBXmNdisarmCallback\fP\&. .IP "Help():" 10 Calls the callbacks for \fBXmNhelpCallback\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 "MultiActivate():" 10 If \fBXmNmultiClick\fP is \fBXmMULTICLICK_DISCARD\fP, this action does nothing\&. .IP "" 10 If \fBXmNmultiClick\fP is \fBXmMULTICLICK_KEEP\fP, this action increments \fIclick_count\fP in the callback structure\&. If \fBXmNpushButtonEnabled\fP is True, this action redraws the shadow in the unselected state; otherwise, it redraws the shadow according to \fBXmNshadowType\fP\&. If the pointer is within the DrawnButton, this action calls the \fBXmNactivateCallback\fP callbacks and calls the callbacks for \fBXmNdisarmCallback\fP\&. .IP "MultiArm():" 10 If \fBXmNmultiClick\fP is \fBXmMULTICLICK_DISCARD\fP, this action does nothing\&. .IP "" 10 If \fBXmNmultiClick\fP is \fBXmMULTICLICK_KEEP\fP and if \fBXmNpushButtonEnabled\fP is True, this action redraws the shadow in the selected state; otherwise, it redraws the shadow according to \fBXmNshadowType\fP and calls the callbacks for \fBXmNarmCallback\fP\&. .SS "Additional Behavior" .PP This widget has the following additional behavior: .IP "\fB\fP:" 10 Draws the shadow in its selected state if \fBXmNpushButtonEnabled\fP is True and if the cursor leaves and re-enters the window while \fBBSelect\fP is pressed\&. .IP "\fB\fP:" 10 Draws the shadow in its unselected state if \fBXmNpushButtonEnabled\fP is True and if the cursor leaves the window while \fBBSelect\fP is pressed\&. .SS "Virtual Bindings" .PP The bindings for virtual keys are vendor specific\&. For information about bindings for virtual buttons and keys, see \fBVirtualBindings\fP(3)\&. .SH "RELATED" .PP \fBCore\fP(3), \fBXmCreateDrawnButton\fP, \fBXmLabel\fP(3), \fBXmPrimitive\fP(3), \fBXmPushButton\fP, \fBXmSeparator\fP(3), \fBXmVaCreateDrawnButton\fP, \fBXmVaCreateManagedDrawnButton\fP\&.