285 |
|
} |
286 |
|
break; |
287 |
|
case IDC_UP_MAP: |
288 |
< |
cout << "STUB: up\a\n"; |
288 |
> |
{ |
289 |
> |
unsigned count = SendMessage(GetDlgItem(hwndDlg, IDC_SELECTED), |
290 |
> |
LB_GETSELCOUNT, 0, 0); |
291 |
> |
unsigned* ups = new unsigned[count]; |
292 |
> |
|
293 |
> |
SendMessage(GetDlgItem(hwndDlg, IDC_SELECTED), LB_GETSELITEMS, |
294 |
> |
count, long(ups)); |
295 |
> |
|
296 |
> |
unsigned insert = ups[0] - 1; |
297 |
> |
|
298 |
> |
if (debug) cerr << "ups = {\n"; |
299 |
> |
for (unsigned index = 0; index < count; index++) |
300 |
> |
{ |
301 |
> |
if (debug) cerr << " [" << index << "] = " << ups[index] |
302 |
> |
<< "\n"; |
303 |
> |
|
304 |
> |
char* up = new char[SendMessage(GetDlgItem(hwndDlg, |
305 |
> |
IDC_SELECTED), LB_GETTEXTLEN, ups[index], 0) + 1]; |
306 |
> |
|
307 |
> |
SendMessage(GetDlgItem(hwndDlg, IDC_SELECTED), LB_GETTEXT, |
308 |
> |
ups[index], long(up)); |
309 |
> |
SendMessage(GetDlgItem(hwndDlg, IDC_SELECTED), |
310 |
> |
LB_DELETESTRING, ups[index], 0); |
311 |
> |
SendMessage(GetDlgItem(hwndDlg, IDC_SELECTED), |
312 |
> |
LB_INSERTSTRING, insert, long(up)); |
313 |
> |
SendMessage(GetDlgItem(hwndDlg, IDC_SELECTED), LB_SETSEL, |
314 |
> |
true, insert++); |
315 |
> |
} |
316 |
> |
if (debug) cerr << "}\n"; |
317 |
> |
|
318 |
> |
delete [] ups; |
319 |
> |
|
320 |
> |
if (SendMessage(GetDlgItem(hwndDlg, IDC_SELECTED), |
321 |
> |
LB_GETSEL, 0, 0) == 0) |
322 |
> |
{ |
323 |
> |
EnableWindow(GetDlgItem(hwndDlg, IDC_UP_MAP), true); |
324 |
> |
} |
325 |
> |
else |
326 |
> |
{ |
327 |
> |
EnableWindow(GetDlgItem(hwndDlg, IDC_UP_MAP), false); |
328 |
> |
} |
329 |
> |
|
330 |
> |
if (SendMessage(GetDlgItem(hwndDlg, IDC_SELECTED), |
331 |
> |
LB_GETSEL, SendMessage(GetDlgItem(hwndDlg, IDC_SELECTED |
332 |
> |
), LB_GETCOUNT, 0, 0) - 1, 0) == 0) |
333 |
> |
{ |
334 |
> |
EnableWindow(GetDlgItem(hwndDlg, IDC_DOWN_MAP), true); |
335 |
> |
} |
336 |
> |
} |
337 |
|
break; |
338 |
|
case IDC_DOWN_MAP: |
339 |
< |
cout << "STUB: down\a\n"; |
339 |
> |
{ |
340 |
> |
unsigned count = SendMessage(GetDlgItem(hwndDlg, IDC_SELECTED), |
341 |
> |
LB_GETSELCOUNT, 0, 0); |
342 |
> |
unsigned* downs = new unsigned[count]; |
343 |
> |
|
344 |
> |
SendMessage(GetDlgItem(hwndDlg, IDC_SELECTED), LB_GETSELITEMS, |
345 |
> |
count, long(downs)); |
346 |
> |
|
347 |
> |
unsigned insert = downs[count - 1] + 1; |
348 |
> |
|
349 |
> |
if (debug) cerr << "downs = {\n"; |
350 |
> |
for (unsigned index = count; index > 0; index--) |
351 |
> |
{ |
352 |
> |
if (debug) cerr << " [" << index << "] = " << downs[index |
353 |
> |
- 1] << "\n"; |
354 |
> |
|
355 |
> |
char* down = new char[SendMessage(GetDlgItem(hwndDlg, |
356 |
> |
IDC_SELECTED), LB_GETTEXTLEN, downs[index - 1], 0) + |
357 |
> |
1]; |
358 |
> |
|
359 |
> |
SendMessage(GetDlgItem(hwndDlg, IDC_SELECTED), LB_GETTEXT, |
360 |
> |
downs[index - 1], long(down)); |
361 |
> |
SendMessage(GetDlgItem(hwndDlg, IDC_SELECTED), |
362 |
> |
LB_DELETESTRING, downs[index - 1], 0); |
363 |
> |
SendMessage(GetDlgItem(hwndDlg, IDC_SELECTED), |
364 |
> |
LB_INSERTSTRING, insert, long(down)); |
365 |
> |
SendMessage(GetDlgItem(hwndDlg, IDC_SELECTED), LB_SETSEL, |
366 |
> |
true, insert--); |
367 |
> |
} |
368 |
> |
if (debug) cerr << "}\n"; |
369 |
> |
|
370 |
> |
delete [] downs; |
371 |
> |
|
372 |
> |
if (SendMessage(GetDlgItem(hwndDlg, IDC_SELECTED), |
373 |
> |
LB_GETSEL, 0, 0) == 0) |
374 |
> |
{ |
375 |
> |
EnableWindow(GetDlgItem(hwndDlg, IDC_UP_MAP), true); |
376 |
> |
} |
377 |
> |
|
378 |
> |
if (SendMessage(GetDlgItem(hwndDlg, IDC_SELECTED), |
379 |
> |
LB_GETSEL, SendMessage(GetDlgItem(hwndDlg, IDC_SELECTED |
380 |
> |
), LB_GETCOUNT, 0, 0) - 1, 0) == 0) |
381 |
> |
{ |
382 |
> |
EnableWindow(GetDlgItem(hwndDlg, IDC_DOWN_MAP), true); |
383 |
> |
} |
384 |
> |
else |
385 |
> |
{ |
386 |
> |
EnableWindow(GetDlgItem(hwndDlg, IDC_DOWN_MAP), false); |
387 |
> |
} |
388 |
> |
} |
389 |
|
break; |
390 |
|
case IDC_AVAILABLE: |
391 |
|
switch (HIWORD(wParam)) |