-
Notifications
You must be signed in to change notification settings - Fork 3
/
Window.cpp
108 lines (88 loc) · 1.83 KB
/
Window.cpp
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#pragma once
#include "GUI.h"
#include "GUISPEC.h"
#include "Interfaces.h"
void CWindow::SetPosition(int x, int y)
{
m_x = x; m_y = y;
}
void CWindow::SetSize(int w, int h)
{
m_iWidth = w;
m_iHeight = h;
}
void CWindow::SetTitle(std::string title)
{
Title = title;
}
void CWindow::RegisterTab(CTab* Tab)
{
if (Tabs.size() == 0)
{
SelectedTab = Tab;
}
Tab->parent = this;
Tabs.push_back(Tab);
}
RECT CWindow::GetClientArea()
{
RECT client;
client.left = m_x + 8;
client.top = m_y + 1 + 27;
client.right = m_iWidth - 4 - 12;
client.bottom = m_iHeight - 2 - 8 - 26;
return client;
}
RECT CWindow::GetClientArea1()
{
RECT client;
client.left = m_x - 131;
client.top = m_y + 1 + 27 + 50;
client.right = m_iWidth - 4 - 12;
client.bottom = m_iHeight - 2 - 8 - 26 + 500;
return client;
}
RECT CWindow::GetTabArea()
{
RECT client;
client.left = m_x - 131;
client.top = m_y + 57;
client.right = 140;
client.bottom = m_iHeight - 4 - 550;
return client;
}
void CWindow::Open()
{
m_bIsOpen = true;
}
void CWindow::Close()
{
m_bIsOpen = false;
}
void CWindow::Toggle()
{
m_bIsOpen = !m_bIsOpen;
if (m_bIsOpen)
Interfaces::Engine->ClientCmd_Unrestricted("cl_mouseenable 0");
else
Interfaces::Engine->ClientCmd_Unrestricted("cl_mouseenable 1");
}
bool CWindow::isOpen()
{
return m_bIsOpen;
}
CControl* CWindow::GetFocus()
{
return FocusedControl;
}
// TABS ---------------------------------------------------------------------------------------------------
void CTab::SetTitle(std::string name)
{
Title = name;
}
void CTab::RegisterControl(CControl* control)
{
control->parent = parent;
Controls.push_back(control);
}
//Radar ---------------------------------------------------------------------------------------------------