Maplets[Elements]
ColorDialog
define a color dialog
Calling Sequence
Parameters
Description
Examples
ColorDialog(opts)
ColorDialog[refID](opts)
opts
-
equation(s) of the form option=value where option is one of height, onapprove, oncancel, reference, resizable, title, value, or width; specify options for the ColorDialog element
refID
name or string; reference to the element
The ColorDialog dialog element defines a color dialog.
Note: The preceding ColorDialog Maplet application is displayed by using 16-bit color. The actual display for the ColorDialog element depends on color display settings.
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 ColorDialog 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
reference option
string or symbol
title option
A ColorDialog element can contain Action or command elements to specify the onapprove and oncancel options.
A ColorDialog element can be contained in a Maplet element.
The following table describes the control and use of the ColorDialog 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
height
x
onapprove
oncancel
reference
resizable
title
value
width
The opts argument can contain one or more of the following equations that set Maplet application options.
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 OK button is clicked. 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 Cancel button is clicked. By default, the action shuts down the dialog.
reference = name or string
A reference for the ColorDialog element.
If the reference is specified by both an index, for example, ColorDialog[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 caption that appears in the title bar of the color dialog. The default title is Select Color.
value = color specification
The initially selected color. 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.
width = posint
The window width in pixels.
A Maplet application that has one color dialog which returns either the color selected from the list or NULL:
with⁡MapletsElements:
maplet≔Maplet⁡ColorDialogCD1⁡onapprove=Shutdown⁡CD1,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
plot[color]
Download Help Document