MCPcopy Create free account
hub / github.com/NPP-JSONViewer/JSON-Viewer / SetCommand

Method SetCommand

src/NppJsonViewer/ShortcutCommand.cpp:11–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9}
10
11bool 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
26bool ShortcutCommand::SetShortCut(CallBackID id, const ShortcutKey& scKey)
27{

Callers 1

InitCommandMenuMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected