Name

ExmGrid — The Grid widget class

Synopsis

#include <Exm/Grid.h>

DESCRIPTION

ExmGrid is a demonstration widget. OSF provides this widget solely to teach programmers how to write their own Motif widgets. OSF does not support this widget in any way.

The source code for the ExmGrid widget illustrates how to do the following:

  • Write a Motif-style manager widget supporting Motif-style resources and constraints

  • Install the XmQTdialogShellSavvy trait and its methods

  • Install the XmQTspecifyRenderTable trait and its methods

ExmGrid is a general-purpose manager capable of containing any widget type as a child. In general, it requires no special knowledge about how its children function.

ExmGrid is like a light-weight version of the standard Motif toolkit XmRowColumn widget. (XmRowColumn has an order of magnitude more code than ExmGrid.) Like XmRowColumn, ExmGrid lays out its children widgets within the cells of a two-dimensional matrix. Unlike XmRowColumn, ExmGrid cannot manage menus.

ExmGrid ignores the value of the XmNshadowThickness resource of XmManager.

Classes

ExmGrid inherits behavior and resources from Core, Composite, Constraint and XmManager.

The class pointer is exmGridWidgetClass.

The class name is ExmGrid.

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 XmN, ExmN, XmC or ExmC prefix and use the remaining letters. To specify one of the defined values for a resource in a .Xdefaults file, remove the Xm or Exm 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).

ExmGrid Resource Set
NameClassTypeDefaultAccess
XmNbuttonRenderTableXmCButtonRenderTableXmRenderTableNULLCSG
XmNcolumnsXmCColumnsshort4CSG
XmNdefaultPositionXmCDefaultPositionBooleantrueCSG
XmNdialogTitleXmCDialogTitleXmStringNULLCSG
XmNlabelRenderTableXmCLabelRenderTableXmRenderTableNULLCSG
XmNmapCallbackXmCCallbackXtCallbackListNULLC
XmNmarginHeightXmCMarginHeightDimension10CSG
XmNmarginWidthXmCMarginWidthDimension10CSG
XmNrowsXmCRowsshort4CSG
XmNtextRenderTableXmCTextRenderTableXmRenderTableNULLCSG
XmNunmapCallbackXmCCallbackXtCallbackListNULLC

XmNbuttonRenderTable 

Specifies the default button render table used by Grid's button descendants (for example, ExmCommandButton or XmPushButton). If a button descendant has not defined a render table, Motif searches the button descendants parent hierarchy for the first ancestor that has the XmQTspecifyRenderTable trait installed. (For example, VendorShell, MenuShell, ExmGrid, XmBulletinBoard and its subclasses all install the XmQTspecifyRenderTable trait.) If the first ancestor encountered is an ExmGrid widget, then the value of XmNbuttonRenderTable becomes the button descendant's render table. If XmNbuttonRenderTable of ExmGrid is NULL, then Motif continues searching ancestors until it finds one that defines a button render table. Refer to XmRenderTable(3) for more information on the creation and structure of a render table.

XmNcolumns 

Specifies the number of columns in the Grid. The default is 4 columns.

XmNdefaultPosition 

Controls the positioning of a DialogShell managing a Grid. This resource has no influence if the Grid is not managed by a DialogShell. If XmNdefaultPosition is true, the DialogShell will center itself at the center of its own parent. For example, if the parent of the DialogShell is an ApplicationShell, then the center of the DialogShell will be at the same coordinates as the center of the ApplicationShell. If the DialogShell becomes unmapped (but stays managed) and then remapped, this resource has no influence on the DialogShell's position. If this resource is False, the DialogShell does not automatically center itself. Instead, the DialogShell (and therefore the Grid) will be positioned according to the values of XmNx and XmNy. Motif will treat the values of XmNx and XmNy as offsets from the upper-left corner of the screen (rather than as offsets from the upper-left corner of the parent shell).

XmNdialogTitle 

Specifies the dialog title. If this resource is not NULL, and the parent of the Grid is a subclass of WMShell, Grid sets the XmNtitle and XmNtitleEncoding of its parent. If the only character set in XmNdialogTitle is ISO8859-1, XmNtitle is set to the string of the title, and XmNtitleEncoding is set to STRING. If XmNdialogTitle contains character sets other than ISO8859-1, XmNtitle is set to the string of the title converted to a compound text string, and XmNtitleEncoding is set to COMPOUND_TEXT. The direction of the title is based on the XmNlayoutDirection resource of the widget.

XmNlabelRenderTable 

Specifies the default button render table used by Grid's label descendants (for example, ExmString or XmLabel). If a label descendant has not defined a render table, Motif searches the label descendants parent hierarchy for the first ancestor that has the XmQTspecifyRenderTable trait installed. (For example, VendorShell, MenuShell, ExmGrid, XmBulletinBoard and its subclasses all install the XmQTspecifyRenderTable trait.) If the first ancestor encountered is an ExmGrid widget, then the value of XmNlabelRenderTable becomes the label descendant's render table. If XmNlabelRenderTable of ExmGrid is NULL, then Motif continues searching ancestors until it finds one that defines a label render table. Refer to XmRenderTable(3) for more information on the creation and structure of a render table.

XmNmapCallback 

Specifies the list of callbacks that is called only when the parent of the Grid is a DialogShell. If the parent of the Grid is not a DialogShell, XmNmapCallback has no influence. Assuming that the parent of the Grid is a DialogShell, the callback list is invoked when the DialogShell (and therefore the Grid) is mapped. The callback reason is XmCR_MAP. DialogShells are usually mapped when the Grid is managed.

