| 9 | } |
| 10 | |
| 11 | bool ShortcutCommand::SetCommand(CallBackID id, const TCHAR* cmdName, const PFUNCPLUGINCMD pFunc, bool checkOnInit) |
| 12 | { |
| 13 | int nIndex = static_cast<int>(id); |
| 14 | |
| 15 | if (m_nCmdCount <= nIndex || !pFunc) |
| 16 | return false; |
| 17 | |
| 18 | _tcscpy_s(m_pFuncItem[nIndex]._itemName, cmdName); |
| 19 | m_pFuncItem[nIndex]._pFunc = pFunc; |
| 20 | m_pFuncItem[nIndex]._init2Check = checkOnInit; |
| 21 | m_pFuncItem[nIndex]._pShKey = &m_pShortcutKeys[nIndex]; |
| 22 | |
| 23 | return true; |
| 24 | } |
| 25 | |
| 26 | bool ShortcutCommand::SetShortCut(CallBackID id, const ShortcutKey& scKey) |
| 27 | { |