| 57 | // CConfigShortcuts message handlers |
| 58 | |
| 59 | BOOL CConfigShortcuts::OnInitDialog() |
| 60 | { |
| 61 | CPropertyPage::OnInitDialog(); |
| 62 | |
| 63 | CAccelerator *pAccel = theApp.GetAccelerator(); |
| 64 | CListCtrl *pListView = static_cast<CListCtrl*>(GetDlgItem(IDC_SHORTCUTS)); |
| 65 | |
| 66 | CRect r; // // // |
| 67 | pListView->GetClientRect(&r); |
| 68 | int w = r.Width() - ::GetSystemMetrics(SM_CXHSCROLL); |
| 69 | pListView->DeleteAllItems(); |
| 70 | pListView->InsertColumn(0, L"Action", LVCFMT_LEFT, static_cast<int>(.52 * w)); |
| 71 | pListView->InsertColumn(1, L"Modifier", LVCFMT_LEFT, static_cast<int>(.23 * w)); |
| 72 | pListView->InsertColumn(2, L"Key", LVCFMT_LEFT, static_cast<int>(.25 * w)); |
| 73 | |
| 74 | // Build shortcut list |
| 75 | for (int i = 0; i < CAccelerator::ACCEL_COUNT; ++i) { |
| 76 | pListView->InsertItem(i, pAccel->GetItemName(i), 0); |
| 77 | pListView->SetItemText(i, 1, pAccel->GetItemModName(i)); |
| 78 | pListView->SetItemText(i, 2, pAccel->GetItemKeyName(i)); |
| 79 | |
| 80 | m_iKeys[i] = pAccel->GetItemKey(i); |
| 81 | m_iMods[i] = pAccel->GetItemMod(i); |
| 82 | } |
| 83 | |
| 84 | pListView->SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES); |
| 85 | pListView->SetSelectionMark(0); |
| 86 | |
| 87 | m_iSelectedItem = 0; |
| 88 | |
| 89 | return TRUE; // return TRUE unless you set the focus to a control |
| 90 | // EXCEPTION: OCX Property Pages should return FALSE |
| 91 | } |
| 92 | |
| 93 | void CConfigShortcuts::OnNMClickShortcuts(NMHDR *pNMHDR, LRESULT *pResult) |
| 94 | { |
nothing calls this directly
no test coverage detected