1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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
|