Box Row - Maple Help

Maplets[Elements]

 BoxRow
 specify a row in a box layout

 Calling Sequence BoxRow(opts, element_content)

Parameters

 opts - equation(s) of the form option=value where option is one of background, border, caption, font, halign, hscroll, inset, spacing, valign, visible, or vscroll; specify options for the BoxRow element element_content - any number of BoxCell, BoxColumn, or BoxRow elements

Description

 • The BoxRow layout element specifies a row in a box layout.
 • Use BoxRow for horizontal control in a box layout.
 • The BoxRow 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 top or bottom valign option

 • A BoxRow element can contain any number of BoxCell, BoxColumn, or BoxRow elements.
 • A BoxRow element can be contained in a BoxColumn, BoxLayout, or BoxRow element.
 • The following table describes the control and use of the BoxRow 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 x caption x font x halign x hscroll x inset x spacing x valign x visible x vscroll x

 • 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 row.  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 box has a border.  By default, the value is false.
 caption = string
 The text that appears above the box row.  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
 Horizontally aligns the contents of the row. By default, the value is center.
 Horizontal alignment of elements in a box row is accomplished by the addition of HorizontalGlue spacing elements: left alignment is obtained by adding a HorizontalGlue after the element, right alignment is obtained by adding a HorizontalGlue before the element, and center alignment is obtained by adding a HorizontalGlue both before and after the element. Choosing an alignment of none allows finer control by allowing specification of all HorizontalGlue elements manually (see examples/AdvancedMapletsLayout for more detail).
 hscroll = never, as_needed, or always
 This option determines when a horizontal scroll bar appears in the box row.  By default, the value is never.
 inset = nonnegint
 The amount of padding that surrounds the elements in the box row. The default inset is $5$ pixels.
 spacing = nonnegint
 The amount of padding that separates the individual elements in the box row. The default inset is $5$ pixels.
 valign = top, center, or bottom
 Specifies the default vertical alignment for any BoxColumn layout objects contained in the row. By default, the value is center. The none option allows finer control of the alignment of contents when sed in combination with VerticalGlue (see BoxColumn for more detail).
 Note: The valign option does not directly affect a box row object, but the specified valign value is inherited as the default vertical alignment for any BoxColumn elements it contains.
 visible = true or false
 Whether the box is visible to the user.  By default, the value is true.
 vscroll = never, as_needed, or always
 This option determines when a vertical scroll bar appears in the box row.  By default, the value is never.

Examples

 > $\mathrm{with}\left(\mathrm{Maplets}\left[\mathrm{Elements}\right]\right):$
 > $\mathrm{maplet}≔\mathrm{Maplet}\left(\mathrm{Window}\left('\mathrm{layout}'='\mathrm{BL1}'\right),\mathrm{BoxLayout}\left['\mathrm{BL1}'\right]\left(\mathrm{BoxColumn}\left(\mathrm{BoxRow}\left("Enter text:",\mathrm{TextField}\left['\mathrm{TF1}'\right]\left(\right)\right),\mathrm{Button}\left("OK",\mathrm{Shutdown}\left(\left['\mathrm{TF1}'\right]\right)\right)\right)\right)\right):$
 > $\mathrm{Maplets}\left[\mathrm{Display}\right]\left(\mathrm{maplet}\right)$

This is identical to:

 > $\mathrm{maplet}≔\mathrm{Maplet}\left(\left[\left["Enter text:",\mathrm{TextField}\left['\mathrm{TF1}'\right]\left(\right)\right],\mathrm{Button}\left("OK",\mathrm{Shutdown}\left(\left['\mathrm{TF1}'\right]\right)\right)\right]\right):$
 > $\mathrm{Maplets}\left[\mathrm{Display}\right]\left(\mathrm{maplet}\right)$

A row of buttons with alignment handled manually using HorizontalGlue.

 > \mathrm{maplet}≔\mathrm{Maplet}\left(\mathrm{BoxLayout}\left(\mathrm{BoxColumn}\left(\mathrm{BoxRow}\left(\mathrm{Label}\left("This is a long line of text to force usage of the alignment for the buttons below"\right)\right),\mathrm{BoxRow}\left('\mathrm{halign}'='\mathrm{none}',\mathrm{Button}\left("Left",\mathrm{Shutdown}\left(\left[\right]\right)\right),\mathrm{Button}\left("NxtLeft",\mathrm{Shutdown}\left(\left[\right]\right)\right),\mathrm{HorizontalGlue}\left(\right),\mathrm{Button}\left("Mid",\mathrm{Shutdown}\left(\left[\right]\right)\right),\mathrm{HorizontalGlue}\left(\right),\mathrm{Button}\left("Right",\mathrm{Shutdown}\left(\left[\right]\right)\right)\right)\right)\right)\right):
 > $\mathrm{Maplets}\left[\mathrm{Display}\right]\left(\mathrm{maplet}\right)$