-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathController.cpp
33 lines (26 loc) · 860 Bytes
/
Controller.cpp
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
#include "Controller.h"
INT_PTR CALLBACK Controller::Manipulate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) {
static Queue<int> model;
static ListView listview(hDlg, IDC_LIST1, &model);
UNREFERENCED_PARAMETER(lParam);
switch (message) {
case WM_INITDIALOG:
return (INT_PTR)TRUE;
case WM_COMMAND:
if (LOWORD(wParam) == IDC_BUTTON_PUSH1) {
int value = GetDlgItemInt(hDlg, IDC_EDIT1, NULL, TRUE);
model.enQueue(value);
} else if (LOWORD(wParam) == IDC_BUTTON_POP1) {
model.deQueue();
} else if (LOWORD(wParam) == IDC_BUTTON_CLEAR1) {
model.Clear();
}
listview.Update();
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) {
EndDialog(hDlg, LOWORD(wParam));
return (INT_PTR)TRUE;
}
break;
}
return (INT_PTR)FALSE;
}