Maplets[Elements] - Maple Help

# Online Help

###### All Products    Maple    MapleSim

Home : Support : Online Help : Programming : Maplets : Elements : Other Elements : Maplets/Elements/Item

Maplets[Elements]

 Item
 specify an item in a box element

 Calling Sequence Item(opts)

Parameters

 opts - equation(s) of the form value=string; specify options for the Item element

Description

 • The Item element specifies an item in a ComboBox, DropDownBox, or ListBox element.
 • The Item 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 string or symbol value option

 • An Item element cannot contain other elements.
 • An Item element can be contained in a ComboBox DropDownBox, or ListBox element.
 • The following table describes the control and use of the Item 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 value x x

 • The opts argument can contain one or more of the following equations that set Maplet application options.
 value = string or symbol
 A string that is an entry in a combo, list, or drop-down box.

Examples

A Maplet application that prompts the user for a favorite color:

 > $\mathrm{with}\left(\mathrm{Maplets}[\mathrm{Elements}]\right):$
 > $\mathrm{maplet}≔\mathrm{Maplet}\left(\left[\left["Pick your favorite color:",\mathrm{ComboBox}['\mathrm{CoB1}']\left(\mathrm{Item}\left("red"\right),\mathrm{Item}\left("green"\right),\mathrm{Item}\left("blue"\right),\mathrm{Item}\left("none of the above"\right)\right)\right],\left[\mathrm{Button}\left("OK",\mathrm{Shutdown}\left(\left['\mathrm{CoB1}'\right]\right)\right),\mathrm{Button}\left("Cancel",\mathrm{Shutdown}\left(\right)\right)\right]\right]\right):$
 > $\mathrm{Maplets}[\mathrm{Display}]\left(\mathrm{maplet}\right)$

This can be done more easily by using a list in a ComboBox.

 > $\mathrm{maplet}≔\mathrm{Maplet}\left(\left[\left["Pick your favorite color:",\mathrm{ComboBox}['\mathrm{CoB1}']\left(\left["red","green","blue"\right]\right)\right],\left[\mathrm{Button}\left("OK",\mathrm{Shutdown}\left(\left['\mathrm{CoB1}'\right]\right)\right),\mathrm{Button}\left("Cancel",\mathrm{Shutdown}\left(\right)\right)\right]\right]\right):$
 > $\mathrm{Maplets}[\mathrm{Display}]\left(\mathrm{maplet}\right)$

## Was this information helpful?

 Please add your Comment (Optional) E-mail Address (Optional) What is ? This question helps us to combat spam