Motif Tools Library, Version 3.1
$Id: XmtLayoutBox.man,v 1.1 2001/07/14 19:40:43 grmcdorman Exp $
Written by David Flanagan.
Copyright (c) 1992-2001 by David Flanagan.
All Rights Reserved. See the file COPYRIGHT for details.
This is open source software. See the file LICENSE for details.
There is no warranty for this software. See NO_WARRANTY for details.
This page documents: XmtLayoutBox
XmtLayoutBox 3 "Motif Tools" Xmt
NAME
XmtLayoutBox - the row or column gadget used within the
XmtLayout widget.
SYNOPSIS
"Include File:"
#include <Xmt/LayoutG.h>
"Constructor:"
XmtCreateLayoutBox(), XmtLayoutCol(), XmtLayoutRow()
"Class Name:"
XmtLayoutBox
"Class Pointer:"
xmtLayoutBoxGadgetClass
"Class Hierarchy:"
RectObj \(-> XmtLayoutGadget \(-> XmtLayoutBox
DESCRIPTION
The XmtLayoutBox widget is a gadget designed to be used
with the XmtLayout widget which organizes other children
of the Layout into rows and columns. The Layout widget
organizes its children into nested rows and columns; the
LayoutBox acts as a ``container'' to group items in a row
or column together. Note that the LayoutBox is not a composite
widget like the XmRowColumn widget. Layout items
within a row or column are siblings of the LayoutBox, not
children of it. The LayoutBox serves as a placeholder for
grouping items-children of an Layout widget can be placed
within a particular LayoutBox gadget by setting the XmtNlayoutIn
constraint resource to point to the LayoutBox.
The LayoutBox does not have any visual appearance of its
own, but as a child of the Layout widget, it can have a
caption or frame automatically provided by the widget.
Also, the LayoutBox can specify the way the items it
contains will be spaced, and can specify that the items it
contains should be made the same width or height.
RESOURCES
XmtLayoutBox inherits the resources of the RectObj and XmtLayoutGadget classes, and defines the following new resources:
Name|Type|Class|Access|Default |
XmtNbackground|XtRPixel|XtCBackground|CSG|unspecified |
XmtNequal|XtRBoolean|XmtCEqual|CSG|(XtPointer)False |
XmtNitemStretch|XtRDimension|XmtCItemStretch|CSG|1 |
XmtNorientation|XmROrientation|XmCOrientation|CSG|XmHORIZONTAL |
XmtNspace|XtRDimension|XmtCSpace|CSG|0 |
XmtNspaceStretch|XtRDimension|XmtCSpaceStretch|CSG|1 |
XmtNspaceType|XtRXmtLayoutSpaceType|XmtCSpaceType|CSG|XmtLayoutSpaceNone |
XmtNbackground
The color to use for the background of the row or
column. If specified, the LayoutBox will fill
itself with this color before any captions, frames
or other decorations are drawn. If no color is
specified, the LayoutBox will take no special
action, and will have the same background color as
its parent Layout widget.
XmtNequal
Whether items in a row should have equal widths or
items in a column should have equal heights. If
this resource is set to True, and the LayoutBox is
configured as a row, then any items in that widget
(except for separator or space gadgets) will have
their widths adjusted so that they are all as wide
as the widest item. Similarly, items in a column
will have their heights adjusted so that they are
as high as the highest item. If this resource is
False (the default), then no special action will be
taken to adjust the width or height of items in
rows or columns. Setting this resource is often
useful for button boxes at the bottom of dialogs in
which each button should be as wide as each of the
others. Note that this resource adjusts the width
of items in a row. The height of items in a row is
controlled by the XmtNlayoutJustification constraint
resource of each item. By default, items
in a row are all have a justification of XmtLayoutFilled,
which means that they will all be forced to
be as high as the row is, which implies that they
will all have the same height.
XmtNitemStretch
If XmtNspaceType is not XmtLayoutSpaceNone, this
resource, with XmtNspaceStretch specifies the
relative stretchiness of the items in this row or
column to the spaces automatically inserted between
those items. If XmtNitemStretch is 2, for example,
and XmtNspaceStretch is 1, then the items of the
row will do 2/3rds of the stretching, and the
spaces between them will do 1/3 of the stretching.
If this resource is zero, then the spaces do all
the stretching, and the items stay a fixed width.
XmtNorientation
Whether this LayoutBox should be a row or a column.
If this resource is XmHORIZONTAL (the default),
then the LayoutBox will be a row. If it is XmVERTICAL,
then the LayoutBox will be a column.
XmtNspace
If XmtNspaceType is not XmtLayoutSpaceNone, this
resource specifies the amount of space (in pixels)
that will be inserted between items in the Layout
Box when computing the natural size of the box.
XmtNspaceStretch
If XmtNspaceType is not XmtLayoutSpaceNone, this
resource, with XmtNitemStretch specifies the relative
stretchiness of the items in this row or column
and the spaces that are inserted between those
items. If XmtNspaceStretch is 2, for example, and
XmtNitemStretch is 1, then the spaces are twice as
stretchy as the items and will do 2/3rds of the
stretching. If XmtNspaceStretch is 0, and XmtNitemStretch
is not zero, then the spaces will
remain a fixed size, and the items will do all the
stretching.
XmtNspaceType
The model the LayoutBox uses to space its children
along its major dimension (i.e. horizontally in
rows, and vertically in columns.) The default is
XmtLayoutSpaceNone which specifies that items are
laid out left-to-right or top-to-bottom with no
extra space inserted between them. Other legal
values are XmtLayoutSpaceEven, XmtLayoutSpaceLREven,
XmtLayoutSpaceInterval, and XmtLayoutSpace
LCR. See Chapter 19, The Layout Widget: The
Details, for an explanation of these spacing models,
and of the XmtLayout layout scheme in general.
SEE ALSO
Chapter 19, The Layout Widget: The Details,
XmtCreateLayoutBox(),
XmtCreateLayoutCol(),
XmtCreateLayoutRow(),
XmtLayout,
XmtLayoutPixmap,
XmtLayoutSeparator,
XmtLayoutSpace,
XmtLayoutString.