curvedraw

annotate src/widgets.h @ 2:ce7aa9a0594c

improved curve editing
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 17 Dec 2015 05:13:25 +0200
parents
children 7f795f7fecd6
rev   line source
nuclear@0 1 #ifndef WIDGETS_H_
nuclear@0 2 #define WIDGETS_H_
nuclear@0 3
nuclear@0 4 #include <vmath/vmath.h>
nuclear@0 5
nuclear@0 6 class Widget {
nuclear@0 7 protected:
nuclear@0 8 Vector2 pos;
nuclear@0 9 char *text;
nuclear@0 10
nuclear@0 11 public:
nuclear@0 12 Widget();
nuclear@0 13 virtual ~Widget();
nuclear@0 14
nuclear@0 15 virtual void set_position(const Vector2 &p);
nuclear@0 16 virtual const Vector2 &get_position() const;
nuclear@0 17
nuclear@0 18 virtual void set_text(const char *str);
nuclear@0 19 virtual void set_textf(const char *str, ...);
nuclear@0 20 virtual const char *get_text() const;
nuclear@0 21
nuclear@0 22 virtual void draw() const = 0;
nuclear@0 23 };
nuclear@0 24
nuclear@0 25 class Label : public Widget {
nuclear@0 26 public:
nuclear@0 27 virtual void draw() const;
nuclear@0 28 };
nuclear@0 29
nuclear@0 30 #endif // WIDGETS_H_