Foundation classes for a basic GUI implementing simple widgets and events

Dependents:   TouchScreenGUIDemo

Widgets/TextWidget.h

Committer:
duncanFrance
Date:
2016-05-08
Revision:
12:63db16fea709
Parent:
11:b485561aa112
Child:
13:6714534e7974

File content as of revision 12:63db16fea709:

#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(GraphicsContext *context);
    TextWidget(GraphicsContext *context, FontRenderer* renderer);
    TextWidget(GraphicsContext *context, FontRenderer* renderer, Font* font);

    /**************************
    * Custom methods of this class
    **************************/
    virtual void setFont(Font* font);
    virtual void setText(char* text);

protected:

    /**************************
    * Overrides of Widget
    **************************/
    virtual void _draw();

    /**************************
    * Custom data of this class
    **************************/
    char* _text;
    FontRenderer* _renderer;
    Font* _font;
};

#endif