*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->HP-UX 11i man pages -> XmDrawnButton (3)              
Title
Content
Arch
Section
 

Contents


 XmDrawnButton(library call)                     XmDrawnButton(library call)




 NAME    [Toc]    [Back]
      XmDrawnButton - The DrawnButton widget class

 SYNOPSIS    [Toc]    [Back]
      #include <Xm/DrawnB.h>

 DESCRIPTION    [Toc]    [Back]
      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.

      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 XmQTmenuSystem and
      XmQTspecifyRenderTable traits, and holds the XmQTactivatable trait.

    Classes    [Toc]    [Back]
      BulletinBoard inherits behavior, resources, and traits from the Core,
      Composite, Constraint, and XmManager classes.

      The class pointer is xmDrawnButtonWidgetClass.

      The class name is XmDrawnButton.

    New Resources    [Toc]    [Back]
      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 XmN or XmC prefix and use the remaining letters. To specify one of
      the defined values for a resource in a .Xdefaults file, remove the Xm
      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 XtSetValues (S), retrieved by using
      XtGetValues (G), or is not applicable (N/A).













                                    - 1 -       Formatted:  January 24, 2005






 XmDrawnButton(library call)                     XmDrawnButton(library call)




      ____________________________________________________________________________________________
      |                                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    |
      |_____________________|______________________|________________|____________________|________|
      |_____________________|______________________|________________|____________________|________|

      XmNactivateCallback    [Toc]    [Back]
                Specifies the list of callbacks that is called when the
                widget becomes selected.  The reason sent by the callback is
                XmCR_ACTIVATE.  This callback uses the XmQTactivatable
                trait.

      XmNarmCallback    [Toc]    [Back]
                Specifies the list of callbacks that is called when the
                widget becomes armed.  The reason sent by the callback is
                XmCR_ARM.

      XmNdisarmCallback    [Toc]    [Back]
                Specifies the list of callbacks that is called when the
                widget becomes disarmed.  The reason sent by the callback is
                XmCR_DISARM.

      XmNexposeCallback    [Toc]    [Back]
                Specifies the list of callbacks that is called when the
                widget receives an exposure event.  The reason sent by the
                callback is XmCR_EXPOSE.

      XmNmultiClick    [Toc]    [Back]
                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 XmMULTICLICK_DISCARD, the second
                click is not processed.  If this resource is set to
                XmMULTICLICK_KEEP, the event is processed and click_count is
                incremented in the callback structure.  When the button is
                not in a menu, the default value is XmMULTICLICK_KEEP.



                                    - 2 -       Formatted:  January 24, 2005






 XmDrawnButton(library call)                     XmDrawnButton(library call)




      XmNpushButtonEnabled    [Toc]    [Back]
                Enables or disables the 3-dimensional shadow drawing as in
                PushButton.

      XmNresizeCallback    [Toc]    [Back]
                Specifies the list of callbacks that is called when the
                widget receives a resize event.  The reason sent by the
                callback is XmCR_RESIZE. The event returned for this
                callback is NULL.

      XmNshadowType    [Toc]    [Back]
                Describes the drawing style for the DrawnButton. This
                resource can have the following values:

                XmSHADOW_IN    [Toc]    [Back]
                          Draws the DrawnButton so that the shadow appears
                          inset. This means that the bottom shadow visuals
                          and top shadow visuals are reversed.

                XmSHADOW_OUT    [Toc]    [Back]
                          Draws the DrawnButton so that the shadow appears
                          outset.

                XmSHADOW_ETCHED_IN    [Toc]    [Back]
                          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 XmNshadowThickness.

                XmSHADOW_ETCHED_OUT    [Toc]    [Back]
                          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 XmNshadowThickness.

    Inherited Resources    [Toc]    [Back]
      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.















                                    - 3 -       Formatted:  January 24, 2005






 XmDrawnButton(library call)                     XmDrawnButton(library call)




      _____________________________________________________________________________________________________________
      |                                           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          | "\0"                   | 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    |
      |__________________________|___________________________|___________________|________________________|________|
      |XmNmnemonic               | XmCMnemonic               | KeySym            | NULL                   | N/A    |
      |__________________________|___________________________|___________________|________________________|________|
      |XmNmnemonicCharSet        | XmCMnemonicCharSet        | String            | XmFONTLIST_DEFAULT_TAG | N/A    |
      |__________________________|___________________________|___________________|________________________|________|
      |XmNrecomputeSize          | XmCRecomputeSize          | Boolean           | True                   | CSG    |
      |__________________________|___________________________|___________________|________________________|________|
      |XmNrenderTable            | XmCRenderTable            | XmRenderTable     | dynamic                | CSG    |
      |__________________________|___________________________|___________________|________________________|________|
      |XmNstringDirection        | XmCStringDirection        | XmStringDirection | dynamic                | CSG    |
      |__________________________|___________________________|___________________|________________________|________|
      |__________________________|___________________________|___________________|________________________|________|











                                    - 4 -       Formatted:  January 24, 2005






 XmDrawnButton(library call)                     XmDrawnButton(library call)




      ____________________________________________________________________________________________________
      |                                     XmPrimitive Resource Set                                      |
      |Name                      Class                   Type               Default                Access |
      |________________________|_______________________|__________________|______________________|________|
      |XmNbottomShadowColor    | XmCBottomShadowColor  | Pixel            | dynamic              | CSG    |
      |________________________|_______________________|__________________|______________________|________|
      |XmNbottomShadowPixmap   | XmCBottomShadowPixmap | Pixmap           | XmUNSPECIFIED_PIXMAP | CSG    |
      |________________________|_______________________|__________________|______________________|________|
      |XmNconvertCallback      | XmCCallback           | XtCallbackList   | NULL                 | C      |
      |________________________|_______________________|__________________|______________________|________|
      |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    |
      |________________________|_______________________|__________________|______________________|________|
      |XmNlayoutDirection      | XmCLayoutDirection    | XmDirection      | dynamic              | CG     |
      |________________________|_______________________|__________________|______________________|________|
      |XmNnavigationType       | XmCNavigationType     | XmNavigationType | XmNONE               | CSG    |
      |________________________|_______________________|__________________|______________________|________|
      |XmNpopupHandlerCallback | XmCCallback           | XtCallbackList   | NULL                 | C      |
      |________________________|_______________________|__________________|______________________|________|
      |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    |
      |________________________|_______________________|__________________|______________________|________|
      |________________________|_______________________|__________________|______________________|________|













                                    - 5 -       Formatted:  January 24, 2005






 XmDrawnButton(library call)                     XmDrawnButton(library call)




      ________________________________________________________________________________________________________________
      |                                              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     |
      |______________________________|_______________________________|________________|______________________|________|
      |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    |
      |______________________________|_______________________________|________________|______________________|________|
      |______________________________|_______________________________|________________|______________________|________|

    Callback Information    [Toc]    [Back]
      A pointer to the following structure is passed to each callback:

      typedef struct
      {
              int reason;
              XEvent * event;



                                    - 6 -       Formatted:  January 24, 2005






 XmDrawnButton(library call)                     XmDrawnButton(library call)




              Window window;
              int click_count;
      } XmDrawnButtonCallbackStruct;

      reason    Indicates why the callback was invoked.

      event     Points to the XEvent that triggered the callback.  This is
                NULL for XmNresizeCallback.

      window    Is set to the window ID in which the event occurred.

      click_count
                Contains the number of clicks in the last multiclick
                sequence if the XmNmultiClick resource is set to
                XmMULTICLICK_KEEP, otherwise it contains 1.  The activate
                callback is invoked for each click if XmNmultiClick is set
                to XmMULTICLICK_KEEP.

    Translations    [Toc]    [Back]
      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 VirtualBindings(3).  For a complete
      description of the format, please refer to the X Toolkit Instrinsics
      Documentation.

      c<Btn1Down>:
                ButtonTakeFocus()


      ~c<Btn1Down>:
                Arm()

      ~c<Btn1Down>,~c<Btn1Up>:
                Activate() Disarm()

      ~c<Btn1Down>(2+):
                MultiArm()

      ~c<Btn1Up>(2+):
                MultiActivate()

      ~c<Btn1Up>:
                Activate() Disarm()

      :<Key><osfActivate>:
                PrimitiveParentActivate()

      :<Key><osfCancel>:
                PrimitiveParentCancel()


                                    - 7 -       Formatted:  January 24, 2005






 XmDrawnButton(library call)                     XmDrawnButton(library call)




      :<Key><osfSelect>:
                ArmAndActivate()

      :<Key><osfHelp>:
                Help()


      ~s ~m ~a <Key>Return:
                PrimitiveParentActivate()

      ~s ~m ~a <Key>space:
                ArmAndActivate()

    Action Routines    [Toc]    [Back]
      The XmDrawnButton action routines are

      Activate():
                If XmNpushButtonEnabled is True, redraws the shadow in the
                unselected state; otherwise, redraws the shadow according to
                XmNshadowType.  If the pointer is within the DrawnButton,
                calls the XmNactivateCallback callbacks.

      Arm():    If XmNpushButtonEnabled is True, redraws the shadow in the
                selected state; otherwise, redraws the shadow according to
                XmNshadowType.  Calls the callbacks for XmNarmCallback.

      ArmAndActivate():
                If XmNpushButtonEnabled is True, redraws the shadow in the
                selected state; otherwise, redraws the shadow according to
                XmNshadowType.  Calls the callbacks for XmNarmCallback.

                If XmNpushButtonEnabled is True, the shadow is redrawn in
                the unselected state; otherwise, the shadow is redrawn
                according to XmNshadowType.  The callbacks for
                XmNactivateCallback and XmNdisarmCallback are called.  These
                actions happen either immediately or at a later time.

      ButtonTakeFocus():
                Causes the PushButton to take keyboard focus when
                Ctrl<Btn1Down> is pressed, without activating the widget.

      Disarm(): Marks the DrawnButton as unselected and calls the callbacks
                for XmNdisarmCallback.

      Help():   Calls the callbacks for XmNhelpCallback 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.

      MultiActivate():
                If XmNmultiClick is XmMULTICLICK_DISCARD, this action does
                nothing.


                                    - 8 -       Formatted:  January 24, 2005






 XmDrawnButton(library call)                     XmDrawnButton(library call)




                If XmNmultiClick is XmMULTICLICK_KEEP, this action
                increments click_count in the callback structure.  If
                XmNpushButtonEnabled is True, this action redraws the shadow
                in the unselected state; otherwise, it redraws the shadow
                according to XmNshadowType.  If the pointer is within the
                DrawnButton, this action calls the XmNactivateCallback
                callbacks and calls the callbacks for XmNdisarmCallback.

      MultiArm():
                If XmNmultiClick is XmMULTICLICK_DISCARD, this action does
                nothing.

                If XmNmultiClick is XmMULTICLICK_KEEP and if
                XmNpushButtonEnabled is True, this action redraws the shadow
                in the selected state; otherwise, it redraws the shadow
                according to XmNshadowType and calls the callbacks for
                XmNarmCallback.

    Additional Behavior    [Toc]    [Back]
      This widget has the following additional behavior:

      <EnterWindow>:
                Draws the shadow in its selected state if
                XmNpushButtonEnabled is True and if the cursor leaves and
                re-enters the window while BSelect is pressed.

      <LeaveWindow>:
                Draws the shadow in its unselected state if
                XmNpushButtonEnabled is True and if the cursor leaves the
                window while BSelect is pressed.

    Virtual Bindings    [Toc]    [Back]
      The bindings for virtual keys are vendor specific.  For information
      about bindings for virtual buttons and keys, see VirtualBindings(3).

 RELATED    [Toc]    [Back]
      Core(3), XmCreateDrawnButton, XmLabel(3), XmPrimitive(3),
      XmPushButton, and XmSeparator(3).


                                    - 9 -       Formatted:  January 24, 2005
[ Back ]
 Similar pages
Name OS Title
XmCreateDrawnButton Tru64 The DrawnButton widget creation function
XmCreateDrawnButton HP-UX The DrawnButton widget creation function
XmCreateDrawnButton IRIX The DrawnButton widget creation function
OverrideShell IRIX The OverrideShell widget class
tmselectionbox IRIX the SelectionBox widget class
tmsgigrid IRIX the SGI Grid widget class
tmsgipanel IRIX the SGI IconPanel widget class
SgColorChooser IRIX The ColorChooser widget class
tmsgithumbwheel IRIX the SGI sgThumbWheel widget class
tmspinbox IRIX the SpinBox widget class
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service