|
FabGL2 2.0.0
Graphics, audio, GUI and retro-computing library for the ESP32 (ESP-IDF)
|
A linear fader, like the level controls of a mixing console. More...
#include <fabui.h>

Public Member Functions | |
| uiFader (uiWindow *parent, const Point &pos, const Size &size, bool visible=true, uint32_t styleClassID=0) | |
| Creates an instance of the object. | |
| uiAnchors & | anchors () |
| Allows to switch on or off anchors. | |
| uiApp * | app () |
| Determines the app that owns this object. | |
| void | bringAfter (uiWindow *insertionPoint) |
| Brings this window after another one. | |
| void | bringOnTop () |
| Brings this window on top. | |
| Point | clientPos () |
| Determines position of the client area. | |
| virtual Rect | clientRect (uiOrigin origin) |
| Determines the client area bounding box. | |
| Size | clientSize () |
| Determines the client area size. | |
| void | exitModal (int modalResult) |
| Exits from a modal window. | |
| uiFaderProps & | faderProps () |
| Sets or gets fader properties. | |
| uiFaderStyle & | faderStyle () |
| Sets or gets fader style. | |
| uiWindow * | firstChild () |
| Gets first child. | |
| int | focusIndex () |
| Determines the focus index (aka tab-index). | |
| bool | hasChildren () |
| Determines whether this window has children. | |
| bool | hasFocus () |
| Determines whether this window or control has focus. | |
| bool | isActiveWindow () |
| Determines whether this window is the active one. | |
| bool | isMouseOver () |
| Determines whether the mouse is over this window. | |
| uiWindow * | lastChild () |
| Gets last child. | |
| int | max () |
| Gets the maximum position. | |
| int | min () |
| Gets the minimum position. | |
| uiWindow * | next () |
| Gets next sibling. | |
| uiObjectType & | objectType () |
| Determines the object type. | |
| uiWindow * | parent () |
| Determines the parent window. | |
| RGB888 | parentBackgroundColor () |
| Determines the background color behind this window. | |
| uiWindow * | parentFrame () |
| Determines the parent frame. | |
| Point | pos () |
| Determines the window position relative to parent window. | |
| int | position () |
| Determines the fader position. | |
| uiWindow * | prev () |
| Gets previous sibling. | |
| Rect | rect (uiOrigin origin) |
| Determines the window bounding box. | |
| void | repaint () |
| Repaints this window. | |
| void | repaint (Rect const &rect) |
| Repaints a rectangle of this window. | |
| void | setFocusIndex (int value) |
| Sets the focus index (aka tab-index). | |
| void | setParentProcessKbdEvents (bool value) |
| Enables a child window to send keyboard events to its parent. | |
| void | setPosition (int value) |
| Sets the fader position. onChange is called when the position changes. | |
| void | setStyleClassID (uint16_t value) |
| Sets style class for this UI element. | |
| void | setup (int min, int max, int defaultPosition) |
| Sets the range and the default position, moves the fader to the default position and calls onChange. | |
| Size | size () |
| Determines the window size. | |
| uiWindowState | state () |
| Determines the window state. | |
| uint16_t | styleClassID () |
| Determines current style class for this UI element. | |
| Rect | transformRect (Rect const &rect, uiWindow *baseWindow) |
| Transforms rectangle origins from current window to another one. | |
| uiWindowProps & | windowProps () |
| Sets or gets window properties. | |
| uiWindowStyle & | windowStyle () |
| Sets or gets window style. | |
Public Attributes | |
| Delegate | onChange |
| Fader changed event delegate. | |
A linear fader, like the level controls of a mixing console.
The cap is moved dragging it with the mouse (clicking the slot moves the cap there), with the mouse wheel or with the keyboard (arrows, PAGEUP, PAGEDOWN, HOME, END). Double clicking restores the default position (see setup()).
Example:
auto fader = new uiFader(frame, Point(10, 30), Size(24, 100));
fader->setup(0, 100, 80);
fader->onChange = [=]() { setLevel(fader->position()); };