curvedraw

diff src/widgets.h @ 0:8e524989c904

getting there
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 15 Dec 2015 07:15:53 +0200
parents
children 7f795f7fecd6
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/widgets.h	Tue Dec 15 07:15:53 2015 +0200
     1.3 @@ -0,0 +1,30 @@
     1.4 +#ifndef WIDGETS_H_
     1.5 +#define WIDGETS_H_
     1.6 +
     1.7 +#include <vmath/vmath.h>
     1.8 +
     1.9 +class Widget {
    1.10 +protected:
    1.11 +	Vector2 pos;
    1.12 +	char *text;
    1.13 +
    1.14 +public:
    1.15 +	Widget();
    1.16 +	virtual ~Widget();
    1.17 +
    1.18 +	virtual void set_position(const Vector2 &p);
    1.19 +	virtual const Vector2 &get_position() const;
    1.20 +
    1.21 +	virtual void set_text(const char *str);
    1.22 +	virtual void set_textf(const char *str, ...);
    1.23 +	virtual const char *get_text() const;
    1.24 +
    1.25 +	virtual void draw() const = 0;
    1.26 +};
    1.27 +
    1.28 +class Label : public Widget {
    1.29 +public:
    1.30 +	virtual void draw() const;
    1.31 +};
    1.32 +
    1.33 +#endif	// WIDGETS_H_