Maplets[Elements]
InputDialog
define an input dialog
Calling Sequence
Parameters
Description
Examples
InputDialog(opts)
InputDialog[refID](opts)
opts
-
equation(s) of the form option=value where option is one of caption, height, onapprove, oncancel, reference, resizable, title, type, value, or width; specify options for the InputDialog element
refID
name or string; reference to the element
The InputDialog dialog element defines a input dialog in a Maplet application. The dialog contains a caption, a text field, and two buttons, OK and Cancel.
Maplets dialog elements have a predefined layout. For a dialog, an author cannot specify elements. This is different from the Window element, which can contain other elements, for example, buttons and layout elements.
The InputDialog 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
`error`, information, plain or warning
type option
reference option
string or symbol
caption option
An InputDialog element can contain Action or command elements to specify the onapprove and oncancel options.
An InputDialog element can be contained in a Maplet element.
The following table describes the control and use of the InputDialog 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
caption
x
height
onapprove
oncancel
reference
resizable
title
type
value
width
The opts argument can contain one or more of the following equations that set Maplet application options.
caption = string or symbol
The text that appears in the body of the input dialog.
height = posint
The window height in pixels.
onapprove = Action or command element, or reference to an Action element (name or string)
The action that occurs when the user clicks the OK button. By default, the action shuts down the dialog.
oncancel = Action or command element, or reference to an Action element (name or string)
The action that occurs when the user clicks either the Cancel button or the dialog close button on the title bar. By default, the action shuts down the dialog.
reference = name or string
A reference for the InputDialog element.
If the reference is specified by both an index, for example, InputDialog[refID], and a reference in the calling sequence, the index reference takes precedence.
resizable = true or false
Whether the user can resize the window. By default, false.
title = string or symbol
The text that appears in the title bar of the input dialog. The default title is Input Request.
type = `error`, information, plain, or warning
Displays an icon associated with the caption. By default, a plain input dialog is used, which does not display an icon.
value = string
The text that appears in the text field in the body of the dialog.
width = posint
The window width in pixels.
A Maplet application that has one input dialog which, when closed, exits and returns the entered value in a list or "FAIL":
with⁡MapletsElements:
maplet≔Maplet⁡InputDialogID1⁡Enter an integer,onapprove=Shutdown⁡ID1,oncancel=Shutdown⁡:
MapletsDisplay⁡maplet
See Also
Maplets/CommandElements
Maplets/DialogElements
Maplets[Display]
Maplets[Elements][Action]
Maplets[Elements][Maplet]
Maplets[Elements][RunDialog]
Maplets[Elements][SetOption]
Maplets[Elements][Shutdown]
Maplets[Elements][Window]
Maplets[Tools][Get]
Maplets[Tools][Set]
Overview of Maplet Applications
Download Help Document