From 17351fda252ed62ec5ded998f2697985bcaa0431 Mon Sep 17 00:00:00 2001 From: jbzdarkid Date: Mon, 29 Oct 2018 20:16:44 -0700 Subject: It's magic -- boxes work --- Source/Main.cpp | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'Source') 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 @@ #define IDC_RANDOMIZE 0x401 #define IDC_TOGGLESPEED 0x402 +#define IDC_SPEEDRUNNER 0x403 +#define IDC_HARDMODE 0x404 -HWND hwndSeed, hwndRandomize, hwndSpeedSetting; +HWND hwndSeed, hwndRandomize; LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { @@ -23,10 +25,10 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) switch (LOWORD(wParam)) { // Speed checkbox case IDC_TOGGLESPEED: - if (IsDlgButtonChecked(hwndSpeedSetting, 1)) { - CheckDlgButton(hwndSpeedSetting, 1, BST_UNCHECKED); + if (IsDlgButtonChecked(hwnd, IDC_TOGGLESPEED)) { + CheckDlgButton(hwnd, IDC_TOGGLESPEED, BST_UNCHECKED); } else { - CheckDlgButton(hwndSpeedSetting, 1, BST_CHECKED); + CheckDlgButton(hwnd, IDC_TOGGLESPEED, BST_CHECKED); } break; @@ -50,7 +52,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) srand(seed); Randomizer randomizer; randomizer.Randomize(); - if (IsDlgButtonChecked(hwndSpeedSetting, 1)) { + if (IsDlgButtonChecked(hwnd, IDC_TOGGLESPEED)) { randomizer.AdjustSpeed(); } SetWindowText(hwndRandomize, L"Randomized!"); @@ -101,13 +103,29 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmd WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON, 160, 10, 100, 26, hwnd, (HMENU)IDC_RANDOMIZE, hInstance, NULL); - hwndSpeedSetting = CreateWindow(L"BUTTON", L"", + CreateWindow(L"BUTTON", L"", WS_VISIBLE | WS_CHILD | BS_CHECKBOX, 10, 52, 12, 12, hwnd, (HMENU)IDC_TOGGLESPEED, hInstance, NULL); CreateWindow(L"STATIC", L"Speed up various autoscrollers", WS_TABSTOP | WS_VISIBLE | WS_CHILD | SS_LEFT, 27, 50, 205, 16, hwnd, NULL, hInstance, NULL); + /* + CreateWindow(L"BUTTON", L"", + WS_VISIBLE | WS_CHILD | BS_CHECKBOX, + 10, 52, 12, 12, hwnd, (HMENU)IDC_SPEEDRUNNER, hInstance, NULL); + CreateWindow(L"STATIC", L"Allow hard-to-identify panels to be shuffled", + WS_TABSTOP | WS_VISIBLE | WS_CHILD | SS_LEFT, + 27, 50, 205, 16, hwnd, NULL, hInstance, NULL); + + CreateWindow(L"BUTTON", L"", + WS_VISIBLE | WS_CHILD | BS_CHECKBOX, + 10, 52, 12, 12, hwnd, (HMENU)IDC_HARDMODE, hInstance, NULL); + CreateWindow(L"STATIC", L"Place harder puzzles in annoying spots", + WS_TABSTOP | WS_VISIBLE | WS_CHILD | SS_LEFT, + 27, 50, 205, 16, hwnd, NULL, hInstance, NULL); + */ + ShowWindow(hwnd, nCmdShow); UpdateWindow(hwnd); -- cgit 1.4.1