summaryrefslogtreecommitdiff
path: root/include/widgets.h
diff options
context:
space:
mode:
authorpixel <pixel>2003-11-14 17:21:14 +0000
committerpixel <pixel>2003-11-14 17:21:14 +0000
commitfae0c2bfe95a122de0f165791690dc18928a931c (patch)
tree1f8056a480702d72c4f871ad7375a575510bb7ff /include/widgets.h
parentd7575bef1e530eac004c973b0384a12561f0bb8b (diff)
Started working on widgets.
Diffstat (limited to 'include/widgets.h')
-rw-r--r--include/widgets.h52
1 files changed, 52 insertions, 0 deletions
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 <Exceptions.h>
+#include <shape.h>
+
+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