-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathui.cpp
More file actions
executable file
·73 lines (47 loc) · 1.05 KB
/
ui.cpp
File metadata and controls
executable file
·73 lines (47 loc) · 1.05 KB
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
70
71
72
73
#include "ui.h"
Box::Box(int w, int h)
{
}
Box::~Box()
{
}
void Box::Render(Canvas *canvas)
{
int width = 400;
int height = 100;
int x = (canvas->GetWidth()/2) - (width/2);
int y = (canvas->GetHeight()/2) - (height/2);
canvas->DrawRect(x, y, width, height, 0xffffffff, false);
canvas->Print(x + 10, y + 10, str.c_str(), 0xffffff00, false, 10);
}
void Box::SetText(const wchar *text)
{
str = text;
}
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
UI::UI()
{
}
UI::~UI()
{
}
void UI::Render(Canvas *canvas)
{
/*
int width = 400;
int height = 100;
int x = (clientsize.x/2) - (width/2);
int y = (clientsize.y/2) - (height/2);
canvas->DrawRect(x, y, width, height, 0xffffffff, false);
*/
std::list<CuiBase *>::iterator it = uilist.begin();
for( ; it != uilist.end(); it++ )
{
(*it)->Render(canvas);
}
}
void UI::AddUI(CuiBase *ui)
{
uilist.push_back(ui);
}