21#define PROGRESSBAR_LONG_TICK_LENGTH 6
22#define PROGRESSBAR_MIDDLE_TICK_LENGTH 4
23#define PROGRESSBAR_SHORT_TICK_LENGTH 2
68 ProgressBar(T* valuePointer, T minValue, T maxValue,
ProgressBarOrigin_t origin, T tickIncrement, uint16_t progressbarWidth = 80, uint16_t progressbarHeight = 10, uint16_t locX = 0, uint16_t locY = 0);
73 virtual void Draw(
bool redraw)
override;
ProgressBarOrigin
Available progress bar origin positions.
Definition ProgressBar.h:15
@ PROGRESSBAR_ORIGIN_ZERO
Origin is at the zero point.
Definition ProgressBar.h:17
@ PROGRESSBAR_ORIGIN_RIGHT
Origin is on the right.
Definition ProgressBar.h:18
@ PROGRESSBAR_ORIGIN_LEFT
Origin is on the left.
Definition ProgressBar.h:16
enum ProgressBarOrigin ProgressBarOrigin_t
Available progress bar origin positions.
Containing the abstract base class for all user interface elements (controls, indicators,...
uint16_t xCoordinateFromValue(T value)
Calculate the X coordinate of the value on the progress bar.
Definition ProgressBar.cpp:10
T _lastValueDraw
This variable is updated from the _valuePointer when the value changed.
Definition ProgressBar.h:34
uint16_t ProgressbarWidth
Drawing width of the ProgressBar (without min and max texts and tick markers)
Definition ProgressBar.h:53
T _tickIncrement
Distance between tick lines drawn above the progress bar.
Definition ProgressBar.h:38
T * _valuePointer
Pointer to the numeric variable that is used to draw this indicator.
Definition ProgressBar.h:33
uint16_t _maxValueTextWidth
Text width of the maximum value text.
Definition ProgressBar.h:42
uint16_t _originXCoord
X coordinate of the origin calculated on layout reconstruction.
Definition ProgressBar.h:39
uint16_t ProgressbarHeight
Drawing height of the ProgressBar (without min and max texts and tick markers)
Definition ProgressBar.h:54
ProgressBar(T *valuePointer, T minValue, T maxValue, ProgressBarOrigin_t origin, T tickIncrement, uint16_t progressbarWidth=80, uint16_t progressbarHeight=10, uint16_t locX=0, uint16_t locY=0)
Constructor of the ProgressBar.
Definition ProgressBar.cpp:18
T _minValue
Minimum value that can be shown by the progress bar.
Definition ProgressBar.h:35
uint16_t _minValueTextWidth
Text width of the minimum value text.
Definition ProgressBar.h:41
virtual void RecalculateDimensions() override
Recalculate the Height and Width of the UIElement.
Definition ProgressBar.cpp:78
virtual void RecalculateLayout() override
Recalculate the UIElement layout (containers update the X- and Y-Location of all their items,...
Definition ProgressBar.cpp:91
virtual void Draw(bool redraw) override
Method used for drawing of the ProgressBar.
Definition ProgressBar.cpp:30
ProgressBarOrigin_t _origin
Origin position of this progress bar.
Definition ProgressBar.h:37
T _maxValue
Maximum value that can be shown by the progress bar.
Definition ProgressBar.h:36
UIElement(UIElementType type)
Constructor of the UIElement.
Definition UIElement.h:43