Slider

General

images/download/attachments/6045206/image2014-11-25_15_3_0.png

Component Palette Icon:

images/download/attachments/6045206/SliderComponentPallette.PNG

Description

The slider component lets the user drag an indicator along a scale to choose a value in a range. The slider can be configured to orient horizontally or vertically.

Properties

Name

Description

Property Type

Scripting

Category

Antialias

Draw with antialias on? Makes text smoother

boolean

.antialias

Appearance

Background Color

The background color of the component.

Color

.background

Appearance

Border

The border surrounding this component. NOTE that the border is unaffected by rotation.

Border

.border

Common

Cursor

The mouse cursor to use when hovering over this component.

int

.cursorCode

Common

Data Quality

The data quality code for any tag bindings on this component.

int

.dataQuality

Data

Defer Updates

Only publish updates to value when not actively being changed.

boolean

.deferred

Behavior

Enabled

If disabled, a component cannot be used.

boolean

.componentEnabled

Common

Font

Font of text of this component

Font

.font

Appearance

Foreground Color

The foreground color of the component.

Color

.foreground

Appearance

Horizontal Slider

If true, slider is horizontal. Otherwise, it's vertical

boolean

.horizontal

Appearance

Inverted?

Specify true to reverse the value range shown for the slider and false to put the value range in the normal order.

boolean

.inverted

Behavior

Major Tick Spacing

The distance, measured in values, between each major tick mark

int

.majorTickSpacing

Appearance

Maximum Value

The value when the slider is all the way right or up

int

.maximum

Data

Minimum Value

The value when the slider is all the way left or down

int

.minimum

Data

Minor Tick Spacing

The distance, measured in values, between each minor tick mark

int

.minorTickSpacing

Appearance

Mouseover Text

The text that is displayed in the tooltip which pops up on mouseover of this component.

String

.toolTipText

Common

Name

The name of this component.

String

.name

Common

Paint Labels?

If true, value labels will be shown.

boolean

.paintLabels

Appearance

Paint Ticks?

If true, value tick marks will be shown.

boolean

.paintTicks

Appearance

Paint Track?

If true, the track of the slider will be shown.

boolean

.paintTrack

Appearance

Snap To Ticks?

Only allows selection of values at the tick marks

boolean

.snapToTicks

Behavior

Styles

Contains the component's styles

Dataset

.styles

Appearance

Value

The current value of the slider.

int

.value

Data

Visible

If disabled, the component will be hidden.

boolean

.visible

Common

Scripting
Scripting Functions

This component does not have scripting functions associated with it.

Extension Functions

This component does not have extension functions associated with it.

Event Handlers

focus

focusGained

This event occurs when a component that can receive input, such as a text box, receives the input focus. This usually occurs when a user clicks on the component or tabs over to it.

.source

The component that fired this event.

.oppositeComponent

The other component involved in this focus change. That is, the component that lost focus in order for this one to gain it, or vise versa.

focusLost

This event occurs when a component that had the input focus lost it to another component.

.source

The component that fired this event

.oppositeComponent

The other component involved in this focus change. That is, the component that lost focus in order for this one to gain it, or vise versa.

key

keyPressed

An integer that indicates whether the state was changed to "Selected" (on) or "Deselected" (off). Compare this to the event object's constants to determine what the new state is.

.source

The component that fired this event.

.keyCode

The key code for this event. Used with the keyPressed and keyReleased events. See below for the key code constants.

.keyChar

The character that was typed. Used with the keyTyped event.

.keyLocation

Returns the location of the key that originated this key event. Some keys occur more than once on a keyboard, e.g. the left and right shift keys. Additionally, some keys occur on the numeric keypad. This provides a way of distinguishing such keys. See the KEY_LOCATION constants in the documentation. The keyTyped event always has a location of KEY_LOCATION_UNKNOWN.

.altDown

True (1) if the Alt key was held down during this event, false (0) otherwise.

.controlDown

True (1) if the Control key was held down during this event, false (0) otherwise.

.shiftDown

True (1) if the Shift key was held down during this event, false (0) otherwise.

keyReleased

Fires when a key is released and the source component has the input focus. Works for all characters, including non-printable ones, such as SHIFT and F3.

.source

The component that fired this event.

.keyCode

The key code for this event. Used with the keyPressed and keyReleased events. See below for the key code constants.

.keyChar

The character that was typed. Used with the keyTyped event.

.keyLocation

Returns the location of the key that originated this key event. Some keys occur more than once on a keyboard, e.g. the left and right shift keys. Additionally, some keys occur on the numeric keypad. This provides a way of distinguishing such keys. See the KEY_LOCATION constants in the documentation. The keyTyped event always has a location of KEY_LOCATION_UNKNOWN.

.altDown

True (1) if the Alt key was held down during this event, false (0) otherwise.

.controlDown

True (1) if the Control key was held down during this event, false (0) otherwise.

.shiftDown

True (1) if the Shift key was held down during this event, false (0) otherwise.

keyTyped

Fires when a key is pressed and then released when source component has the input focus. Only works for characters that can be printed on the screen.

.source

The component that fired this event.

.keyCode

The key code for this event. Used with the keyPressed and keyReleased events. See below for the key code constants.

.keyChar

The character that was typed. Used with the keyTyped event.

.keyLocation

Returns the location of the key that originated this key event. Some keys occur more than once on a keyboard, e.g. the left and right shift keys. Additionally, some keys occur on the numeric keypad. This provides a way of distinguishing such keys. See the KEY_LOCATION constants in the documentation. The keyTyped event always has a location of KEY_LOCATION_UNKNOWN.

.altDown

True (1) if the Alt key was held down during this event, false (0) otherwise.

