Scripting Interface |
The SliderWidget JavaScript class. A vertical or horizontal slider. More...
Signals | |
void | valueChanged (float newSliderValue) |
Signal notifying the user that the slider value was modified by the Transform Tool. More... | |
Signals inherited from WidgetBase | |
void | dragStarted (QScriptValue dragContext) |
signal called on mouse down when picking this widget with the Transform tool More... | |
void | drag (QScriptValue dragContext) |
signal called when this widget is dragged with the Transform tool More... | |
void | dragEnded () |
signal called on mouse up after having manipulated this widget with the Transform tool More... | |
Additional Inherited Members | |
Public Slots inherited from WidgetBase | |
Attribute * | data (int index=0) |
The SliderWidget JavaScript class. A vertical or horizontal slider.
Slider widgets provide to the user a vertical or horizontal slider Camera view control. Its handle can be slided and dragged by using the Transform tool. The slider value goes from a user defined minimum value to a user defined maximum value. The user defined values can be specified at the widget construction. The slider can also be translated by having the user pick and drag its frame.
If no attribute is given at the construction of this object, the object will generate one of the proper type.
The following properties are supported by the widget:
Property | Type | Default Value | Description |
---|---|---|---|
data | String | - | The name of the automatically generated double floating point attribute (if none is provided). The value will range from min to max. |
data | Attribute | - | An attribute of double (floating point) type that can be shared with another widget or node. |
length | float | 0.5 | The length of the slider in fields. |
radius | float | 0.03 | The radius of the slider handle in fields. |
drop_shadow | bool | false | Paint a shadow under the slider. |
horizontal | bool | false | Make the slider appears horizontal. Vertical if false. |
min | float | 0 | Minimum value of the slider. |
max | float | 100 | Maximum value of the slider. |
slider_color | ColorRGBA | white | The colour of the handle of the slider. |
contour_color | ColorRGBA | dark gray | The colour of the circle highlighting the handle of the slider. |
slider_selection_color | ColorRGBA | 125,125,255 | The colour of the handle of the slider when selected. |
frame_color | ColorRGBA | 200,200,200 | The colour of the frame of the slider. |
frame_selection_color | ColorRGBA | 125,125,255 | The colour of the frame of the slider when selected. |
xmin | float | -0.05 | Default translation in the x axis for the bottom left corner of the slider frame. In fields. |
ymin | float | -0.1 | Default translation in the y axis for the bottom left corner of the slider frame. In fields. |
The following components are used for the slider handle.
Slider Components | Type |
---|---|
attribute | DOUBLE |
drag_manipulator | SLIDER |
painter | SLIDER |
picker | MONO |
local_transformation | TRANSLATION_XYZ |
The following components are used for the slider frame.
Slider frame Components | Type |
---|---|
attribute | POSITION_3D |
drag_manipulator | POSITION_3D |
painter | SLIDER_FRAME |
picker | MULTI |
local_transformation | TRANSLATION_XYZ |
Connect to this scriptWidget valueChanged signal to be notified when a modification has been applied to the widget. In the callback function, transfer the widget value into an action (like modifying a peg attribute value).
The previous example demonstrates how to instantiate a new widget and register it in the Controller global object.
This example shows how to apply a new slider value to a peg.
This example shows how to update the slider widget value when the current frame changes.
|
signal |
Signal notifying the user that the slider value was modified by the Transform Tool.
newSliderValue | the new slider value |