Foundation classes for a basic GUI implementing simple widgets and events
Dependents: TouchScreenGUIDemo
Widgets/BitmapWidget.h@7:303850a4b30c, 2016-04-10 (annotated)
- Committer:
- duncanFrance
- Date:
- Sun Apr 10 16:48:44 2016 +0000
- Revision:
- 7:303850a4b30c
- Parent:
- 4:27546fb8b670
- Child:
- 8:a460cabc85ac
Working implementation
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
duncanFrance | 4:27546fb8b670 | 1 | #ifndef SIMPLEGUI_BITMAP_WIDGET_H |
duncanFrance | 4:27546fb8b670 | 2 | #define SIMPLEGUI_BITMAP_WIDGET_H |
duncanFrance | 4:27546fb8b670 | 3 | |
duncanFrance | 4:27546fb8b670 | 4 | #include "Widget.h" |
duncanFrance | 4:27546fb8b670 | 5 | |
duncanFrance | 4:27546fb8b670 | 6 | class BitmapWidget : public Widget { |
duncanFrance | 4:27546fb8b670 | 7 | |
duncanFrance | 4:27546fb8b670 | 8 | public: |
duncanFrance | 4:27546fb8b670 | 9 | |
duncanFrance | 7:303850a4b30c | 10 | BitmapWidget(GraphicsDisplay& display); |
duncanFrance | 4:27546fb8b670 | 11 | |
duncanFrance | 4:27546fb8b670 | 12 | // Ccncrete methods for this class |
duncanFrance | 4:27546fb8b670 | 13 | void setBitmap(unsigned char* bitmap); |
duncanFrance | 4:27546fb8b670 | 14 | |
duncanFrance | 4:27546fb8b670 | 15 | // Set to draw the bitmap in monochrome |
duncanFrance | 4:27546fb8b670 | 16 | void setMonochrome(bool enabled); |
duncanFrance | 4:27546fb8b670 | 17 | bool isMonochrome(); |
duncanFrance | 4:27546fb8b670 | 18 | |
duncanFrance | 4:27546fb8b670 | 19 | // Implementation to account for whether the event's coordinates intersect this widget |
duncanFrance | 4:27546fb8b670 | 20 | virtual void draw(); |
duncanFrance | 4:27546fb8b670 | 21 | |
duncanFrance | 4:27546fb8b670 | 22 | protected: |
duncanFrance | 4:27546fb8b670 | 23 | unsigned char* _bitmap; |
duncanFrance | 4:27546fb8b670 | 24 | bool _monochrome; |
duncanFrance | 4:27546fb8b670 | 25 | }; |
duncanFrance | 4:27546fb8b670 | 26 | |
duncanFrance | 4:27546fb8b670 | 27 | #endif |