18ProgressBar<T>::ProgressBar(T* valuePointer, T minValue, T maxValue,
ProgressBarOrigin_t origin, T tickIncrement, uint16_t progressbarWidth, uint16_t progressbarHeight, uint16_t locX, uint16_t locY):
UIElement(locX, locY,
UI_INDICATOR)
Containing a class for a progress bar indicator that is showing a horizontal progress bar.
#define PROGRESSBAR_LONG_TICK_LENGTH
Length of the tick lines used at all values dividable by 10.
Definition ProgressBar.h:21
#define PROGRESSBAR_SHORT_TICK_LENGTH
Length of the tick lines used at all values dividable by 1.
Definition ProgressBar.h:23
@ 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.
#define PROGRESSBAR_MIDDLE_TICK_LENGTH
Length of the tick lines used at all values dividable by 5.
Definition ProgressBar.h:22
Containing a class that is used to handle the drawing and key handling of all UI_Elements.
UI_Manager UiManager
Access object for the singleton instance of the UI_Manager.
Definition UI_Manager.cpp:7
@ UI_INDICATOR
Indicator elements are only used to show information to the user.
Definition UIElementType.h:15
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
bool _lastDrawnVisible
The Visible value that was last drawn.
Definition UIElement.h:26
uint16_t Height
Drawing height of the UIElement.
Definition UIElement.h:33
uint16_t LocY
Y Location of the upper left corner of the UIElement.
Definition UIElement.h:31
bool Visible
The UIElement is only drawn if the visibility is set to true.
Definition UIElement.h:34
uint16_t Width
Drawing width of the UIElement.
Definition UIElement.h:32
UIElement(UIElementType type)
Constructor of the UIElement.
Definition UIElement.h:43
uint16_t LocX
X Location of the upper left corner of the UIElement.
Definition UIElement.h:30