Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ XmPrimiti(Xm) — OpenDesktop Software Development System 3.0.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought


 XmPrimitive(Xm)                6 January 1993                XmPrimitive(Xm)


 Name

    XmPrimitive - the Primitive widget class

 Syntax


    #include <Xm/Xm.h>


 Description

    Primitive is a widget class used as a supporting superclass for other
    widget classes. It handles border drawing and highlighting, traversal
    activation and deactivation, and various callback lists needed by Primi-
    tive widgets.

    Classes

    Primitive inherits behavior and resources from Core class.

    The class pointer is xmPrimitiveWidgetClass.

    The class name is XmPrimitive.

    New resources

    The following table defines a set of widget resources used by the pro-
    grammer 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).

 XmPrimitive resource set

 ____________________________________________________________________________
 Name               Class             Type             Default         Access
 ____________________________________________________________________________
 XmNbottomShadow-   XmCBottomShadow-  Pixel            dynamic         CSG
 Color              Color
 XmNbottomShadow-   XmCBottomShadow-  Pixmap           XmUNSPECIFIED_- CSG
 Pixmap             Pixmap                             PIXMAP
 XmNforeground      XmCForeground     Pixel            dynamic         CSG
 XmNhelpCallback    XmCCallback       XtCallbackList   NULL            C
 XmNhighlightColor  XmCHighlightColor Pixel            dynamic         CSG
 XmNhighlightOn-    XmCHighlightOn-   Boolean          False           CSG
 Enter              Enter
 XmNhighlightPixmap XmCHighlightPixmapPixmap           dynamic         CSG
 XmNhighlight-      XmCHighlight-     Dimension        2               CSG
 Thickness          Thickness
 XmNnavigationType  XmCNavigationType XmNavigationType XmNONE          CSG
 XmNshadowThickness XmCShadowThicknessDimension        2               CSG
 XmNtopShadowColor  XmCTopShadowColor Pixel            dynamic         CSG
 XmNtopShadowPixmap XmCTopShadowPixmapPixmap           dynamic         CSG
 XmNtraversalOn     XmCTraversalOn    Boolean          True            CSG
 XmNunitType        XmCUnitType       unsigned char    dynamic         CSG
 XmNuserData        XmCUserData       XtPointer        NULL            CSG


    XmNbottomShadowColor
            Specifies the color to use to draw the bottom and right sides of
            the border shadow.  This color is used if the XmNtopShadowPixmap
            resource is unspecified.

    XmNbottomShadowPixmap
            Specifies the pixmap to use to draw the bottom and right sides of
            the border shadow.

    XmNforeground
            Specifies the foreground drawing color used by Primitive widgets.

    XmNhelpCallback
            Specifies the list of callbacks that is called when the help key
            is pressed. The reason sent by the callback is XmCRHELP.

    XmNhighlightColor
            Specifies the color of the highlighting rectangle.  This color is
            used if the highlight pixmap resource is XmUNSPECIFIEDPIXMAP.

    XmNhighlightOnEnter
            Specifies if the highlighting rectangle is drawn when the cursor
            moves into the widget.  If the shell's focus policy is XmEXPLI-
            CIT, this resource is ignored, and the widget is highlighted when
            it has the focus.  If the shell's focus policy is XmPOINTER and
            if this resource is True, the highlighting rectangle is drawn
            when the the cursor moves into the widget.  If the shell's focus
            policy is XmPOINTER and if this resource is False, the highlight-
            ing rectangle is not drawn when the the cursor moves into the
            widget.  The default is False.

    XmNhighlightPixmap
            Specifies the pixmap used to draw the highlighting rectangle.

    XmNhighlightThickness
            Specifies the thickness of the highlighting rectangle.

    XmNnavigationType
            Determines whether the widget is a tab group.

            +  XmNONE indicates that the widget is not a tab group.

            +  XmTABGROUP indicates that the widget is a tab group, unless
               another widget in the hierarchy has an XmNnavigationType of
               XmEXCLUSIVETABGROUP.

            +  XmSTICKYTABGROUP indicates that the widget is a tab group,
               even if another widget in the hierarchy has an XmNnavigation-
               Type of XmEXCLUSIVETABGROUP.

            +  XmEXCLUSIVETABGROUP indicates that the widget is a tab group
               and that widgets in the hierarchy whose XmNnavigationType is
               XmTABGROUP are not tab groups.

            When a parent widget has an XmNnavigationType of XmEXCLUSIVE-
            TABGROUP, traversal of non-tab-group widgets within the group is
            based on the order of those widgets in their parent's XmNchildren
            list.

            When any widget in a hierarchy has an XmNnavigationType of
            XmEXCLUSIVETABGROUP, traversal of tab groups in the hierarchy
            proceeds to widgets in the order in which their XmNnavigationType
            resources were specified as XmEXCLUSIVETABGROUP or XmSTICKY-
            TABGROUP, whether by creating the widgets with that value, by
            calling XtSetValues, or by calling XmAddTabGroup.

    XmNshadowThickness
            Specifies the size of the drawn border shadow.

    XmNtopShadowColor
            Specifies the color to use to draw the top and left sides of the
            border shadow.  This color is used if the XmNtopShadowPixmap
            resource is unspecified.

    XmNtopShadowPixmap
            Specifies the pixmap to use to draw the top and left sides of the
            border shadow.

    XmNtraversalOn
            Specifies if traversal is activated for this widget. In Cascade-
            Button and CascadeButtonGadget, this resource is forced to True
            unless the parent is an OptionMenu.

    XmNunitType
            Provides the basic support for resolution independence.  It
            defines the type of units a widget uses with sizing and position-
            ing resources.  If the widget's parent is a subclass of XmManager
            and if the XmNunitType resource is not explicitly set, it
            defaults to the unit type of the parent widget.  If the widget's
            parent is not a subclass of XmManager, the resource has a default
            unit type of XmPIXELS.

            XmNunitType can have the following values:

            +  XmPIXELS -- all values provided to the widget are treated as
               normal pixel values.

            +  Xm100THMILLIMETERS -- all values provided to the widget are
               treated as 1/100 millimeter.

            +  Xm1000THINCHES -- all values provided to the widget are
               treated as 1/1000 inch.

            +  Xm100THPOINTS -- all values provided to the widget are
               treated as 1/100 point. A point is a unit used in text pro-
               cessing applications and is defined as 1/72 inch.

            +  Xm100THFONTUNITS -- all values provided to the widget are
               treated as 1/100 of a font unit.  A font unit has horizontal
               and vertical components.  These are the values of the XmScreen
               resources XmNhorizontalFontUnit and XmNverticalFontUnit.

    XmNuserData
            Allows the application to attach any necessary specific data to
            the widget.  It is an internally unused resource.

    Dynamic color defaults

    The foreground, background, top shadow, bottom shadow, and highlight
    color resources are dynamically defaulted.  If no color data is speci-
    fied, the colors are automatically generated. On a single-plane system, a
    black and white color scheme is generated. Otherwise, four colors are
    generated, which display the correct shading for the 3-D visuals.  If the
    background is the only color specified for a widget, the top shadow and
    bottom shadow colors are generated to give the 3-D appearance.  Fore-
    ground and highlight colors are generated to provide sufficient contrast
    with the background color.

    Colors are generated only at creation. Resetting the background through
    XtSetValues does not regenerate the other colors.  XmChangeColor can be
    used to recalculate all associated colors based on a new background
    color.

    Inherited resources

    Primitive inherits behavior and resources from the following superclass.
    For a complete description of each resource, refer to the man page for
    that superclass.

 Core resource set

 ____________________________________________________________________________
 Name              Class             Type          Default             Access
 ____________________________________________________________________________
 XmNaccelerators   XmCAccelerators   XtAcceleratorsdynamic             CSG
 XmNancestor-      XmCSensitive      Boolean       dynamic             G
 Sensitive
 XmNbackground     XmCBackground     Pixel         dynamic             CSG
 XmNbackground-    XmCPixmap         Pixmap        XmUNSPECIFIED_-     CSG
 Pixmap                                            PIXMAP
 XmNborderColor    XmCBorderColor    Pixel         XtDefaultForeground CSG
 XmNborderPixmap   XmCPixmap         Pixmap        XmUNSPECIFIED_-     CSG
                                                   PIXMAP
 XmNborderWidth    XmCBorderWidth    Dimension     0                   CSG
 XmNcolormap       XmCColormap       Colormap      dynamic             CG
 XmNdepth          XmCDepth          int           dynamic             CG
 XmNdestroyCallbackXmCCallback       XtCallbackListNULL                C
 XmNheight         XmCHeight         Dimension     dynamic             CSG
 XmNinitial-       XmCInitial-       Boolean       True                C
 Resources-        Resources-
 Persistent        Persistent
 XmNmappedWhen-    XmCMappedWhen-    Boolean       True                CSG
 Managed           Managed
 XmNscreen         XmCScreen         Screen *      dynamic             CG
 XmNsensitive      XmCSensitive      Boolean       True                CSG
 XmNtranslations   XmCTranslations   XtTranslationsdynamic             CSG
 XmNwidth          XmCWidth          Dimension     dynamic             CSG
 XmNx              XmCPosition       Position      0                   CSG
 XmNy              XmCPosition       Position      0                   CSG


    Callback information

    A pointer to the following structure is passed to each callback:

       typedef struct
       {
           int reason;
           XEvent      * event;
       } XmAnyCallbackStruct;


    reason  Indicates why the callback was invoked.  For this callback, rea-
            son is set to XmCRHELP.

    event   Points to the XEvent that triggered the callback.

    Translations

    The XmPrimitive translations are listed below.  These translations may
    not directly correspond to a translation table.

    Note that for buttons in menus, altering translations in #override or
    #augment mode is undefined.

       KUp:            PrimitiveTraverseUp()
       KDown:          PrimitiveTraverseDown()
       KLeft:          PrimitiveTraverseLeft()
       KRight:         PrimitiveTraverseRight()

       KBeginLine:     PrimitiveTraverseHome()

       KNextField:     PrimitiveNextTabGroup()
       KPrevField:     PrimitivePrevTabGroup()

       KActivate:      PrimitiveParentActivate()
       KCancel:        PrimitiveParentCancel()

       KHelp:          PrimitiveHelp()


    Action routines

    The XmPrimitive action routines are described below:

    PrimitiveHelp():
            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.

    PrimitiveNextTabGroup():
            Traverses to the first item in the next tab group. If the current
            tab group is the last entry in the tab group list, it wraps to
            the beginning of the tab group list.

    PrimitiveParentActivate():
            If the parent is a manager, passes the KActivate event received
            by the widget to the parent.

    PrimitiveParentCancel():
            If the parent is a manager, Passes the KCancel event received by
            the widget to the parent.

    PrimitivePrevTabGroup():
            Traverses to the first item in the previous tab group.  If the
            beginning of the tab group list is reached, it wraps to the end
            of the tab group list.

    PrimitiveTraverseDown():
            Traverses to the next item below the current widget in the
            current tab group, wrapping if necessary.

    PrimitiveTraverseHome():
            Traverses to the first widget or gadget in the current tab group.

    PrimitiveTraverseLeft():
            Traverses to the next item to the left of the current widget in
            the current tab group, wrapping if necessary.

    PrimitiveTraverseNext():
            Traverses to the next item in the current tab group, wrapping if
            necessary.

    PrimitiveTraversePrev():
            Traverses to the previous item in the current tab group, wrapping
            if necessary.

    PrimitiveTraverseRight():
            Traverses to the next item to the right of the current gadget in
            the current tab group, wrapping if necessary.

    PrimitiveTraverseUp():
            Traverses to the next item above the current gadget in the
            current tab group, wrapping if necessary.

    Additional behavior

    This widget has the additional behavior described below:

    <FocusIn>:
            If the shell's keyboard focus policy is XmEXPLICIT, highlights
            the widget and gives it the focus.

    <FocusOut>:
            If the shell's keyboard focus policy is XmEXPLICIT, unhighlights
            the widget and removes the focus.

    Virtual bindings

    The bindings for virtual keys are vendor specific.  For information about
    bindings for virtual buttons and keys, see VirtualBindings(Xm).

 See also

    Core(Xm), XmChangeColor(Xm) and XmScreen(Xm).


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026