1
) function: init 2
) function: Resize 3
) function: buildSVG 4
) function: textToSVG 5
) function: setBkColor 6
) function: setMin 7
) function: setMax 8
) function: adjustMax 9
) function: adjustMin 10
) function: initMinmax 11
) function: setValue 12
) function: adjustValue 13
) function: setPosition 14
) function: findPosition 15
) function: mousedown 16
) function: mouseup 17
) function: mousemove
Object : Slider
Object Description: General slider, must be used in Frame
Example: var redslider = new Slider(
14, 13, 239,18, 0,ColorBar_frame,
changeRedColor
);
redslider.addToParent (my_frame);
redslider.setValue(128);
redslider.setMinmax(0, 255);
redslider.setBkColor("rgb(255, 0, 0)");
Inherits from: CGUI
| Constructor: Slider
Parameter : x - x coordinate of this Slider relative to parent
y - y coordinate of this Slider relateive to parent
width - width of this Slider
height - height of this Slider
direction - rotation of slider
parfram - parent frame or parent
event - event to be called when slider changes position
bodyText - user defined svg body of slider
thumbText - user defined svg thumb
Method: init
Description: sets base class and build svg
Parameter : x - x coordinate of this Slider relative to parent
y - y coordinate of this Slider relateive to parent
width - width of this Slider
height - height of this Slider
direction - rotation of slider
parfram - parent frame or parent
event - event to be called when slider changes position
bodyText - user defined svg body of slider
thumbText - user defined svg thumb
Note: Could actually be done in constructor
Method: Resize
Description: Resizes slider by rebuilding svg
Parameter : cx - new slide width
cy - new slide height
Method: buildSVG
Description: build slider's svg component
Method: textToSVG
Description: replaces variables in svg text
this.width = 8;
replaces {$width+8} with 8+8 and does and eval
an puts 16 in the text place where {$width+8}
Parameter s: text - text to be parsed
Returns: svg objects with all variables replaced
Note: Cannot handle negative numbers, i.e. {$width-8}
Method: setBkColor
Description: sets background color of slide
must have {$bgid} in bodyText
Parameter s: Color - color for background, any valid svg color format
Method: setMin
Description: Sets the minimal value for the slider
Parameter s: min - value to be set
Method: setMax
Description: Sets the maximum value for the slider
Parameter s: max - value to be set
Method: adjustMax
Description: Sets the range for the slider
Parameter s: min - minimum value to be set
max - maximum value to be set
Note: To reverse the sliders min and max then have max smaller than min
Method: adjustMin
Description: Sets the range for the slider
Parameter s: min - minimum value to be set
max - maximum value to be set
Note: To reverse the sliders min and max then have max smaller than min
Method: initMinmax
Description: Initialize the range for the slider
Parameter s: min - minimum value to be set
max - maximum value to be set
Note: To reverse the sliders min and max then have max smaller than min
Use initMinMax to prevent the callback function associated
with the slider from being called.
Method: setValue
Description: Sets the position and current value of the slider
Parameter s: value - actual user value
call_callback - boolean to call Slider event
Method: adjustValue
Description: Sets the range for the slider
Parameter s: min - minimum value to be set
max - maximum value to be set
Note: To reverse the sliders min and max then have max smaller than min
Method: setPosition
Description: Sets the position of the slider thumb
Parameter s: value - actual user value
call_callback - boolean to call Slider event
e - mouse event
Method: findPosition
Description: Finds the position of mouse event relative to Slider
Parameter s: e - mouse event
Method: mousedown
Description: called by mousedown event, initializes slider to be moved
and sets position based on mouse position
Parameter s: e - mouse event
Method: mouseup
Description: called by mouseup event
Parameter s: e - mouse event
Method: mousemove
Description: called by mousemove event, handles sliding of Slider
Parameter s: e - mouse event
|
|