This repository has been archived by the owner on Nov 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGUIROOT.H
executable file
·69 lines (50 loc) · 1.57 KB
/
GUIROOT.H
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef _GUIROOT_
#define _GUIROOT_
#include "guirect.h"
//root for which all elements are children
class ROOT:public GUIrect
{
public:
ROOT();
virtual ~ROOT();
void resize(int xw,int yw);
virtual int keyhit(char kbscan,char key)
{
if (modal) return modal->keyhit(kbscan,key);
return GUIrect::keyhit(kbscan,key);
};
virtual GUIrect *hittest(int x,int y)
{
GUIrect *result=GUIrect::hittest(x,y);
if (result && !modal) setfocus(result);
return result;
};
virtual void refresh(int r,void *c);
virtual void bringtofront() {return;};
virtual void sendtoback() {return;};
virtual int acceptfocus() {return 1;} //root has focus
virtual void losefocus() {return;} //root never loses focus
virtual char *getname() {return "a32root";}
};
//root for which all gui elements are children
class GUIroot:public GUIrect
{
public:
GUIroot(ROOT *p);
~GUIroot();
//no alteration in ordering
// virtual void bringtofront() {return;};
// virtual void sendtoback() {return;};
virtual void refresh(int r,void *c)
{
for (GUIrect *g=child; g; g=g->next) g->refresh(r,c);
};
virtual int acceptfocus() {return 1;} //root has focus
virtual void losefocus() {return;} //root never loses focus
virtual char *getname() {return "guiroot";}
virtual int keyhit(char kbscan,char key); //return 1 if processed
// virtual GUIrect *hittest(int x,int y); //special processing
};
extern class ROOT *root; //root of everything
extern class GUIroot *guiroot; //root of all gui elements
#endif