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

Fork of SimpleGUI by Duncan McIntyre

Widgets/TextWidget.h

Committer:
duncanFrance
Date:
2016-03-27
Revision:
4:27546fb8b670
Parent:
3:cb004f59b715
Child:
7:303850a4b30c

File content as of revision 4:27546fb8b670:

#ifndef SIMPLEGUI_TEXT_WIDGET_H
#define SIMPLEGUI_TEXT_WIDGET_H

#include "Widget.h"
#include "Font.h"
#include "FontRenderer.h"

class TextWidget : public Widget {
    
    public:
    
        TextWidget(GraphicsDisplay* display);
                
        // Ccncrete methods for this class
        virtual void setFont(Font* font);

        virtual void setText(char* text);
    
        // Implementation to account for whether the event's coordinates intersect this widget
        virtual void draw();      
    
    protected:
    
        char *_text;
        Font* _font;
        FontRenderer _renderer;
};

#endif