Button Group - Maple Help

Maplets[Elements]

 ButtonGroup
 specify associated buttons

 Calling Sequence ButtonGroup(opts) ButtonGroup[refID](opts)

Parameters

 opts - equation(s) of the form option=value where option is one of onchange or reference; specify options for the ButtonGroup element refID - name or string; reference to the element

Description

 • The ButtonGroup element associates radio and toggle buttons so that at most one in the group can be selected.
 • 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 refID reference option

 • A ButtonGroup element cannot contain other elements.
 • A ButtonGroup element can be contained in a Maplet element.
 • The following table describes the control and use of the ButtonGroup 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 onchange x reference x

 • The opts argument can contain one or more of the following equations that set Maplet application options.
 onchange = Action or command element, or reference to an Action element (name or string)
 The action that occurs when the selected RadioButton in the ButtonGroup is changed.
 reference = name or string
 A reference for the ButtonGroup element.
 If the reference is specified by both an index, for example, ButtonGroup[refID], and a reference in the calling sequence, the index reference takes precedence.

Examples

A Maplet application with two distinct button groups:

 > $\mathrm{with}\left(\mathrm{Maplets}\left[\mathrm{Elements}\right]\right):$
 > $\mathrm{maplet}≔\mathrm{Maplet}\left(\left[\left[\mathrm{RadioButton}\left['\mathrm{RB1}'\right]\left("1",'\mathrm{value}'=\mathrm{true},'\mathrm{group}'='\mathrm{BG1}'\right),\mathrm{RadioButton}\left['\mathrm{RB2}'\right]\left("2",'\mathrm{value}'=\mathrm{false},'\mathrm{group}'='\mathrm{BG1}'\right)\right],\left[\mathrm{RadioButton}\left['\mathrm{RB3}'\right]\left("1",'\mathrm{value}'=\mathrm{true},'\mathrm{group}'='\mathrm{BG2}'\right),\mathrm{RadioButton}\left['\mathrm{RB4}'\right]\left("2",'\mathrm{value}'=\mathrm{false},'\mathrm{group}'='\mathrm{BG2}'\right)\right],\left[\mathrm{Button}\left("OK",\mathrm{Shutdown}\left(\left['\mathrm{RB1}','\mathrm{RB2}','\mathrm{RB3}','\mathrm{RB4}'\right]\right)\right),\mathrm{Button}\left("Cancel",\mathrm{Shutdown}\left(\right)\right)\right]\right],\mathrm{ButtonGroup}\left['\mathrm{BG1}'\right]\left(\right),\mathrm{ButtonGroup}\left['\mathrm{BG2}'\right]\left(\right)\right):$
 > $\mathrm{Maplets}\left[\mathrm{Display}\right]\left(\mathrm{maplet}\right)$