about summary refs log tree commit diff stats
path: root/Source/Main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Main.cpp')
-rw-r--r--Source/Main.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/Source/Main.cpp b/Source/Main.cpp index 8336c77..8c4bf8c 100644 --- a/Source/Main.cpp +++ b/Source/Main.cpp
@@ -6,13 +6,19 @@
6#include "Randomizer.h" 6#include "Randomizer.h"
7#include "Version.h" 7#include "Version.h"
8#include "Random.h" 8#include "Random.h"
9#include "Panel.h"
9 10
10#define IDC_RANDOMIZE 0x401 11#define IDC_RANDOMIZE 0x401
11#define IDC_TOGGLESPEED 0x402 12#define IDC_TOGGLESPEED 0x402
12#define IDC_SPEEDRUNNER 0x403 13#define IDC_SPEEDRUNNER 0x403
13#define IDC_HARDMODE 0x404 14#define IDC_HARDMODE 0x404
15#define IDC_READ 0x405
16#define IDC_RANDOM 0x406
17#define IDC_WRITE 0x407
14 18
15HWND hwndSeed, hwndRandomize; 19HWND hwndSeed, hwndRandomize;
20int panel = 0x12C9;
21std::shared_ptr<Panel> _panel;
16 22
17LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) 23LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
18{ 24{
@@ -57,6 +63,15 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
57 SetWindowText(hwndRandomize, L"Randomized!"); 63 SetWindowText(hwndRandomize, L"Randomized!");
58 break; 64 break;
59 } 65 }
66 case IDC_READ:
67 _panel = std::make_shared<Panel>(panel);
68 break;
69 case IDC_RANDOM:
70 _panel->Random();
71 break;
72 case IDC_WRITE:
73 _panel->Write(panel);
74 break;
60 } 75 }
61 } 76 }
62 return DefWindowProc(hwnd, message, wParam, lParam); 77 return DefWindowProc(hwnd, message, wParam, lParam);
@@ -99,6 +114,16 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmd
99 WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON, 114 WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
100 160, 10, 100, 26, hwnd, (HMENU)IDC_RANDOMIZE, hInstance, NULL); 115 160, 10, 100, 26, hwnd, (HMENU)IDC_RANDOMIZE, hInstance, NULL);
101 116
117 CreateWindow(L"BUTTON", L"READ",
118 WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
119 160, 100, 100, 26, hwnd, (HMENU)IDC_READ, hInstance, NULL);
120 CreateWindow(L"BUTTON", L"RANDOM",
121 WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
122 160, 130, 100, 26, hwnd, (HMENU)IDC_RANDOM, hInstance, NULL);
123 CreateWindow(L"BUTTON", L"WRITE",
124 WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
125 160, 160, 100, 26, hwnd, (HMENU)IDC_WRITE, hInstance, NULL);
126
102 CreateWindow(L"BUTTON", L"", 127 CreateWindow(L"BUTTON", L"",
103 WS_VISIBLE | WS_CHILD | BS_CHECKBOX, 128 WS_VISIBLE | WS_CHILD | BS_CHECKBOX,
104 10, 52, 12, 12, hwnd, (HMENU)IDC_TOGGLESPEED, hInstance, NULL); 129 10, 52, 12, 12, hwnd, (HMENU)IDC_TOGGLESPEED, hInstance, NULL);