Maplets[Elements]
GridCell
specify an entry in a row of a grid layout
Calling Sequence
Parameters
Description
Examples
GridCell(opts)
opts
-
equation(s) of the form option=value where option is one of halign, height, hscroll, hweight, valign, value, vscroll, vweight, or width; specify options for the GridCell element
The GridCell layout element specifies an entry in a row of a grid layout.
The contents of the cell are specified by using the value option.
The GridCell element features can be modified by using options. To simplify specifying options in the Maplets package, certain options and contents can be set without using an equation. The following table lists elements, symbols, and types (in the left column) and the corresponding option or content (in the right column) to which inputs of this type are, by default, assigned.
Elements, Symbols, or Types
Assumed Option or Content
always, as_needed, or never
hscroll and vscroll options
left or right
halign option
string or symbol
value option
top or bottom
valign option
A GridCell element can contain BoxLayout, GridLayout, or window body elements to specify the value option.
A GridCell element can only be contained in a GridRow element.
The following table describes the control and use of the GridCell element options.
An x in the I column indicates that the option can be initialized, that is, specified in the calling sequence (element definition).
An x in the R column indicates that the option is required in the calling sequence.
An x in the G column indicates that the option can be read, that is, retrieved by using the Get tool.
An x in the S column indicates that the option can be written, that is, set by using the SetOption element or the Set tool.
Option
I
R
G
S
halign
x
height
hscroll
hweight
valign
vscroll
vweight
value
width
The opts argument can contain one or more of the following equations that set Maplet application options.
halign = left, center, right, or full
Horizontal alignment of the cell contents. By default, the value is inherited from either the parent GridRow, or if unset, the parent GridLayout, or if unset then defaults to center. The value full, rather than aligning the cell contents, attempts to horizontally stretch the cell contents to fill the cell.
height = posint
The number of grid rows the cell spans. By default, the value is 1.
Note: The height parameter does not control the height of its content, only its position.
hscroll = never, as_needed, or always
This option determines when a horizontal scroll bar appears in the grid cell. By default, the value is never.
hweight = integer in the range 0..10
This option specifies the amount of stretch to apply to the column the GridCell appears in when the GridLayout is horizontally resized. A value of 0 (the default) corresponds to no stretching, while a value of 10 (the maximum) corresponds to full stretching. The stretch value for a column in a GridLayout is taken to be the maximum stretch value for all GridCell elements in that column.
valign = top, center, bottom, or full
Vertical alignment of the cell contents. By default, the value is inherited from either the parent GridRow, or if unset, the parent GridLayout, or if unset then defaults to center. The value full, rather than aligning the cell contents, attempts to vertically stretch the cell contents to fill the cell.
value = window body, BoxLayout, or GridLayout element, or reference to such an element (name or string)
The Maplet application element that appears in the grid cell.
vscroll = never, as_needed, or always
This option determines when a vertical scroll bar appears in the grid cell. By default, the value is never.
vweight = integer in the range 0..10
This option specifies the amount of stretch to apply to the row the GridCell appears in when the GridLayout is vertically resized. A value of 0 (the default) corresponds to no stretching, while a value of 10 (the maximum) corresponds to full stretching. The stretch value for a row in a GridLayout is taken to be the maximum stretch value for all GridCell elements in that row.
width = posint
The number of grid cells that the cell spans. By default, the value is 1.
Note: The width parameter does not control the width of its content, only its position.
Alignment example:
with⁡MapletsElements:
maplet≔Maplet⁡GridLayout⁡halign=left,inset=3,GridRow⁡Spacing:,GridCell⁡-----------------,GridRow⁡Right alignment:,GridCell⁡Button⁡Sample,onclick=Shutdown⁡,halign=right,GridRow⁡Center alignment:,GridCell⁡Button⁡Sample,onclick=Shutdown⁡,halign=center,GridRow⁡Left alignment:,GridCell⁡Button⁡Sample,onclick=Shutdown⁡,halign=left,GridRow⁡Full alignment:,GridCell⁡Button⁡Sample,onclick=Shutdown⁡,halign=full:
MapletsDisplay⁡maplet
Using height and width:
maplet≔Maplet⁡GridLayout⁡GridRow⁡GridCell⁡height=3,TextBox⁡width=5,height=3,GridCell⁡width=3,TextBox⁡width=15,height=1,GridRow⁡GridCell⁡height=2,width=2,TextBox⁡width=10,height=2,GridCell⁡height=2,TextBox⁡width=5,height=2,GridRow⁡GridCell⁡width=4,TextBox⁡width=20,height=1:
Similar layout using bottom row for vertical resize and center column for horizontal resize with multi-line buttons and using 'full' alignment
maplet≔Maplet⁡GridLayout⁡halign=full,valign=full,GridRow⁡GridCell⁡height=3,Button⁡l\ne\nf\nt,onclick=Shutdown⁡,GridCell⁡Button⁡top,onclick=Shutdown⁡,GridCell⁡height=3,Button⁡r\ng\nh\nt,onclick=Shutdown⁡,GridRow⁡GridCell⁡height=2,hweight=10,Button⁡OK,onclick=Shutdown⁡,GridRow⁡GridCell⁡width=3,vweight=10,Button⁡done,onclick=Shutdown⁡:
See Also
Maplets/LayoutElements
Maplets/WindowBodyElements
Maplets[Display]
Maplets[Elements][BoxLayout]
Maplets[Elements][Button]
Maplets[Elements][GridLayout]
Maplets[Elements][GridRow]
Maplets[Elements][Maplet]
Maplets[Elements][SetOption]
Maplets[Tools][Get]
Maplets[Tools][Set]
Overview of Maplet Applications
Download Help Document