.controlDown

True (1) if the Control key was held down during this event, false (0) otherwise.

.shiftDown

True (1) if the Shift key was held down during this event, false (0) otherwise.

mouse

mouseClicked

This event signifies a mouse click on the source component. A mouse click the combination of a mouse press and a mouse release, both of which must have occurred over the source component. Note that this event fires after the pressed and released events have fired.

.source

The component that fired this event.

.button

The code for the button that caused this event to fire.

.clickCount

The number of mouse clicks associated with this event.

.x

The x-coordinate (with respect to the source component) of this mouse event.

.y

The y-coordinate (with respect to the source component) of this mouse event.

.popupTrigger

Returns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.

.altDown

True (1) if the Alt key was held down during this event, false (0) otherwise.

.controlDown

True (1) if the Control key was held down during this event, false (0) otherwise.

.shiftDown

True (1) if the Shift key was held down during this event, false (0) otherwise.

mouseEntered

This event fires when the mouse enters the space over the source component.

.source

The component that fired this event.

.button

The code for the button that caused this event to fire.

.clickCount

The number of mouse clicks associated with this event.

.x

The x-coordinate (with respect to the source component) of this mouse event.

.y

The y-coordinate (with respect to the source component) of this mouse event.

.popupTrigger

Returns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.

.altDown

True (1) if the Alt key was held down during this event, false (0) otherwise.

.controlDown

True (1) if the Control key was held down during this event, false (0) otherwise.

.shiftDown

True (1) if the Shift key was held down during this event, false (0) otherwise.

mouseExited

This event fires when the mouse leaves the space over the source component.

.source

The component that fired this event.

.button

The code for the button that caused this event to fire.

.clickCount

The number of mouse clicks associated with this event.

.x

The x-coordinate (with respect to the source component) of this mouse event.

.y

The y-coordinate (with respect to the source component) of this mouse event.

.popupTrigger

Returns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.

.altDown

True (1) if the Alt key was held down during this event, false (0) otherwise.

.controlDown

True (1) if the Control key was held down during this event, false (0) otherwise.

.shiftDown

True (1) if the Shift key was held down during this event, false (0) otherwise.

mousePressed

This event fires when a mouse button is pressed down on the source component.

.source

The component that fired this event.

.button

The code for the button that caused this event to fire.

.clickCount

The number of mouse clicks associated with this event.

.x

The x-coordinate (with respect to the source component) of this mouse event.

.y

The y-coordinate (with respect to the source component) of this mouse event.

.popupTrigger

Returns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.

.altDown

True (1) if the Alt key was held down during this event, false (0) otherwise.

.controlDown

True (1) if the Control key was held down during this event, false (0) otherwise.

.shiftDown

True (1) if the Shift key was held down during this event, false (0) otherwise.

mouseReleased

This event fires when a mouse button is released, if that mouse button's press happened over this component.

.source

The component that fired this event.

.button

The code for the button that caused this event to fire.

.clickCount

The number of mouse clicks associated with this event.

.x

The x-coordinate (with respect to the source component) of this mouse event.

.y

The y-coordinate (with respect to the source component) of this mouse event.

.popupTrigger

Returns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.

.altDown

True (1) if the Alt key was held down during this event, false (0) otherwise.

.controlDown

True (1) if the Control key was held down during this event, false (0) otherwise.

.shiftDown

True (1) if the Shift key was held down during this event, false (0) otherwise.

mouseMotion

mouseDragged

Fires when the mouse moves over a component after a button has been pushed.

.source

The component that fired this event.

.button

The code for the button that caused this event to fire.

.clickCount

The number of mouse clicks associated with this event.

.x

The x-coordinate (with respect to the source component) of this mouse event.

.y

The y-coordinate (with respect to the source component) of this mouse event.

.popupTrigger

Returns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.

.altDown

True (1) if the Alt key was held down during this event, false (0) otherwise.

.controlDown

True (1) if the Control key was held down during this event, false (0) otherwise.

.shiftDown

True (1) if the Shift key was held down during this event, false (0) otherwise.

mouseMoved

Fires when the mouse moves over a component, but no buttons are pushed.

.source

The component that fired this event.

.button

The code for the button that caused this event to fire.

.clickCount

The number of mouse clicks associated with this event.

.x

The x-coordinate (with respect to the source component) of this mouse event.

.y

The y-coordinate (with respect to the source component) of this mouse event.

.popupTrigger

Returns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.

.altDown

True (1) if the Alt key was held down during this event, false (0) otherwise.

.controlDown

True (1) if the Control key was held down during this event, false (0) otherwise.

.shiftDown

True (1) if the Shift key was held down during this event, false (0) otherwise.

propertyChange

propertyChange

Fires whenever a bindable property of the source component changes. This works for standard and custom (dynamic) properties.

.source

The component that fired this event.

.newValue

The new value that this property changed to.

.oldValue

The value that this property was before it changed.

.propertyName

The name of the property that changed. NOTE: remember to always filter out these events for the property that you are looking for! Components often have many properties that change.

Examples
Code Snippet
#The following code will return the value of the slider's previous value into a variable.
#This code is fired on the property change scripting for this component.
 
oldValue = event.source.oldValue
Vertical Slider with Border and Blue Text

images/download/attachments/6045206/image2014-11-25_15_4_10.png
Vertical Slider with Border and Blue Text

Property Name

Value

Maximum Value

250

Minor Tick Spacing

25

Foreground Color

0,0,255

Major Tick Spacing

50

Horizontal Slider without Tickmarks

images/download/attachments/6045206/SliderGallery2.PNG

Property Name

Value

Paint Ticks?

False

Minor Tick Spacing

0

Major Tick Spacing

100