Slider - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Maplets[Elements]

  

Slider

  

define a slider

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

Slider(opts)

Slider[refID](opts)

Parameters

opts

-

equation(s) of the form option=value where option is one of background, enabled, filled, foreground, lower, majorticks, minorticks, onchange, orientation, reference, showlabels, showticks, snapticks, tooltip, upper, value, or visible; specify options for the Slider element

refID

-

name or string; reference to the element

Description

• 

The Slider window body element defines a slider in a Maplet application, which allows the user to select an integer between two points.

  

 

• 

The Slider 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

 

 

integer

value option

range of integers

lower and upper options

refID

reference option

vertical or horizontal

orientation option

 

 

• 

A Slider element can contain Action or command elements to specify the onchange option.

• 

A Slider element can be contained in a Maplet or BoxLayout element, or Maplet element in a nested list representing a box layout.

• 

The following table describes the control and use of the Slider 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

enabled

x

 

x

x

filled

x

 

x

x

foreground

x

 

x

x

lower

x

 

x

x

majorticks

x

 

x

x

minorticks

x

 

x

x

onchange

x

 

 

 

orientation

x

 

x

x

reference

x

 

 

 

showlabels

x

 

x

x

showticks

x

 

x

x

snapticks

x

 

x

x

tooltip

x

 

x

x

upper

x

 

x

x

value

x

 

x

x

visible

x

 

x

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 slider.  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.

  

 

  

enabled = true or false

  

Whether a slider can be dragged.  If enabled is set to false, the slider face is dimmed, and any action associated with it cannot be initiated.  By default, the value is true.

  

 

  

filled = true or false

  

Whether the slider track is shown.  By default, the value is false.

  

 

  

foreground = color

  

The face color of the slider.

  

 

  

lower = integer

  

The lowest value on the slider.  By default, the lowest value is 0.

  

 

  

majorticks = posint

  

How often the numbered tick marks occur, that is, the spacing between the numbered tick marks. By default, no major ticks appear.

  

 

  

minorticks = posint

  

How often the smaller unnumbered tick marks occur, that is, the spacing between the unnumbered tick marks. By default, no minor ticks appear.

  

 

  

onchange = Action or command element, or reference to an Action element (name or string)

  

The action that occurs each time the slider value changes while the slider is being moved.

  

 

  

orientation = vertical or horizontal

  

The slider orientation. By default, the orientation is horizontal.

  

 

  

reference = name or string

  

A reference for the Slider element.

  

If the reference is specified by both an index, for example, Slider[refID], and a reference in the calling sequence, the index reference takes precedence.

  

 

  

showlabels = true or false

  

Whether majorticks labels appear on the slider.  By default, the value is true.

  

 

  

showticks = true or false

  

Whether ticks appear on the slider.  By default, the value is true.

  

 

  

snapticks = true or false

  

Whether the slider should snap to the closest tick mark upon release of the mouse. By default, the value is true.

  

 

  

tooltip = string or symbol

  

The text that appears in the tooltip window.

  

 

  

upper = integer

  

The greatest value on the slider. By default, the upper value is 10.

  

 

  

value = integer

  

The slider default value. By default, the slider value is 0.

  

 

  

visible = true or false

  

Whether the slider is visible to the user.  By default, the value is true.

Examples

A slider with a default value of 10 and values ranging from 0 to 100:

withMapletsElements:

mapletMapletSelect a value: ,SliderSL10..100,10,showticks,majorticks=20,minorticks=10,snapticks=false,ButtonOK,ShutdownSL1,ButtonCancel,Shutdown:

MapletsDisplaymaplet

See Also

Maplets/CommandElements

Maplets/WindowBodyElements

Maplets[Display]

Maplets[Elements]

Maplets[Elements][Action]

Maplets[Elements][Button]

Maplets[Elements][Maplet]

Maplets[Elements][SetOption]

Maplets[Elements][Shutdown]

Maplets[Tools][Get]

Maplets[Tools][Set]

Overview of Maplet Applications

plot[color]