6#ifndef NUMERICCONTROL_H_
7#define NUMERICCONTROL_H_
63 NumericControl(T* valuePointer,
const char* baseUnit, T minValue, T maxValue,
int numFractionalDigits,
void* controlContext = NULL,
void(*onValueChanged)(
void* controlContext) = NULL,
VirtualKeys* virtualKeys = NULL, uint16_t locX = 0, uint16_t locY = 0, uint8_t maxStringBufferLength =
DEFAULT_NUMERIC_INDICATOR_STRING_LENGTH);
68 virtual void Draw(
bool redraw)
override;
enum Keys Keys_t
Available input keys.
Containing a class for a numeric indicator that is only showing a numeric variable value.
#define DEFAULT_NUMERIC_INDICATOR_STRING_LENGTH
Default max string length for a numeric indicator.
Definition NumericIndicator.h:11
TouchTypes
Available touch types.
Definition TouchTypes.h:13
Containing a class for a virtual keyboard.
bool KeyMilli()
Milli key is used to change the prefix to milli.
Definition NumericControl.cpp:178
T _minValue
Minimum value that can be handled by this numeric control.
Definition NumericControl.h:20
bool CursorLeft()
Left key is used to move the cursor position left.
Definition NumericControl.cpp:268
VirtualKeys * _virtualKeys
Pointer to a VirtualKeys UIElement.
Definition NumericControl.h:44
bool ValueDown()
Down key is used to decrement the digit at the current cursor position.
Definition NumericControl.cpp:254
NumericControl(T *valuePointer, const char *baseUnit, T minValue, T maxValue, int numFractionalDigits, void *controlContext=NULL, void(*onValueChanged)(void *controlContext)=NULL, VirtualKeys *virtualKeys=NULL, uint16_t locX=0, uint16_t locY=0, uint8_t maxStringBufferLength=DEFAULT_NUMERIC_INDICATOR_STRING_LENGTH)
Constructor of the NumericControl.
Definition NumericControl.cpp:11
virtual bool KeyInput(Keys_t key) override
Definition NumericControl.cpp:97
bool ValueUp()
Up key is used to increment the digit at the current cursor position.
Definition NumericControl.cpp:240
virtual void Draw(bool redraw) override
Method used for drawing of the NumericControl.
Definition NumericControl.cpp:23
virtual void RecalculateDimensions() override
Recalculate the Height and Width of the UIElement.
Definition NumericControl.cpp:302
bool KeyNumeric(Keys_t key)
Numeric keys (KEY0 .
Definition NumericControl.cpp:219
bool _lastDrawnEditMode
The EditMode that was last drawn.
Definition NumericControl.h:22
bool KeyMinus()
Minus key is used to toggle the sign of the controlled value.
Definition NumericControl.cpp:206
int8_t _lastDrawnCurrentDigitPosition
The CurrentDigitPosition that was last drawn.
Definition NumericControl.h:23
uint8_t extractDigit(T number, int8_t position)
Extract the digit at the requested position from the number.
Definition NumericControl.cpp:88
void(* _onValueChanged)(void *controlContext)
Function pointer for _onValueChanged event.
Definition NumericControl.h:42
T coerceValue(T value)
Limit the value to be between _minValue and _maxValue.
Definition NumericControl.cpp:80
bool KeyKilo()
Kilo key is used to change the prefix to kilo.
Definition NumericControl.cpp:164
void ToggleEditMode()
Toggle the control between display and edit mode.
Definition NumericControl.cpp:296
void * _controlContext
Context pointer that is returned with the _onValueChanged function pointer.
Definition NumericControl.h:41
bool CursorRight()
Right key is used to move the cursor position right.
Definition NumericControl.cpp:282
bool KeyX1()
X1 key is used to change the prefix to none.
Definition NumericControl.cpp:192
virtual bool TouchInput(uint16_t x, uint16_t y, TouchTypes touchType) override
Process a touch input at the given point (x, y)
Definition NumericControl.cpp:137
int8_t CurrentDigitPosition
Position of the currently controlled digit.
Definition NumericControl.h:47
NumericIndicator(T *valuePointer, const char *baseUnit, T maxValue, unsigned char numFractionalDigits, uint16_t locX=0, uint16_t locY=0, uint8_t maxStringBufferLength=DEFAULT_NUMERIC_INDICATOR_STRING_LENGTH)
Constructor of the NumericIndicator.
Definition NumericIndicator.cpp:69
Class for a control that can be used to emulate key presses via touch inputs.
Definition VirtualKeys.h:18