119 |
|
|
120 |
|
delete config; |
121 |
|
|
122 |
< |
if (debug) cin.get(); |
122 |
> |
if (debug) |
123 |
> |
{ |
124 |
> |
cout << "Press enter key to exit . . ."; |
125 |
> |
cin.get(); |
126 |
> |
} |
127 |
|
|
128 |
|
return 0; |
129 |
|
} |
207 |
|
EndDialog(hwndDlg, wParam); |
208 |
|
return true; |
209 |
|
case IDC_ADD_MAP: |
210 |
+ |
{ |
211 |
+ |
unsigned count = SendMessage(GetDlgItem(hwndDlg, |
212 |
+ |
IDC_AVAILABLE), LB_GETSELCOUNT, 0, 0); |
213 |
+ |
unsigned* additions = new unsigned[count]; |
214 |
+ |
|
215 |
+ |
SendMessage(GetDlgItem(hwndDlg, IDC_AVAILABLE), LB_GETSELITEMS, |
216 |
+ |
count, long(additions)); |
217 |
+ |
|
218 |
+ |
if (debug) cerr << "additions = {\n"; |
219 |
+ |
for (unsigned index = 0; index < count; index++) |
220 |
+ |
{ |
221 |
+ |
if (debug) cerr << " [" << index << "] = " << |
222 |
+ |
additions[index] << "\n"; |
223 |
+ |
|
224 |
+ |
char* name = new char[SendMessage(GetDlgItem(hwndDlg, |
225 |
+ |
IDC_AVAILABLE), LB_GETTEXTLEN, additions[index], 0) + 1 |
226 |
+ |
]; |
227 |
+ |
|
228 |
+ |
SendMessage(GetDlgItem(hwndDlg, IDC_AVAILABLE), LB_GETTEXT, |
229 |
+ |
additions[index], long(name)); |
230 |
+ |
SendMessage(GetDlgItem(hwndDlg, IDC_SELECTED), |
231 |
+ |
LB_ADDSTRING, 0, long(name)); |
232 |
+ |
|
233 |
+ |
delete [] name; |
234 |
+ |
} |
235 |
+ |
if (debug) cerr << "}\n"; |
236 |
+ |
|
237 |
+ |
delete [] additions; |
238 |
+ |
|
239 |
+ |
SendMessage(GetDlgItem(hwndDlg, IDC_AVAILABLE), LB_SETSEL, |
240 |
+ |
false, -1); |
241 |
+ |
EnableWindow(GetDlgItem(hwndDlg, IDC_ADD_MAP), false); |
242 |
+ |
} |
243 |
|
break; |
244 |
|
case IDC_REMOVE_MAP: |
245 |
+ |
{ |
246 |
+ |
unsigned count = SendMessage(GetDlgItem(hwndDlg, IDC_SELECTED), |
247 |
+ |
LB_GETSELCOUNT, 0, 0); |
248 |
+ |
unsigned* removals = new unsigned[count]; |
249 |
+ |
|
250 |
+ |
SendMessage(GetDlgItem(hwndDlg, IDC_SELECTED), LB_GETSELITEMS, |
251 |
+ |
count, long(removals)); |
252 |
+ |
|
253 |
+ |
if (debug) cerr << "removals = {\n"; |
254 |
+ |
for (unsigned index = count; index > 0; index--) |
255 |
+ |
{ |
256 |
+ |
if (debug) cerr << " [" << index - 1 << "] = " << |
257 |
+ |
removals[index - 1] << "\n"; |
258 |
+ |
|
259 |
+ |
SendMessage(GetDlgItem(hwndDlg, IDC_SELECTED), |
260 |
+ |
LB_DELETESTRING, removals[index - 1], 0); |
261 |
+ |
} |
262 |
+ |
if (debug) cerr << "}\n"; |
263 |
+ |
|
264 |
+ |
delete [] removals; |
265 |
+ |
|
266 |
+ |
EnableWindow(GetDlgItem(hwndDlg, IDC_REMOVE_MAP), false); |
267 |
+ |
EnableWindow(GetDlgItem(hwndDlg, IDC_UP_MAP), false); |
268 |
+ |
EnableWindow(GetDlgItem(hwndDlg, IDC_DOWN_MAP), false); |
269 |
+ |
} |
270 |
|
break; |
271 |
|
case IDC_UP_MAP: |
272 |
+ |
cout << "STUB: up\a\n"; |
273 |
|
break; |
274 |
|
case IDC_DOWN_MAP: |
275 |
+ |
cout << "STUB: down\a\n"; |
276 |
|
break; |
277 |
|
case IDC_AVAILABLE: |
278 |
|
switch (HIWORD(wParam)) |