Foundation classes for a basic GUI implementing simple widgets and events. (Fork for custom changes.)

Fork of SimpleGUI by Duncan McIntyre

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?

UserRevisionLine numberNew contents of line
duncanFrance 0:0a590815d51c 1 #ifndef SIMPLEGUI_TEXT_WIDGET_H
duncanFrance 0:0a590815d51c 2 #define SIMPLEGUI_TEXT_WIDGET_H
duncanFrance 0:0a590815d51c 3
duncanFrance 0:0a590815d51c 4 #include "Widget.h"
duncanFrance 2:bb9183379488 5 #include "Font.h"
duncanFrance 3:cb004f59b715 6 #include "FontRenderer.h"
duncanFrance 0:0a590815d51c 7 class TextWidget : public Widget {
duncanFrance 0:0a590815d51c 8
duncanFrance 0:0a590815d51c 9 public:
duncanFrance 0:0a590815d51c 10
duncanFrance 7:303850a4b30c 11 TextWidget(GraphicsDisplay& display, FontRenderer* renderer);
duncanFrance 0:0a590815d51c 12
duncanFrance 0:0a590815d51c 13 // Ccncrete methods for this class
duncanFrance 2:bb9183379488 14 virtual void setFont(Font* font);
duncanFrance 1:48796b602c86 15
duncanFrance 0:0a590815d51c 16 virtual void setText(char* text);
duncanFrance 0:0a590815d51c 17
duncanFrance 0:0a590815d51c 18 // Implementation to account for whether the event's coordinates intersect this widget
duncanFrance 0:0a590815d51c 19 virtual void draw();
duncanFrance 0:0a590815d51c 20
duncanFrance 0:0a590815d51c 21 protected:
duncanFrance 0:0a590815d51c 22
duncanFrance 0:0a590815d51c 23 char *_text;
duncanFrance 2:bb9183379488 24 Font* _font;
duncanFrance 7:303850a4b30c 25 FontRenderer* _renderer;
duncanFrance 0:0a590815d51c 26 };
duncanFrance 0:0a590815d51c 27
duncanFrance 0:0a590815d51c 28 #endif