added reDraw() for MicroViewWidget class

This commit is contained in:
JP
2014-08-04 10:22:47 +10:00
parent 82d55a8201
commit dce58d7069
3 changed files with 1157 additions and 1123 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -226,6 +226,7 @@ private:
class MicroViewWidget {
public:
bool needToDrawPrev;
MicroViewWidget(uint8_t newx, uint8_t newy, int16_t min, int16_t max);
uint8_t getX();
uint8_t getY();
@@ -242,6 +243,8 @@ public:
virtual void draw(){};
/** \brief Draw widget face overridden by child class. */
virtual void drawFace(){};
/** \brief ReDraw widget overridden by child class. */
virtual void reDraw(){};
private:
uint8_t x;
@@ -257,6 +260,7 @@ public:
MicroViewSlider(uint8_t newx, uint8_t newy, int16_t min, int16_t max, uint8_t sty);
void draw();
void drawFace();
void reDraw();
private:
uint8_t totalTicks, style;
bool needFirstDraw;
@@ -269,6 +273,7 @@ public:
MicroViewGauge(uint8_t newx, uint8_t newy, int16_t min, int16_t max, uint8_t sty);
void draw();
void drawFace();
void reDraw();
private:
uint8_t radius, style;
bool needFirstDraw;
@@ -339,6 +344,5 @@ void MVSPIClass::detachInterrupt() {
SPCR &= ~_BV(SPIE);
}
extern MicroView uView;
#endif

View File

@@ -83,6 +83,7 @@ void loop() {
void setup() {
uView.begin();
uView.clear(PAGE);
Serial.begin(115200); // user decide the baud rate
}
void loop() {
@@ -91,6 +92,10 @@ void loop() {
</code></pre>
## History
**v1.17b: 4th August 2014 by JP Liew**
* added reDraw() for MicroViewWidget class
* removed Serial.begin() from uView.begin() so that user can have control
**v1.16b: 3rd August 2014 by czetie**
* added vertical slider widget
@@ -143,7 +148,7 @@ void loop() {
**v1.05b: 6th February 2014 by JP Liew**
* changed MICROVIEW class name to MicroView
* created MICROVIEWWIDGET class
* created MicroViewWidget class
* added routines to draw widget
* added slider widget
* merged MicroViewWidget into MicroView