mirror of
https://github.com/geekammo/MicroView-Arduino-Library.git
synced 2026-03-03 08:44:05 +01:00
Widget numeric value supression option
The user can add a flag to the style, for all widgets, to supress the display of the numeric value. Added new widget method drawNumValue() to simplify the code, which can also be called by the user, e.g. for a custom numeric value location.
This commit is contained in:
10
MicroView.h
10
MicroView.h
@@ -77,10 +77,13 @@
|
||||
|
||||
#define WIDGETSTYLE0 0
|
||||
#define WIDGETSTYLE1 1
|
||||
// Added for Vertical slider styles
|
||||
#define WIDGETSTYLE2 2
|
||||
//Added for Vertical slider styles
|
||||
#define WIDGETSTYLE3 3
|
||||
|
||||
// Flag to be added to widget style to indicate no numeric value display
|
||||
#define WIDGETNOVALUE 0x80
|
||||
|
||||
#define SETCONTRAST 0x81
|
||||
#define DISPLAYALLONRESUME 0xA4
|
||||
#define DISPLAYALLON 0xA5
|
||||
@@ -237,8 +240,8 @@ public:
|
||||
int16_t getMinValue();
|
||||
int16_t getMaxValue();
|
||||
int16_t getValue();
|
||||
void setMinValue(int16_t min);
|
||||
void setMaxValue(int16_t max);
|
||||
void setMinValue(int16_t max);
|
||||
void setValue(int16_t val);
|
||||
uint8_t getMaxValLen();
|
||||
/** \brief Draw widget value overridden by child class. */
|
||||
@@ -246,6 +249,7 @@ public:
|
||||
/** \brief Draw widget face overridden by child class. */
|
||||
virtual void drawFace(){};
|
||||
void reDraw();
|
||||
void drawNumValue(int16_t value);
|
||||
virtual ~MicroViewWidget(){};
|
||||
private:
|
||||
uint8_t x;
|
||||
@@ -263,6 +267,7 @@ public:
|
||||
void drawFace();
|
||||
private:
|
||||
uint8_t totalTicks, style;
|
||||
bool noValDraw;
|
||||
int16_t prevValue;
|
||||
};
|
||||
|
||||
@@ -274,6 +279,7 @@ public:
|
||||
void drawFace();
|
||||
private:
|
||||
uint8_t radius, style;
|
||||
bool noValDraw;
|
||||
int16_t prevValue;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user