CString CBCGPKeyMapDlg::GetCommandKeys (UINT uiCmdID) const { //-------------------------------------------- // Fill keys associated with selected command: //-------------------------------------------- CString strKey; for (int i = 0; i < m_nAccelSize; i ++) { if (uiCmdID == m_lpAccel [i].cmd) { ASSERT (&m_lpAccel [i] != NULL); CBCGPKeyHelper helper (&m_lpAccel [i]); CString sNewKey; helper.Format (sNewKey); if (!strKey.IsEmpty()) { strKey += _T("; "); } strKey += sNewKey; } } return strKey; }
//************************************************************************************ BOOL CBCGPShowAllButton::OnToolHitTest (const CWnd* /*pWnd*/, TOOLINFO* pTI) { if (pTI == NULL) { return FALSE; } CString strText; CString strKey; ACCEL accel; accel.fVirt = FVIRTKEY | FCONTROL; accel.key = VK_DOWN; CBCGPKeyHelper helper (&accel); helper.Format (strKey); CBCGPLocalResource locaRes; strText.Format (IDS_BCGBARRES_EXPAND_FMT, strKey); pTI->lpszText = (LPTSTR) ::calloc ((strText.GetLength () + 1), sizeof (TCHAR)); lstrcpy (pTI->lpszText, strText); pTI->uId = 0; return TRUE; }
//****************************************************************** void CBCGPKeyboardPage::AddKeyEntry (LPACCEL pEntry) { ASSERT (pEntry != NULL); CBCGPKeyHelper helper (pEntry); CString str; helper.Format (str); int iIndex = m_wndCurrentKeysList.AddString (str); m_wndCurrentKeysList.SetItemData (iIndex, (DWORD_PTR) pEntry); }