Slider Plugin

Description

This Slider plugin object is used to create a common Windows slider control. Several properties of the slider can be set using design-time properties and runtime actions. The slider also fires several events.

Properties

Range Minimum

The minimum range of the slider.

Range Maximum

The maximum range of the slider.

Events

On PosChange

Fires when the position of the slider changes.

e_Pos:

(number) The current position of the slider.

On Key

Fires when a key is pressed while the slider has focus.

e_Key:

(number) The ASCII code of the key that was pressed.

e_Modifiers:

(table) A table containing three boolean values that describe which modifier keys were held down while the key was pressed. A modifier key is a key that can be held down while another key is pressed, to "modify" it. There are three true/false values in the table, one for each type of modifier key on the keyboard: shift, ctrl, and alt. You can access these values as e_Modifiers.shift, e_Modifiers.ctrl, and e_Modifiers.alt.

On Focus

Fires when the slider gets input focus.

Actions

table Slider.GetRange (string ObjectName);

Description:

Gets the minimum and maximum values of a slider object.

ObjectName:

(string) The name of the slider object that you want to apply this action to.

Returns:

(table) A table containing the numerical values of the minimum and maximum ranges. The table indexes are "Minimum" and "Maximum". If an error occurs, nil is returned.

Example:

-- Get the range of a slider object and show
-- the result in a message box
Range = Slider.GetRange ("MySlider");
if (Range) then
    RangeString = "Minimum = " .. Range.Minimum .. ", Maximum = " .. Range.Maximum;
    Dialog.Message("Range", RangeString);
end

Slider.SetRange (string ObjectName, number Minimum, number Maximum);

Description:

Sets the minimum and maximum values of a slider object.

ObjectName:

(string) The name of the slider object that you want to apply this action to.

Minimum:

(number) The minimum range of the slider (defaults to 0).

Maximum:

(number) The maximum range of the slider (defaults to 100).

Returns:

Nothing. You can use Application.GetLastError to determine whether this action failed, and why.

Example:

-- Set the slider range from 1 to 10
Slider.SetRange ("MySlider", 1, 10);

number Slider.GetSliderPos (string ObjectName);

Description:

Gets the current position a slider object.

ObjectName:

(string) The name of the slider object that you want to apply this action to.

Returns:

(number) The current position (or "value") of the slider.

Example:

-- Get the current position of a slider
-- and show the result in a message box
Pos = Slider.GetRange ("MySlider");
PosString = "Position = "..Pos;
Dialog.Message("Range",PosString);

Slider.SetSliderPos (string ObjectName, number Position);

Description:

Sets the current position of a slider object.

ObjectName:

(string) The name of the slider object that you want to apply this action to.

Position:

(number) The position to set the slider to. If this number is greater than the Maximum value of the slider, the slider will be set to the maximum value. If this number is less than the minimum value of the slider, the slider will be set to the minimum value.

Returns:

Nothing. You can use Application.GetLastError to determine whether this action failed, and why.

Example:

-- Set the slider position to 80
Slider.SetSliderPos ("MySlider", 80);

Error Codes

1100 - Could not find the specified plugin object or the plugin object is of the wrong type.

Change Log

1.0.1.0

1.0.0.0

Additional Information

Author:

Indigo Rose Corporation
support@indigorose.com

Copyright:

The Slider plugin is copyright © 2003-2006 Indigo Rose Software Design Corporation.

Website:

http://www.indigorose.com


Copyright © 2006 Indigo Rose Software Design Corporation.
All Rights Reserved.