MCPcopy Create free account
hub / github.com/HertzDevil/0CC-FamiTracker / OnInitDialog

Method OnInitDialog

Source/ConfigShortcuts.cpp:59–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57// CConfigShortcuts message handlers
58
59BOOL 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
93void CConfigShortcuts::OnNMClickShortcuts(NMHDR *pNMHDR, LRESULT *pResult)
94{

Callers

nothing calls this directly

Calls 6

GetItemNameMethod · 0.80
GetItemModNameMethod · 0.80
GetItemKeyNameMethod · 0.80
GetItemKeyMethod · 0.80
GetItemModMethod · 0.80
GetAcceleratorMethod · 0.45

Tested by

no test coverage detected