Label - Maple Help

Maplets[Elements]

 Label
 define a label in a Maplet application

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

Parameters

 opts - equation(s) of the form option=value where option is one of background, caption, enabled, font, foreground, halign, height, image, reference, tooltip, valign, visible, or width; specify options for the Label element refID - name or string; reference to the element

Description

 • The Label window body element defines a label in a Maplet application.

 • The Label 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 Font element font option Image element image option refID reference option string or symbol caption option

 • For large sections of text, use a TextBox element (instead of a Label element) with the option 'editable' = 'false' and appropriate values for the height and width options.
 • A Label element can contain a Font element to specify the font option and an Image element to specify the image option.
 • A Label element can be contained in a Maplet, BoxLayout, GridLayout or BorderLayout element, or Maplet element in a nested list representing a box layout.
 • The following table describes the control and use of the Label 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 x x caption x x x enabled x x x font x x x foreground x x x halign x height x image x x reference x tooltip x x x valign x visible x x x width x

 • The opts argument can contain one or more of the following equations that set Maplet application options.
 background = color
 The color of the highlights of the label.  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.
 caption = string or symbol
 The caption that appears on the label.
 enabled = true or false
 Whether a label can be selected.  If enabled is set to false, the label is dimmed. By default, the value is true.
 font = Font element or reference to a Font element (name or string)
 The text font in the label.
 foreground = color
 The face color of the label.
 halign = left, center, or right
 Specifies the horizontal alignment for the label contents.
 height = posint
 The height in pixels. By default the label is sized to fit its content.
 image = Image element or reference to an Image element (name or string)
 A reference to an Image element.
 reference = name or string
 A reference for the Label element.
 If the reference is specified by both an index, for example, Label[refID], and a reference in the calling sequence, the index reference takes precedence.
 tooltip = symbol or string
 Text that appears in the tooltip help window.
 valign = top, center, or bottom
 Specifies the vertical alignment for the label contents.
 visible = true or false
 Whether the label is visible to the user.  By default, the value is true.
 width = posint
 The width in pixels. By default the label is sized to fit its content.

Examples

 > $\mathrm{with}\left(\mathrm{Maplets}\left[\mathrm{Elements}\right]\right):$
 > $\mathrm{maplet}≔\mathrm{Maplet}\left(\left[\left[\mathrm{Label}\left("Enter your name:",'\mathrm{font}'=\mathrm{Font}\left("courier",14\right)\right),\mathrm{TextField}\left['\mathrm{IF1}'\right]\left(20\right)\right],\left[\mathrm{Label}\left("Use the format",'\mathrm{font}'=\mathrm{Font}\left("helvetica",12\right)\right),\mathrm{Label}\left("John W. Smith",'\mathrm{font}'=\mathrm{Font}\left("helvetica",\mathrm{italic},12\right)\right)\right],\left[\mathrm{Button}\left("OK",\mathrm{Shutdown}\left(\left['\mathrm{IF1}'\right]\right)\right),\mathrm{Button}\left("Cancel",\mathrm{Shutdown}\left(\right)\right)\right]\right]\right):$
 > $\mathrm{Maplets}\left[\mathrm{Display}\right]\left(\mathrm{maplet}\right)$