Maplets[Elements]
BoxLayout
define a box layout
Calling Sequence
Parameters
Description
Examples
BoxLayout(opts, element_content)
BoxLayout[refID](opts, element_content)
opts
-
equation(s) of the form option=value where option is one of background, border, caption, font, inset, reference, vertical, or visible; specify options for the BoxLayout element
element_content
any number of BoxCell, BoxColumn, or BoxRow elements
refID
name or string; reference to the element
The BoxLayout layout element defines a box layout in a Maplet application. A box layout is a relative layout scheme in which you can control where items appear horizontally or vertically relative to other elements. If there is more than one content element, they are displayed in a row.
For horizontal control in a box layout, use the BoxRow element. For vertical control in a box layout, use the BoxColumn element.
To align BoxColumn and BoxRow elements vertically using the BoxLayout element, you can use the BoxColumn element or specify vertical=true for BoxLayout.
The BoxLayout 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
reference option
string or symbol
caption option
A BoxLayout element can contain any number of BoxCell, BoxColumn, or BoxRow elements.
A BoxLayout element can be contained in a Maplet, GridCell, GridCell2, or Window element, or equation for the layout option in a Window element.
The following table describes the control and use of the BoxLayout 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
background
x
border
caption
font
halign
inset
reference
valign
vertical
visible
The opts argument can contain one or more of the following equations that set Maplet options.
background = color
The color of the highlights of the box layout. This can be a recognized color name, an RGB color structure, or a string of the form "#RRGGBB" where each pair is a two-digit hexadecimal number.
border = true or false
Whether the table has a border. By default, the value is false.
caption = string
The text that appears above the box layout. The caption is visible only if the option border is set to true.
font = Font element or reference to a Font element (name or string)
The text font in the caption.
halign = left, center, right, or none
Specifies the default horizontal alignment for any BoxRow elements contained in the layout. By default, the value is center. The none option can be used in combination with HorizontalGlue elements for finer control of the layout of cells in a row.
inset = nonnegint
The amount of padding that surrounds the elements in the box layout. The default inset is 5 pixels.
reference = name or string
A reference for the BoxLayout element.
If the reference is specified by both an index, for example, BoxLayout[refID], and a reference in the calling sequence, the index reference takes precedence.
valign = top, center, bottom, or none
Specifies the default vertical alignment for any BoxColumn elements contained in the layout. By default, the value is center. The none option can be used in combination with VerticalGlue elements for finer control of the layout of cells in a column.
vertical = true or false
Whether the BoxColumn or BoxRow elements are arranged in a vertical column. By default, the value is false.
visible = true or false
Whether the table is visible to the user. By default, the value is true.
with⁡MapletsElements:
maplet≔Maplet⁡Window⁡layout=BL1,BoxLayoutBL1⁡BoxColumn⁡BoxRow⁡Enter text:,TextFieldTF1⁡,Button⁡OK,Shutdown⁡TF1:
MapletsDisplay⁡maplet
This Maplet application is identical to:
maplet≔Maplet⁡Enter text:,TextFieldTF1⁡,Button⁡OK,Shutdown⁡TF1:
A Maplet application in which the halign=none option is used in combination with HorizontalGlue to achieve better control over the location of elements in the layout.
maplet≔Maplet⁡BoxLayout⁡halign=none,BoxColumn⁡BoxRow⁡Long text label to force alignment usage,BoxRow⁡Button⁡Left1,Shutdown⁡,Button⁡Left2,Shutdown⁡,HorizontalGlue⁡,BoxRow⁡Button⁡Left,Shutdown⁡,HorizontalGlue⁡,Button⁡Right,Shutdown⁡,BoxRow⁡HorizontalGlue⁡,Button⁡Right2,Shutdown⁡,Button⁡Right1,Shutdown⁡:
See Also
Maplets/LayoutElements
Maplets[Display]
Maplets[Elements][BoxCell]
Maplets[Elements][BoxColumn]
Maplets[Elements][BoxRow]
Maplets[Elements][Button]
Maplets[Elements][Font]
Maplets[Elements][HorizontalGlue]
Maplets[Elements][Maplet]
Maplets[Elements][SetOption]
Maplets[Elements][Shutdown]
Maplets[Elements][TextField]
Maplets[Elements][VerticalGlue]
Maplets[Elements][Window]
Maplets[Tools][Get]
Maplets[Tools][Set]
Overview of Maplet Applications
plot[color]
Download Help Document