Public Member Functions | |
| virtual void | paint () override |
| Paints this component. | |
| void | setKnobRelativePosition (float relativePosition) |
| Sets the relative position of the knob in this scrollbar. | |
| float | getKnobRelativePosition () |
| Gets the relative position of the knob in this scrollbar. | |
Public Member Functions inherited from dsgc::Component | |
| virtual void | setEnabled (bool enabled) |
| Sets whether this component is enabled. | |
| virtual bool | isEnabled () |
| Checks whether this component is enabled. | |
| virtual void | setFocused (bool focused) |
| virtual bool | isFocused () |
| Checks whether this component has focus. | |
| virtual Color | getBackgroundColor () |
| Gets the background color when enabled but not focused. | |
| virtual Color | getForegroundColor () |
| Gets the foreground color when enabled but not focused. | |
| virtual Color | getBorderColor () |
| Gets the border color when enabled but not focused. | |
| virtual Color | getDisabledBackgroundColor () |
| Gets the background color when disabled. | |
| virtual Color | getDisabledForegroundColor () |
| Gets the foreground color when disabled. | |
| virtual Color | getDisabledBorderColor () |
| Gets the border color when disabled. | |
| virtual Color | getFocusedBackgroundColor () |
| Gets the background color when enabled and focused. | |
| virtual Color | getFocusedForegroundColor () |
| Gets the foreground color when enabled and focused. | |
| virtual Color | getFocusedBorderColor () |
| Gets the border color when enabled and focused. | |
| virtual void | setBackgroundColor (Color color) |
| virtual void | setForegroundColor (Color color) |
| virtual void | setBorderColor (Color color) |
| virtual void | setDisabledBackgroundColor (Color color) |
| virtual void | setDisabledForegroundColor (Color color) |
| virtual void | setDisabledBorderColor (Color color) |
| virtual void | setFocusedBackgroundColor (Color color) |
| virtual void | setFocusedForegroundColor (Color color) |
| virtual void | setFocusedBorderColor (Color color) |
| virtual void | repaint () |
| Repaints this component. | |
Public Member Functions inherited from dsgc::Dimensions | |
| unsigned int | getX () |
| unsigned int | getY () |
| unsigned int | getWidth () |
| unsigned int | getHeight () |
Protected Member Functions | |
| Scrollbar (Adafruit_GFX &graphics, unsigned int x, unsigned int y, unsigned int width, unsigned int height, unsigned int trackLength, double knobRelativeSize) | |
| unsigned int | getKnobLength () |
| unsigned int | getKnobPositionOffset () |
| virtual unsigned int | getKnobX () |
| Gets the x-coordinate of the top-left corner of the knob. | |
| virtual unsigned int | getKnobY () |
| Gets the y-coordinate of the top-left corner of the knob. | |
| virtual unsigned int | getKnobWidth () |
| Gets the width of the knob. | |
| virtual unsigned int | getKnobHeight () |
| Gets the height of the knob. | |
Protected Member Functions inherited from dsgc::Component | |
| Component (Adafruit_GFX &graphics, unsigned int x, unsigned int y, unsigned int width, unsigned int height) | |
| virtual Adafruit_GFX & | getGraphics () |
| virtual Color | getCurrentBackgroundColor () |
| virtual Color | getCurrentForegroundColor () |
| virtual Color | getCurrentBorderColor () |
Protected Member Functions inherited from dsgc::Dimensions | |
| Dimensions (unsigned int x, unsigned int y, unsigned int width, unsigned int height) | |
|
protectedvirtual |
Gets the height of the knob.
This implementation gives the fixed knob width by default. Override this function in subclass to give the knob length.
Reimplemented in dsgc::VerticalScrollbar.
| float dsgc::Scrollbar::getKnobRelativePosition | ( | ) |
Gets the relative position of the knob in this scrollbar.
|
protectedvirtual |
Gets the width of the knob.
This implementation gives the fixed knob width by default. Override this function in subclass to give the knob length.
Reimplemented in dsgc::HorizontalScrollbar.
|
protectedvirtual |
Gets the x-coordinate of the top-left corner of the knob.
This implementation does not account for the position offset. Override this function in subclass to account for the position offset if needed.
Reimplemented in dsgc::HorizontalScrollbar.
|
protectedvirtual |
Gets the y-coordinate of the top-left corner of the knob.
This implementation does not account for the position offset. Override this function in subclass to account for the position offset if needed.
Reimplemented in dsgc::VerticalScrollbar.
|
overridevirtual |
Paints this component.
Override this function to implement the specifics of the actual component. In the overriding function, it is a must to call this parent function.
Reimplemented from dsgc::Component.
| void dsgc::Scrollbar::setKnobRelativePosition | ( | float | relativePosition | ) |
Sets the relative position of the knob in this scrollbar.
| relativePosition | The relative position of the knob [0.0 : 1.0]. 0.0 is at the top, 1.0 is at the bottom. |