From fae0c2bfe95a122de0f165791690dc18928a931c Mon Sep 17 00:00:00 2001 From: pixel Date: Fri, 14 Nov 2003 17:21:14 +0000 Subject: Started working on widgets. --- include/widgets.h | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 include/widgets.h (limited to 'include/widgets.h') diff --git a/include/widgets.h b/include/widgets.h new file mode 100644 index 0000000..bef2682 --- /dev/null +++ b/include/widgets.h @@ -0,0 +1,52 @@ +#ifndef __WIDGETS_H__ +#define __WIDGETS_H__ + +#include +#include + +namespace mogltk { + class widget : public Base { + public: + virtual ~widget(); + void move(int x, int y); + void resize(int sx, int sy); + int GetX(); + int GetY(); + int GetH(); + int GetW(); + int GetAX(); + int GetAY(); + int GetAX2(); + int GetAY2(); + void fulldraw(); + shape * Shaper(); + protected: + widget(widget * father, int x, int y, int sx, int sy, int type, String name, shape *); + virtual void draw() = 0; + private: + void computeabs(); + int x, y, sx, sy, ax, ay, ax2, ay2; + widget * father, * next, * prev, * child, * root; + static widget * focused; + int type; + String name, caption; + shape * sh; + void idraw(); + }; + + class drawer : public Base { + public: + virtual void draw(widget *) = 0; + }; + + class Root : public widget { + public: + Root(shape *, drawer * = 0); + void setdrawer(drawer *); + protected: + virtual void draw(); + drawer * dr; + }; +}; + +#endif -- cgit v1.2.3