#include <uslider.hpp>
Inheritance diagram for ubit::USlider:
Public Member Functions | |
USlider (const UArgs &=UArgs::none) | |
creates a new slider. | |
USlider (UFloat &value, const UArgs &=UArgs::none) | |
creates a new slider with a model value. | |
bool | isVertical () const |
bool | isHorizontal () const |
float | getValue () const |
returns the current value (a float between 0 and 100). | |
USlider & | setValue (float val) |
changes the current value (a float between 0 and 100). | |
UFloat & | value () |
return the internal value model. | |
virtual UBox * | createKnob () |
[impl] creates the knob; may be redefined by subclasses. | |
virtual UBox * | createRail () |
[impl] creates the rail; may be redefined by subclasses. | |
Static Public Member Functions | |
static UStyle * | createStyle () |
< important: all subclasses MUST contain this declaration. static function that returns the UStyle of this class (see details!). | |
static USliderStyle * | createSliderStyle () |
Protected Member Functions | |
void | constructs () |
virtual void | gotoPos (UMouseEvent &) |
virtual void | actionCB (UEvent &) |
virtual void | changeCB (UEvent &) |
Protected Attributes | |
uptr< UFloat > | pvalue |
uptr< UBox > | prail |
uptr< UBox > | pknob |
uptr< UPos > | pknob_pos |
uptr< UPosChooser > | pknob_chooser |
Friends | |
USlider & | uslider (const UArgs &a=UArgs::none) |
shortcut that creates a new slider (that is horizontal by default). | |
USlider & | uslider (UFloat &value, const UArgs &a=UArgs::none) |
shortcut that creates a new slider (that is horizontal by default) with a model value. | |
USlider & | uhslider (const UArgs &a=UArgs::none) |
shortcut that creates a new horizontal slider | |
USlider & | uvslider (const UArgs &a=UArgs::none) |
shortcut that creates a new vertical slider |
the value is a percentage in the range [0., 100.]
Geometry:
Callbacks
ubit::USlider::USlider | ( | const UArgs & | = UArgs::none |
) |
creates a new slider.
Default orientation is horizontal. new USlider(UOrient::vertical) creates a vertical slider. The slider's value is in the range [0., 100.]
creates a new slider with a model value.
the slider is synchronized with this value. Several widgets (eg. sliders) that share the same value are synchronized. Default orientation is horizontal. new USlider(value, UOrient::vertical) creates a vertical slider. The slider's value is in the range [0., 100.]
static UStyle* ubit::USlider::createStyle | ( | ) | [static] |
< important: all subclasses MUST contain this declaration. static function that returns the UStyle of this class (see details!).
this macro defines the UClass that corresponds to this class and:
Reimplemented from ubit::UBox.
USlider& ubit::USlider::setValue | ( | float | val | ) |
changes the current value (a float between 0 and 100).
UOn::change and UOn::action callbacks are fired when the value is changed (see class USlider).
UFloat& ubit::USlider::value | ( | ) |
return the internal value model.
UOn::change and UOn::action callbacks are fired when the value is changed (see class USlider). this object can be shared but can't be deleted.