* Callback function of the Map Input dialog **/
| 395 | * Callback function of the Map Input dialog |
| 396 | **/ |
| 397 | INT_PTR CALLBACK MapInputDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) |
| 398 | { |
| 399 | switch(uMsg) |
| 400 | { |
| 401 | case WM_INITDIALOG: |
| 402 | { |
| 403 | HWND hwndListView = InitializeListView(hwndDlg); |
| 404 | |
| 405 | InitFilterComboBox(hwndDlg); |
| 406 | |
| 407 | // Now populate the mapping display. |
| 408 | PopulateMappingDisplay(hwndDlg); |
| 409 | |
| 410 | // Autosize last column. |
| 411 | SendMessage(hwndListView, LVM_SETCOLUMNWIDTH, (WPARAM)2, MAKELPARAM(LVSCW_AUTOSIZE, 0)); |
| 412 | SendMessage(hwndListView, LVM_SETCOLUMNWIDTH, (WPARAM)1, MAKELPARAM(LVSCW_AUTOSIZE, 0)); |
| 413 | RECT rect; |
| 414 | GetClientRect(hwndListView, &rect); |
| 415 | SendMessage(hwndListView, LVM_SETCOLUMNWIDTH, (WPARAM)2, MAKELPARAM(rect.right - rect.left - SendMessage(hwndListView, LVM_GETCOLUMNWIDTH, 0, 0) - SendMessage(hwndListView, LVM_GETCOLUMNWIDTH, 1, 0), 0)); |
| 416 | |
| 417 | CenterWindowOnScreen(hwndDlg); |
| 418 | } |
| 419 | |
| 420 | return FALSE; |
| 421 | |
| 422 | case WM_COMMAND: |
| 423 | |
| 424 | if(HIWORD(wParam) == CBN_SELCHANGE) |
| 425 | { |
| 426 | PopulateMappingDisplay(hwndDlg); |
| 427 | break; |
| 428 | } |
| 429 | |
| 430 | switch(LOWORD(wParam)) |
| 431 | { |
| 432 | case IDOK: |
| 433 | EndDialog(hwndDlg, 1); |
| 434 | // Update TAS Editor's tooltips if it's opening. |
| 435 | extern TASEDITOR_WINDOW taseditorWindow; |
| 436 | if (taseditorWindow.hwndTASEditor) |
| 437 | taseditorWindow.updateTooltips(); |
| 438 | // main menu is always shown, so we only need to update it, |
| 439 | // the context menus are updated only when they are created |
| 440 | UpdateMenuHotkeys(FCEUMENU_MAIN); |
| 441 | return TRUE; |
| 442 | |
| 443 | case BTN_CANCEL: // here true cause of ESC button handling as EXIT ;) |
| 444 | EndDialog(hwndDlg, 0); |
| 445 | return TRUE; |
| 446 | |
| 447 | case BTN_RESTORE_DEFAULTS: |
| 448 | ApplyDefaultCommandMapping(); |
| 449 | PopulateMappingDisplay(hwndDlg); |
| 450 | return TRUE; |
| 451 | |
| 452 | default: |
| 453 | break; |
| 454 | } |
nothing calls this directly
no test coverage detected