MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / DlgProcInternal

Method DlgProcInternal

source/Configuration/PageSlots.cpp:72–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72INT_PTR CPageSlots::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
73{
74 switch (message)
75 {
76 case WM_NOTIFY:
77 {
78 // Property Sheet notifications
79
80 switch (((LPPSHNOTIFY)lparam)->hdr.code)
81 {
82 case PSN_SETACTIVE:
83 // About to become the active page
84 m_PropertySheetHelper.SetLastPage(m_Page);
85 InitOptions(hWnd);
86 break;
87 case PSN_KILLACTIVE:
88 SetWindowLongPtr(hWnd, DWLP_MSGRESULT, FALSE); // Changes are valid
89 break;
90 case PSN_APPLY:
91 DlgOK(hWnd);
92 SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_NOERROR); // Changes are valid
93 break;
94 case PSN_QUERYCANCEL:
95 // Can use this to ask user to confirm cancel
96 break;
97 case PSN_RESET:
98 DlgCANCEL(hWnd);
99 break;
100 default:
101 return FALSE;
102 }
103 }
104 break;
105
106 case WM_COMMAND:
107 switch (LOWORD(wparam))
108 {
109 case IDC_SLOT0:
110 case IDC_SLOT1:
111 case IDC_SLOT2:
112 case IDC_SLOT3:
113 case IDC_SLOT4:
114 case IDC_SLOT5:
115 case IDC_SLOT6:
116 case IDC_SLOT7:
117 // Use CBN_CLOSEUP (instead of CBN_SELCHANGE - which fires for each cursor up/down)
118 if (HIWORD(wparam) == CBN_CLOSEUP)
119 {
120 const UINT slot = LOWORD(wparam) - IDC_SLOT0;
121 const uint32_t newChoiceItem = (uint32_t)SendDlgItemMessage(hWnd, LOWORD(wparam), CB_GETCURSEL, 0, 0);
122
123 SS_CARDTYPE newCard = CT_Empty;
124 if (newChoiceItem < m_choicesList[slot].size())
125 newCard = m_choicesList[slot][newChoiceItem];
126 else
127 _ASSERT(0);
128
129 if (m_PropertySheetHelper.GetConfigNew().m_Slot[slot] != newCard)

Callers 1

DlgProcMethod · 0.45

Calls 2

SetLastPageMethod · 0.80
IsOkToResetConfigMethod · 0.80

Tested by

no test coverage detected