diff options
author | jbzdarkid <jbzdarkid@gmail.com> | 2018-10-29 20:16:44 -0700 |
---|---|---|
committer | jbzdarkid <jbzdarkid@gmail.com> | 2018-10-29 20:16:44 -0700 |
commit | 17351fda252ed62ec5ded998f2697985bcaa0431 (patch) | |
tree | 4a9910ec28cd57ee9d0a197a57650e95e5f3d37e | |
parent | 0d728e66b7bde350a6e5d9f0a467bba7a3433f16 (diff) | |
download | witness-tutorializer-17351fda252ed62ec5ded998f2697985bcaa0431.tar.gz witness-tutorializer-17351fda252ed62ec5ded998f2697985bcaa0431.tar.bz2 witness-tutorializer-17351fda252ed62ec5ded998f2697985bcaa0431.zip |
It's magic -- boxes work
-rw-r--r-- | Source/Main.cpp | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/Source/Main.cpp b/Source/Main.cpp index b227e3d..bcd7ebf 100644 --- a/Source/Main.cpp +++ b/Source/Main.cpp | |||
@@ -10,8 +10,10 @@ | |||
10 | 10 | ||
11 | #define IDC_RANDOMIZE 0x401 | 11 | #define IDC_RANDOMIZE 0x401 |
12 | #define IDC_TOGGLESPEED 0x402 | 12 | #define IDC_TOGGLESPEED 0x402 |
13 | #define IDC_SPEEDRUNNER 0x403 | ||
14 | #define IDC_HARDMODE 0x404 | ||
13 | 15 | ||
14 | HWND hwndSeed, hwndRandomize, hwndSpeedSetting; | 16 | HWND hwndSeed, hwndRandomize; |
15 | 17 | ||
16 | LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) | 18 | LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) |
17 | { | 19 | { |
@@ -23,10 +25,10 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) | |||
23 | switch (LOWORD(wParam)) { | 25 | switch (LOWORD(wParam)) { |
24 | // Speed checkbox | 26 | // Speed checkbox |
25 | case IDC_TOGGLESPEED: | 27 | case IDC_TOGGLESPEED: |
26 | if (IsDlgButtonChecked(hwndSpeedSetting, 1)) { | 28 | if (IsDlgButtonChecked(hwnd, IDC_TOGGLESPEED)) { |
27 | CheckDlgButton(hwndSpeedSetting, 1, BST_UNCHECKED); | 29 | CheckDlgButton(hwnd, IDC_TOGGLESPEED, BST_UNCHECKED); |
28 | } else { | 30 | } else { |
29 | CheckDlgButton(hwndSpeedSetting, 1, BST_CHECKED); | 31 | CheckDlgButton(hwnd, IDC_TOGGLESPEED, BST_CHECKED); |
30 | } | 32 | } |
31 | break; | 33 | break; |
32 | 34 | ||
@@ -50,7 +52,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) | |||
50 | srand(seed); | 52 | srand(seed); |
51 | Randomizer randomizer; | 53 | Randomizer randomizer; |
52 | randomizer.Randomize(); | 54 | randomizer.Randomize(); |
53 | if (IsDlgButtonChecked(hwndSpeedSetting, 1)) { | 55 | if (IsDlgButtonChecked(hwnd, IDC_TOGGLESPEED)) { |
54 | randomizer.AdjustSpeed(); | 56 | randomizer.AdjustSpeed(); |
55 | } | 57 | } |
56 | SetWindowText(hwndRandomize, L"Randomized!"); | 58 | SetWindowText(hwndRandomize, L"Randomized!"); |
@@ -101,13 +103,29 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmd | |||
101 | WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON, | 103 | WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON, |
102 | 160, 10, 100, 26, hwnd, (HMENU)IDC_RANDOMIZE, hInstance, NULL); | 104 | 160, 10, 100, 26, hwnd, (HMENU)IDC_RANDOMIZE, hInstance, NULL); |
103 | 105 | ||
104 | hwndSpeedSetting = CreateWindow(L"BUTTON", L"", | 106 | CreateWindow(L"BUTTON", L"", |
105 | WS_VISIBLE | WS_CHILD | BS_CHECKBOX, | 107 | WS_VISIBLE | WS_CHILD | BS_CHECKBOX, |
106 | 10, 52, 12, 12, hwnd, (HMENU)IDC_TOGGLESPEED, hInstance, NULL); | 108 | 10, 52, 12, 12, hwnd, (HMENU)IDC_TOGGLESPEED, hInstance, NULL); |
107 | CreateWindow(L"STATIC", L"Speed up various autoscrollers", | 109 | CreateWindow(L"STATIC", L"Speed up various autoscrollers", |
108 | WS_TABSTOP | WS_VISIBLE | WS_CHILD | SS_LEFT, | 110 | WS_TABSTOP | WS_VISIBLE | WS_CHILD | SS_LEFT, |
109 | 27, 50, 205, 16, hwnd, NULL, hInstance, NULL); | 111 | 27, 50, 205, 16, hwnd, NULL, hInstance, NULL); |
110 | 112 | ||
113 | /* | ||
114 | CreateWindow(L"BUTTON", L"", | ||
115 | WS_VISIBLE | WS_CHILD | BS_CHECKBOX, | ||
116 | 10, 52, 12, 12, hwnd, (HMENU)IDC_SPEEDRUNNER, hInstance, NULL); | ||
117 | CreateWindow(L"STATIC", L"Allow hard-to-identify panels to be shuffled", | ||
118 | WS_TABSTOP | WS_VISIBLE | WS_CHILD | SS_LEFT, | ||
119 | 27, 50, 205, 16, hwnd, NULL, hInstance, NULL); | ||
120 | |||
121 | CreateWindow(L"BUTTON", L"", | ||
122 | WS_VISIBLE | WS_CHILD | BS_CHECKBOX, | ||
123 | 10, 52, 12, 12, hwnd, (HMENU)IDC_HARDMODE, hInstance, NULL); | ||
124 | CreateWindow(L"STATIC", L"Place harder puzzles in annoying spots", | ||
125 | WS_TABSTOP | WS_VISIBLE | WS_CHILD | SS_LEFT, | ||
126 | 27, 50, 205, 16, hwnd, NULL, hInstance, NULL); | ||
127 | */ | ||
128 | |||
111 | ShowWindow(hwnd, nCmdShow); | 129 | ShowWindow(hwnd, nCmdShow); |
112 | UpdateWindow(hwnd); | 130 | UpdateWindow(hwnd); |
113 | 131 | ||