-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWindow.h
More file actions
231 lines (180 loc) · 11.6 KB
/
Copy pathWindow.h
File metadata and controls
231 lines (180 loc) · 11.6 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
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
#pragma once
// Including some important header files.
#include <Windows.h>
#include <string>
#include <Gdiplus.h>
#include "Common.h"
#include <fstream>
#include <iostream>
#include "Font.h"
// Including some important libraries.
#pragma comment(lib, "user32.lib")
#pragma comment(lib, "gdi32.lib")
#pragma comment(lib, "gdiplus.lib")
namespace Function
{
typedef struct
{
bool isCloseButtonHover = false;
bool paintHoverCloseButton = true;
bool isAllButtonPaint = false;
bool isMaximizeButtonHover = false;
bool isMinimizeButtonHover = false;
bool isSettingButtonHover = false;
} BUTTONSTATE;
}
namespace TkinterWindow
{
class Window
{
private:
// Variables
HWND __windowHandle = NULL;
HINSTANCE __hInstance = NULL;
WNDCLASSEXA __windowClass = { 0 };
std::string __windowClassName = "TkinterWindow-Window";
std::string __windowTitle = "TkinterWindow";
std::string __windowIcon = "";
int __titleBarHeight = 30;
int __statusBarHeight = 22;
std::string __statusBarText = "Ready...";
Gdiplus::GdiplusStartupInput __gdiplusStartupInput;
ULONG_PTR __gdiplusToken;
MSG __msg = {0};
INT __xPosition = NULL, __yPosition = NULL, __width = NULL, __height = NULL;
INT __previousXPosition = NULL, __previousYPosition = NULL, __previousWidth = NULL, __previousHeight = NULL;
Function::THEME __theme = {0};
bool __isFullScreen = false;
TkinterWindow::Font __titleTextFont;
TkinterWindow::Font __statusBarTextFont;
Function::BUTTONSTATE __buttonState;
int __differenceX = 0;
int __differenceY = 0;
int __widthDifference = 0;
int __heightDifference = 0;
int __previouseBorderRadius = 0;
// Functions
static LRESULT CALLBACK __WindowProcedure(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
LRESULT __TkinterWindow_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
void __RePaintWindow();
void __DrawCloseButton(HDC hDC, RECT windowRect, int buttonWidth, int buttonHeight);
void __DrawMaximizeButton(HDC hDC, RECT windowRect, int buttonWidth, int buttonHeight);
void __DrawMinimizeButton(HDC hDC, RECT windowRect, int buttonWidth, int buttonHeight);
void __DrawSettingButton(HDC hDC, RECT windowRect, int buttonWidth, int buttonHeight);
public:
// Variables
HWND self;
HWND Self;
// Functions
// [ Starting ] Main Functions
EXPORTFUNCTION bool InitializeWindow(HINSTANCE hInstance = NULL, std::string sWindowClassName = "TkinterWindow-Window");
EXPORTFUNCTION bool StartMainLoop(int nMax = 0, int nMin = 0);
// [ Ending ] Main Functions
// [ Starting ] Icon Setting Functions.
EXPORTFUNCTION bool SetWindowTaskBarIcon(std::string sIconPath);
EXPORTFUNCTION bool SetTaskBarIcon(std::string sIconPath);
EXPORTFUNCTION bool SetWindowFocusIcon(std::string sIconPath);
EXPORTFUNCTION bool SetFocusIcon(std::string sIconPath);
EXPORTFUNCTION bool SetWindowUnfocusIcon(std::string sIconPath);
EXPORTFUNCTION bool SetUnfocusIcon(std::string sIconPath);
// [ Ending ] Icon Setting Functions.
// [ Starting ] Cursor Setting Functions.
EXPORTFUNCTION bool SetWindowCursor(std::string sCursorPath);
EXPORTFUNCTION bool SetCursor(std::string sCursorPath);
EXPORTFUNCTION bool SetWindowLeftResizeCursor(std::string sCursorPath);
EXPORTFUNCTION bool SetLeftResizeCursor(std::string sCursorPath);
EXPORTFUNCTION bool SetWindowRightResizeCursor(std::string sCursorPath);
EXPORTFUNCTION bool SetRightResizeCursor(std::string sCursorPath);
EXPORTFUNCTION bool SetWindowTopResizeCursor(std::string sCursorPath);
EXPORTFUNCTION bool SetTopResizeCursor(std::string sCursorPath);
EXPORTFUNCTION bool SetWindowBottomResizeCursor(std::string sCursorPath);
EXPORTFUNCTION bool SetBottomResizeCursor(std::string sCursorPath);
EXPORTFUNCTION bool SetWindowTopLeftResizeCursor(std::string sCursorPath);
EXPORTFUNCTION bool SetTopLeftResizeCursor(std::string sCursorPath);
EXPORTFUNCTION bool SetWindowTopRightResizeCursor(std::string sCursorPath);
EXPORTFUNCTION bool SetTopRightResizeCursor(std::string sCursorPath);
EXPORTFUNCTION bool SetWindowBottomLeftResizeCursor(std::string sCursorPath);
EXPORTFUNCTION bool SetBottomLeftResizeCursor(std::string sCursorPath);
EXPORTFUNCTION bool SetWindowBottomRightResizeCursor(std::string sCursorPath);
EXPORTFUNCTION bool SetBottomRightResizeCursor(std::string sCursorPath);
// [ Ending ] Cursor Setting Functions.
// [ Starting ] Window Colors Setting Functions.
EXPORTFUNCTION bool SetWindowBackgroundColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetBackgroundColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetWindowBorderFocusColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetBorderFocusColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetWindowBorderUnfocusColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetBorderUnfocusColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetWindowTitleBarBackgroundColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetTitleBarBackgroundColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetWindowTitleBarTextFocusColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetTitleBarTextFocusColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetWindowCloseButtonTextFocusColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetCloseButtonTextFocusColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetWindowCloseButtonTextHoverColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetCloseButtonTextHoverColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetWindowCloseButtonBackgroundHoverColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetCloseButtonBackgroundHoverColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetWindowCloseButtonTextUnfocusColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetCloseButtonTextUnfocusColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetWindowMaximizeButtonTextFocusColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetMaximizeButtonTextFocusColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetWindowMaximizeButtonTextHoverColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetMaximizeButtonTextHoverColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetWindowMaximizeButtonBackgroundHoverColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetMaximizeButtonBackgroundHoverColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetWindowMaximizeButtonTextUnfocusColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetMaximizeButtonTextUnfocusColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetWindowMinimizeButtonTextFocusColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetMinimizeButtonTextFocusColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetWindowMinimizeButtonTextHoverColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetMinimizeButtonTextHoverColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetWindowMinimizeButtonBackgroundHoverColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetMinimizeButtonBackgroundHoverColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetWindowMinimizeButtonTextUnfocusColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetMinimizeButtonTextUnfocusColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetWindowSettingButtonTextFocusColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetSettingButtonTextFocusColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetWindowSettingButtonTextHoverColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetSettingButtonTextHoverColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetWindowSettingButtonBackgroundHoverColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetSettingButtonBackgroundHoverColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetWindowSettingButtonTextUnfocusColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetSettingButtonTextUnfocusColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetWindowStatusBarBackgroundColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetStatusBarBackgroundColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetWindowStatusBarTextFocusColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetStatusBarTextFocusColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetWindowStatusBarTextUnfocusColor(int nRed, int nGreen, int nBlue);
EXPORTFUNCTION bool SetStatusBarTextUnfocusColor(int nRed, int nGreen, int nBlue);
// [ Ending ] Window Colors Setting Functions.
// [ Starting ] Window Positioning Functions.
EXPORTFUNCTION bool SetWindowPosition(int nX, int nY);
EXPORTFUNCTION bool SetPosition(int nX, int nY);
EXPORTFUNCTION bool SetWindowHorizontalPosition(int nX);
EXPORTFUNCTION bool SetHorizontalPosition(int nX);
EXPORTFUNCTION bool SetWindowXPosition(int nX);
EXPORTFUNCTION bool SetXPosition(int nX);
EXPORTFUNCTION bool SetWindowVerticalPosition(int nY);
EXPORTFUNCTION bool SetVerticalPosition(int nY);
EXPORTFUNCTION bool SetWindowYPosition(int nY);
EXPORTFUNCTION bool SetYPosition(int nY);
// [ Ending ] Window Positioning Functions.
// [ Starting ] Window Sizing Functions.
EXPORTFUNCTION bool SetWindowSize(int nWidth, int nHeight);
EXPORTFUNCTION bool SetSize(int nWidth, int nHeight);
EXPORTFUNCTION bool SetWindowWidth(int nWidth);
EXPORTFUNCTION bool SetWidth(int nWidth);
EXPORTFUNCTION bool SetWindowHeight(int nHeight);
EXPORTFUNCTION bool SetHeight(int nHeight);
EXPORTFUNCTION bool SetWindowBorderRadius(int nRadius);
EXPORTFUNCTION bool SetBorderRadius(int nRadius);
EXPORTFUNCTION bool SetWindowBorderRoundness(int nRoundness);
EXPORTFUNCTION bool SetBorderRoundness(int nRoundness);
// [ Ending ] Window Sizing Functions.
// [ Starting ] Status Bar Text Controlling Functions.
EXPORTFUNCTION bool SetWindowStatusBarText(std::string sStatusBarText);
EXPORTFUNCTION bool SetStatusBarText(std::string sStatusBarText);
// [ Ending ] Status Bar Text Controlling Functions.
};
}