Box Cell - Maple Help

Maplets[Elements]

 BoxCell
 specify a cell in a box column, box layout, or box row

 Calling Sequence BoxCell(opts)

Parameters

 opts - equation(s) of the form option=value where option is one of halign, hscroll, valign, value, or vscroll; specify options for the BoxCell element

Description

 • The BoxCell layout element specifies an entry in a BoxColumn, BoxLayout, or BoxRow element. The contents of the cell are specified by using the value option.
 • For horizontal control in a box layout, use the BoxRow element. For vertical control in a box layout, use the BoxColumn element.
 • The BoxCell 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 BoxCell element can contain BoxLayout, GridLayout, BorderLayout, or window body elements to specify the value option.
 • A BoxCell element can be contained in a BoxColumn or BoxRow element, or Maplet element in a nested list representing a box layout.
 • The following table describes the control and use of the BoxCell 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 hscroll x valign x value x vscroll x

 • The opts argument can contain one or more of the following equations that set Maplet options.
 halign = left, center, right, or none
 Horizontally aligns the cell when in a BoxRow. 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. For more detail, see BoxRow, and the example of this usage below.
 hscroll = never, as_needed, or always
 This option determines when a horizontal scroll bar appears in the box cell.  By default, the value is never.
 valign = top, center, bottom, or none
 Vertically aligns the cell when in a BoxColumn. 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. For more detail, see BoxColumn.
 value = window body, BoxLayout, GridLayout, or BorderLayout element, or reference to such an element (name or string)
 The Maplet element that appears in this cell.
 vscroll = never, as_needed, or always
 This option determines when a vertical scroll bar appears in the box cell.  By default, the value is never.

Examples

A Maplet application in which element layout is controlled by using BoxCell elements.

 > $\mathrm{with}\left(\mathrm{Maplets}\left[\mathrm{Elements}\right]\right):$
 > $\mathrm{maplet}≔\mathrm{Maplet}\left(\left[\left[\mathrm{BoxCell}\left("Hello",'\mathrm{right}'\right)\right],\left[\mathrm{BoxCell}\left(\mathrm{Button}\left("Quit",\mathrm{Shutdown}\left(\right)\right),'\mathrm{left}'\right)\right]\right]\right):$
 > $\mathrm{Maplets}\left[\mathrm{Display}\right]\left(\mathrm{maplet}\right)$

A Maplet application in which the halign=none option is used in BoxCell elements in combination with HorizontalGlue to achieve better control over the location of objects.

 > \mathrm{maplet}≔\mathrm{Maplet}\left(\mathrm{BoxLayout}\left(\mathrm{BoxColumn}\left(\mathrm{BoxRow}\left(\mathrm{BoxCell}\left("Long text label to force alignment usage"\right)\right),\mathrm{BoxRow}\left(\mathrm{BoxCell}\left(\mathrm{Button}\left("Left1",\mathrm{Shutdown}\left(\right)\right),'\mathrm{halign}'='\mathrm{none}'\right),\mathrm{BoxCell}\left(\mathrm{Button}\left("Left2",\mathrm{Shutdown}\left(\right)\right),'\mathrm{halign}'='\mathrm{none}'\right),\mathrm{HorizontalGlue}\left(\right)\right),\mathrm{BoxRow}\left(\mathrm{BoxCell}\left(\mathrm{Button}\left("Left",\mathrm{Shutdown}\left(\right)\right),'\mathrm{halign}'='\mathrm{none}'\right),\mathrm{HorizontalGlue}\left(\right),\mathrm{BoxCell}\left(\mathrm{Button}\left("Right",\mathrm{Shutdown}\left(\right)\right),'\mathrm{halign}'='\mathrm{none}'\right)\right),\mathrm{BoxRow}\left(\mathrm{HorizontalGlue}\left(\right),\mathrm{BoxCell}\left(\mathrm{Button}\left("Right2",\mathrm{Shutdown}\left(\right)\right),'\mathrm{halign}'='\mathrm{none}'\right),\mathrm{BoxCell}\left(\mathrm{Button}\left("Right1",\mathrm{Shutdown}\left(\right)\right),'\mathrm{halign}'='\mathrm{none}'\right)\right)\right)\right)\right):
 > $\mathrm{Maplets}\left[\mathrm{Display}\right]\left(\mathrm{maplet}\right)$

Note: This is different than the effect of using halight=left/right for the cells, as these options add space between consecutive elements with the same alignment.