The Grid widget class allows the user to define a two dimensional world
coordinate system and to draw the corresponding grid. A rich set of resources
is available for customizing the appearance of the grid lines, the grid frame
and the annotation. Axes of the Grid widget can be linear or logarithmic. Grid
lines can be displayed as solid lines, dashed lines or 3D lines. The type,
thickness and color of the grid lines can be set independently for vertical and
horizontal grid lines for both major and minor annotation. The font, format
and orientation of the annotation text can also be customized for both the
horizontal and vertical directions. The Grid widget class inherits all of the
resources and functions defined by its superclasses CompBase and EditObject.
Therefore, Graphic object editing, zooming, and hardcopy output is supported
for the Grid class.
Multiple Axes
The Grid widget class defines a single coordinate system in the horizontal
direction and a single coordinate system in the vertical direction. Multiple
coordinate systems in either direction can be obtained by creating Axis widgets
in either direction as children of Grid widget. The positioning of the child
Axis widget can be specified using the constraint resources defined by the Grid
widget class. Coordinate system transformations are provided for all of the
axes used by a Grid widget, using functions defined by the CompBase widget
class (for the Grid coordinate system) and the Axis widget class (for the
additional axes created).
Scrolling
Grid widgets and widget classes derived from the Grid class can be scrolled
using a Scroll widget. When created as a child of a Scroll widget, the Grid
widget annotation areas are drawn into the Scroll widget's annotation windows
and the Grid widget's margins are set to 0. When the Grid widget is scrolled
using the Scroll widget, the grid annotation always remains visible.
Margin Size Specification
The Grid class has the ability to automatically determine the optimal size for
one or more of the margins around the gridded display according to the setting
of the XmNautoMarginAdjust resource. You can choose which of the margins will
be automatically sized and which will be sized according to values of the
margin resources (XmNtopMargin, XmNleftMargin, XmNrightMargin,
XmNbottomMargin). However, if a Grid widget is a child of a Scroll widget the
sizes of the (non-auto sized) margins are set using the resources of the Scroll
widget (XmNtopAnnotationHeight, XmNleftAnnotationWidth,
XmNrightAnnotationHeight, XmNbottomAnnotationHeight).
Grid Widget Appearance
Below is an illustration of a Grid widget with an additional horizontal Axis
widget and an additional vertical Axis widget.