Handle full signed 16 bit ranges for widgets.

Widgets will now work properly with minimum and maximum values
from −32,768 to 32,767.
Also, place the numeric value field close to sliders
and horizontally centred in gauges.
This commit is contained in:
Scott Allen
2014-08-10 18:45:20 -04:00
parent 0eeb47d20a
commit 0b56edc962
2 changed files with 60 additions and 24 deletions

View File

@@ -239,6 +239,7 @@ public:
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. */
virtual void draw(){};
/** \brief Draw widget face overridden by child class. */
@@ -340,4 +341,8 @@ void MVSPIClass::detachInterrupt() {
}
extern MicroView uView;
/** \brief Get the number of print characters for a 16 bit signed value. */
uint8_t getInt16PrintLen(int16_t val);
#endif