Foundation classes for a basic GUI implementing simple widgets and events
Dependents: TouchScreenGUIDemo
Widgets/BitmapWidget.h@12:63db16fea709, 2016-05-08 (annotated)
- Committer:
- duncanFrance
- Date:
- Sun May 08 14:42:08 2016 +0000
- Revision:
- 12:63db16fea709
- Parent:
- 9:616a9686d5db
- Child:
- 14:e6515b19f5a0
Update to handle dirty pixels and geometric change/damage
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 | 12:63db16fea709 | 10 | BitmapWidget(GraphicsContext *context); |
duncanFrance | 12:63db16fea709 | 11 | BitmapWidget(GraphicsContext *context, bool monochrome); |
duncanFrance | 4:27546fb8b670 | 12 | |
duncanFrance | 4:27546fb8b670 | 13 | // Ccncrete methods for this class |
duncanFrance | 12:63db16fea709 | 14 | void setBitmap(unsigned char* bitmap, int width, int height); |
duncanFrance | 4:27546fb8b670 | 15 | |
duncanFrance | 4:27546fb8b670 | 16 | // Set to draw the bitmap in monochrome |
duncanFrance | 4:27546fb8b670 | 17 | void setMonochrome(bool enabled); |
duncanFrance | 4:27546fb8b670 | 18 | bool isMonochrome(); |
duncanFrance | 4:27546fb8b670 | 19 | |
duncanFrance | 8:a460cabc85ac | 20 | protected: |
duncanFrance | 12:63db16fea709 | 21 | |
duncanFrance | 8:a460cabc85ac | 22 | virtual void _draw(); |
duncanFrance | 12:63db16fea709 | 23 | |
duncanFrance | 4:27546fb8b670 | 24 | unsigned char* _bitmap; |
duncanFrance | 4:27546fb8b670 | 25 | bool _monochrome; |
duncanFrance | 4:27546fb8b670 | 26 | }; |
duncanFrance | 4:27546fb8b670 | 27 | |
duncanFrance | 4:27546fb8b670 | 28 | #endif |