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:
Scott Allen
2014-09-17 16:01:35 -04:00
parent 4b7b544fa4
commit e9584301ab
3 changed files with 66 additions and 49 deletions

View File

@@ -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;
};