-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInputBox.h
61 lines (49 loc) · 2.1 KB
/
InputBox.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
#pragma once
class InputBox
{
public:
enum MONITOR {
_PRIMARY,
_MOUSE,
_MOUSE_POINTER,
_ID,
};
enum POSITION {
_CENTER,
_TOP_CENTER,
_BOTTOM_CENTER,
_LEFT_CENTER,
_RIGHT_CENTER,
_XY,
_POINTER,
};
struct InformationAboutPositionOfInputBox {
MONITOR monitor;
UINT id;
POSITION type;
POINT delta;
};
static InformationAboutPositionOfInputBox& Position() { static InformationAboutPositionOfInputBox mPosition; return mPosition; };
static int& Width() { static int mWidth = 600; return mWidth; };
static int& FontSize() { static int mFontSize = 22; return mFontSize; };
static int& LinesOfText() { static int mLinesOfText = 1; return mLinesOfText; };
static bool& Password() { static bool mPassword = false; return mPassword; };
static wstring& FontName() { static wstring mFontName = _T("Consolas"); return mFontName; };
static bool& TopMost() { static bool mTopMost = false; return mTopMost; };
static bool& BlockParent() { static bool mBlockParent = false; return mBlockParent; };
static pair<bool, wstring>& Brush() { static pair<bool, wstring> mBrush = pair<bool, wstring>(false, _T("#000000")); return mBrush; };
static pair<bool, wstring>& Background() { static pair<bool, wstring> mBackground = pair<bool, wstring>(false, _T("#000000")); return mBackground; };
static pair<bool, wstring>& Pen() { static pair<bool, wstring> mPen = pair<bool, wstring>(false, _T("#ffffff")); return mPen; };
static wstring& Title() { static wstring mTitle = _T("Input Box"); return mTitle; };
static wstring& Prompt() { static wstring mPrompt = _T("Please input text"); return mPrompt; };
static wstring& Def() { static wstring mDef = _T(""); return mDef; };
static wstring& IconApp() { static wstring mIconApp = _T(""); return mIconApp; };
static bool GetString(wstring& _result);
private:
static LRESULT CALLBACK WndProc(HWND _hWnd, UINT _message, WPARAM _wParam, LPARAM _lParam);
static void SetTextAlignment(HWND _hwnd, int _textAlignment);
static long GetDiameterX(RECT _rect);
static long GetDiameterY(RECT _rect);
static long GetWidth(RECT _rect);
static long GetHeight(RECT _rect);
};