Dial Component - Maple Help

DocumentTools[Components]

 Dial
 generate XML for a Dial Component

 Calling Sequence Dial(rng, opts)

Parameters

 rng - (optional) range(realcons); range of position values, defaults to 0..100 opts - (optional) ; one or more keyword options as described below

Options

 • action : string; A string which parses to one or more valid statements in 1-D Maple notation. These statements form the Value Changed Action Component Code that executes when the Dial position is manually adjusted.
 • anglerange : nonnegative; The range of angles for the position of the dial's indicator. The angle range can be between 0 and 360 degrees.
 • continuous : truefalse; Indicates whether dragging of the sliding component will result in continuous updates using the action code.
 • enabled : truefalse; Indicates whether the component is enabled. The default is true. If enabled is false then the inserted sliding component is grayed out and interaction with it cannot be initiated.
 • identity : {name,string}; The reference name of the component.
 • image : {string,Matrix,Array,identical(none)}; The Image displayed on the dial, specified as either the name of an external image file or a Matrix or Array as recognized by commands in the ImageTools package.
 • height : posint; The height in pixels of the component.
 • majorticks : numeric; The interval between the major tickmarks on the sliding component. The default is .2 times the upper value of rng minus the lower value of rng.
 • minorticks : numeric; The interval between the minor tickmarks on the sliding component. The default is 1/2 majorticks.
 • position : numeric; The initial position of the sliding component. If not specified the value of the left endpoint of the rng argument is used.
 • showlabels : truefalse; Indicates whether values are shown beside tickmarks. The default is true.
 • showticks : truefalse; Indicates whether tickmarks are shown. The default is true.
 • startangle : nonnegative; The angle, measured clockwise from straight down, representing the lower value. The angle is between 0 and 360 degrees.
 • tooltip : string; The text that appears when the mouse pointer hovers over the component.
 • visible : truefalse; Indicates whether the component is visible. The default is true.
 • width : posint; The width in pixels of the component.

Description

 • The Dial command in the Component Constructors package returns an XML function call which represents a Dial Component.
 • The generated XML can be used with the results of commands in the Layout Constructors package to create an entire Worksheet or Document in XML form. Such a representation of a Worksheet or Document can be inserted into the current document using the InsertContent command.

Examples

 > $\mathrm{with}\left(\mathrm{DocumentTools}\right):$
 > $\mathrm{with}\left(\mathrm{DocumentTools}:-\mathrm{Components}\right):$
 > $\mathrm{with}\left(\mathrm{DocumentTools}:-\mathrm{Layout}\right):$

Executing the Dial command produces a function call.

 > $\mathrm{Dial}\left(\mathrm{identity}="Dial0",\mathrm{image}=\mathrm{none}\right)$
 ${\mathrm{_XML_EC-Dial}}{}\left({"id"}{=}{"Dial0"}{,}{"lower-bound"}{=}{"0"}{,}{"upper-bound"}{=}{"100"}{,}{"control-position"}{=}{"0"}{,}{"major-tick-spacing"}{=}{"20"}{,}{"minor-ticks"}{=}{"10"}{,}{"show-labels"}{=}{"true"}{,}{"show-ticks"}{=}{"true"}{,}{"continuous-update"}{=}{"true"}{,}{"inputenabled"}{=}{"true"}{,}{"visible"}{=}{"true"}\right)$ (1)

By using commands from the DocumentTools:-Layout package a nested function call can be produced which represents a worksheet.

 > $S≔\mathrm{Dial}\left(\mathrm{identity}="Dial0"\right):$
 > $\mathrm{xml}≔\mathrm{Worksheet}\left(\mathrm{Group}\left(\mathrm{Input}\left(\mathrm{Textfield}\left(S\right)\right)\right)\right):$

That XML representation of a worksheet can be inserted directly.

 > $\mathrm{InsertContent}\left(\mathrm{xml}\right):$

 > $\mathrm{codestring}≔"\ns := true;\nt := false;"$
 ${\mathrm{codestring}}{≔}{"s := true; t := false;"}$ (2)
 > $S≔\mathrm{Dial}\left(0...9.0,\mathrm{identity}="Dial0",\mathrm{tooltip}="My example Dial",\mathrm{showlabels},\mathrm{position}=4.1,\mathrm{width}=90,\mathrm{height}=90,\mathrm{action}=\mathrm{codestring}\right):$
 > $\mathrm{xml}≔\mathrm{Worksheet}\left(\mathrm{Group}\left(\mathrm{Input}\left(\mathrm{Textfield}\left(S\right)\right)\right)\right):$

The previous example's call to the InsertContent command inserted a component with identity "Dial0", which still exists in this worksheet. Inserting additional content whose input contains another component with that same identity "Dial0" incurs a substitution of the input identity in order to avoid a conflict with the identity of the existing component.

The return value of the following call to InsertContent is a table which can be used to reference the substituted identity of the inserted component.

 > $\mathrm{lookup}≔\mathrm{InsertContent}\left(\mathrm{xml},\mathrm{output}=\mathrm{table}\right)$
 ${\mathrm{lookup}}{≔}{table}{}\left(\left[{"Dial0"}{=}{"Dial1"}\right]\right)$ (3)

 > $\mathrm{lookup}\left["Dial0"\right]$
 ${"Dial1"}$ (4)
 > $\mathrm{GetProperty}\left(\mathrm{lookup}\left["Dial0"\right],\mathrm{value}\right)$
 ${4.1}$ (5)
 > 

Compatibility

 • The DocumentTools:-Components:-Dial command was introduced in Maple 2015.