XmNmarginHeight 

Specifies the amount of blank space between the top edge of the Grid widget and the first item in each column, and between the bottom edge of the Grid widget and the last item in each column. The default value is 10 pixels.

XmNmarginWidth 

Specifies the amount of blank space between the left edge of the Grid widget and the first item in each row, and between the right edge of the Grid widget and the last item in each row. The default value is 10 pixels.

XmNrows 

Specifies the number of rows in the Grid. The default is 4 rows.

XmNtextRenderTable 

Specifies the default button render table used by Grid's text descendants (for example, XmText, XmTextField, and XmList). If a text descendant has not defined a render table, Motif searches the text descendants parent hierarchy for the first ancestor that has the XmQTspecifyRenderTable trait installed. (For example, VendorShell, MenuShell, ExmGrid, XmBulletinBoard and its subclasses all install the XmQTspecifyRenderTable trait.) If the first ancestor encountered is an ExmGrid widget, then the value of XmNtextRenderTable becomes the text descendant's render table. If XmNtextRenderTable of ExmGrid is NULL, then Motif continues searching ancestors until it finds one that defines a text render table. Refer to XmRenderTable(3) for more information on the creation and structure of a render table.

XmNunmapCallback 

Specifies the list of callbacks that is called only when the parent of the Grid is a DialogShell. In this case, this callback list is invoked when the Grid is unmapped. The callback reason is XmCR_UNMAP. DialogShells are usually unmapped when the Grid is unmanaged.

ExmGrid Constraint Resource Set
NameClassTypeDefaultAccess
ExmNgridMarginHeightWithinCellExmCGridMarginHeightWithinCellDimension0CSG
ExmNgridMarginWidthWithinCellExmCGridMarginWidthWithinCellDimension0CSG

ExmNgridMarginHeightWithinCell 

Specifies the amount of blank space between the top edge of a child widget and the top of its cell. Also specifies the amount of blank space between the bottom edge of a child widget and the bottom of its cell.

ExmNgridMarginWidthWithinCell 

Specifies the amount of blank space between the left edge of a child widget and the left edge of its cell. Also specifies the amount of blank space between the right edge of a child widget and the right edge of its cell.

Inherited Resources

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

XmManager Resource Set
NameClassTypeDefaultAccess
XmNbottomShadowColorXmCBottomShadowColorPixeldynamicCSG
XmNbottomShadowPixmapXmCBottomShadowPixmapPixmapXmUNSPECIFIED_PIXMAPCSG
XmNforegroundXmCForegroundPixeldynamicCSG
XmNhelpCallbackXmCCallbackXtCallbackListNULLC
XmNhighlightColorXmCHighlightColorPixeldynamicCSG
XmNhighlightPixmapXmCHighlightPixmapPixmapdynamicCSG
XmNinitialFocusXmCInitialFocusWidgetNULLCSG
XmNlayoutDirectionXmCLayoutDirectionXmDirectiondynamicCG
XmNnavigationTypeXmCNavigationTypeXmNavigationTypeXmTAB_GROUPCSG
XmNpopupHandlerCallbackXmCCallbackXtCallbackListNULLC
XmNshadowThicknessXmCShadowThicknessDimension0CSG
XmNstringDirectionXmCStringDirectionXmStringDirectiondynamicCG
XmNtopShadowColorXmCTopShadowColorPixeldynamicCSG
XmNtopShadowPixmapXmCTopShadowPixmapPixmapdynamicCSG
XmNtraversalOnXmCTraversalOnBooleantrueCSG
XmNunitTypeXmCUnitTypeunsigned chardynamicCSG
XmNuserDataXmCUserDataXtPointerNULLCSG

Composite Resource Set
NameClassTypeDefaultAccess
XmNchildrenXmCReadOnlyWidgetListNULLG
XmNinsertPositionXmCInsertPositionXtOrderProcNULLCSG
XmNnumChildrenXmCReadOnlyCardinal0G

Core Resource Set
NameClassTypeDefaultAccess
XmNacceleratorsXmCAcceleratorsXtAcceleratorsdynamicCSG
XmNancestorSensitiveXmCSensitiveBooleandynamicG
XmNbackgroundXmCBackgroundPixeldynamicCSG
XmNbackgroundPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG
XmNborderColorXmCBorderColorPixelXtDefaultForegroundCSG
XmNborderPixmapXmCPixmapPixmapXmUNSPECIFIED_PIXMAPCSG
XmNborderWidthXmCBorderWidthDimension0CSG
XmNcolormapXmCColormapColormapdynamicCG
XmNdepthXmCDepthintdynamicCG
XmNdestroyCallbackXmCCallbackXtCallbackListNULLC
XmNheightXmCHeightDimensiondynamicCSG
XmNinitialResourcesPersistentXmCInitialResourcesPersistentBooleantrueC
XmNmappedWhenManagedXmCMappedWhenManagedBooleantrueCSG
XmNscreenXmCScreenScreen *dynamicCG
XmNsensitiveXmCSensitiveBooleantrueCSG
XmNtranslationsXmCTranslationsXtTranslationsdynamicCSG
XmNwidthXmCWidthDimensiondynamicCSG
XmNxXmCPositionPosition0CSG
XmNyXmCPositionPosition0CSG

Translations

ExmGrid inherits all the translations of XmManager. ExmGrid does not provide any additional translations beyond those defined by XmManager.

Action Routines

ExmGrid provides no action routines of its own.

RELATED

Core(3), Composite(3), Constraint(3), and XmManager(3).