本文整理汇总了C++中UserCommand::getID方法的典型用法代码示例。如果您正苦于以下问题:C++ UserCommand::getID方法的具体用法?C++ UserCommand::getID怎么用?C++ UserCommand::getID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserCommand
的用法示例。
在下文中一共展示了UserCommand::getID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run_dlgProc
//.........这里部分代码省略.........
fillOutBabyGrid();
isModified = true;
//Notify current Accelerator class to update everything
nppParam->getAccelerator()->updateShortcuts();
nppParam->setShortcutDirty();
}
break;
}
case STATE_PLUGIN:
{
//Get PluginCmdShortcut corresponding to row
vector<PluginCmdShortcut> & shortcuts = nppParam->getPluginCommandList();
PluginCmdShortcut pcsc = shortcuts[row - 1];
pcsc.init(_hInst, _hSelf);
PluginCmdShortcut prevpcsc = pcsc;
if (pcsc.doDialog() != -1 && prevpcsc != pcsc)
{
//shortcut was altered
nppParam->addPluginModifiedIndex(row-1);
shortcuts[row - 1] = pcsc;
//save the current view
_lastHomeRow[_currentState] = _babygrid.getHomeRow();
_lastCursorRow[_currentState] = _babygrid.getSelectedRow();
fillOutBabyGrid();
isModified = true;
//Notify current Accelerator class to update everything
nppParam->getAccelerator()->updateShortcuts();
unsigned long cmdID = pcsc.getID();
ShortcutKey shortcut;
shortcut._isAlt = pcsc.getKeyCombo()._isAlt;
shortcut._isCtrl = pcsc.getKeyCombo()._isCtrl;
shortcut._isShift = pcsc.getKeyCombo()._isShift;
shortcut._key = pcsc.getKeyCombo()._key;
::SendMessage(_hParent, NPPM_INTERNAL_PLUGINSHORTCUTMOTIFIED, cmdID, reinterpret_cast<LPARAM>(&shortcut));
nppParam->setShortcutDirty();
}
break;
}
case STATE_SCINTILLA:
{
//Get ScintillaKeyMap corresponding to row
vector<ScintillaKeyMap> & shortcuts = nppParam->getScintillaKeyList();
ScintillaKeyMap skm = shortcuts[row - 1], prevskm = shortcuts[row-1];
skm.init(_hInst, _hSelf);
if (skm.doDialog() != -1 && prevskm != skm)
{
//shortcut was altered
nppParam->addScintillaModifiedIndex(row-1);
shortcuts[row-1] = skm;
//save the current view
_lastHomeRow[_currentState] = _babygrid.getHomeRow();
_lastCursorRow[_currentState] = _babygrid.getSelectedRow();
fillOutBabyGrid();
_babygrid.updateView();
isModified = true;
示例2: run_dlgProc
//.........这里部分代码省略.........
nppParam->getAccelerator()->updateShortcuts();
}
break; }
case STATE_USER: {
//Get UserCommand corresponding to row
vector<UserCommand> & shortcuts = nppParam->getUserCommandList();
UserCommand ucmd = shortcuts[row - 1], prevucmd = shortcuts[row - 1];
ucmd.init(_hInst, _hSelf);
prevucmd = ucmd;
if (ucmd.doDialog() != -1 && prevucmd != ucmd) { //shortcut was altered
shortcuts[row - 1] = ucmd;
_babygrid.setText(row, 1, ucmd.getName());
_babygrid.setText(row, 2, ucmd.toString().c_str());
//Notify current Accelerator class to update everything
nppParam->getAccelerator()->updateShortcuts();
}
break; }
case STATE_PLUGIN: {
//Get PluginCmdShortcut corresponding to row
vector<PluginCmdShortcut> & shortcuts = nppParam->getPluginCommandList();
PluginCmdShortcut pcsc = shortcuts[row - 1], prevpcsc = shortcuts[row - 1];
pcsc.init(_hInst, _hSelf);
prevpcsc = pcsc;
if (pcsc.doDialog() != -1 && prevpcsc != pcsc) { //shortcut was altered
nppParam->addPluginModifiedIndex(row-1);
shortcuts[row - 1] = pcsc;
_babygrid.setText(row, 2, pcsc.toString().c_str());
//Notify current Accelerator class to update everything
nppParam->getAccelerator()->updateShortcuts();
unsigned long cmdID = pcsc.getID();
ShortcutKey shortcut;
shortcut._isAlt = pcsc.getKeyCombo()._isAlt;
shortcut._isCtrl = pcsc.getKeyCombo()._isCtrl;
shortcut._isShift = pcsc.getKeyCombo()._isShift;
shortcut._key = pcsc.getKeyCombo()._key;
::SendMessage(_hParent, NPPM_INTERNAL_PLUGINSHORTCUTMOTIFIED, cmdID, (LPARAM)&shortcut);
}
break; }
case STATE_SCINTILLA: {
//Get ScintillaKeyMap corresponding to row
vector<ScintillaKeyMap> & shortcuts = nppParam->getScintillaKeyList();
ScintillaKeyMap skm = shortcuts[row - 1], prevskm = shortcuts[row-1];
skm.init(_hInst, _hSelf);
if (skm.doDialog() != -1 && prevskm != skm)
{
//shortcut was altered
nppParam->addScintillaModifiedIndex(row-1);
shortcuts[row-1] = skm;
_babygrid.setText(row, 2, skm.toString().c_str());
//Notify current Accelerator class to update key
nppParam->getScintillaAccelerator()->updateKeys();
}
break;
}
}
return TRUE;
}
case IDM_BABYGRID_DELETE :
{
NppParameters *nppParam = NppParameters::getInstance();
示例3: run_dlgProc
//.........这里部分代码省略.........
ListView_SetItemText(hlistview,selected_row,1,(LPWSTR)name.c_str());
ListView_SetItemText(hlistview,selected_row,2,(LPWSTR)keys.c_str());
update_col_width(name.c_str(),1);
update_col_width(keys.c_str(),2);
//Notify current Accelerator class to update everything
nppParam->getAccelerator()->updateShortcuts();
TCHAR str[255];
if(0<check_in_use(_currentState,index,&ucmd.getKeyCombo(),nppParam,str,sizeof(str)/sizeof(TCHAR)))
MessageBox(_hSelf,str,L"Duplicates found",MB_OK);
}
break;
}
case STATE_PLUGIN: {
//Get PluginCmdShortcut corresponding to index
vector<PluginCmdShortcut> & shortcuts = nppParam->getPluginCommandList();
if(shortcuts.empty())
break;
PluginCmdShortcut pcsc = shortcuts[index], prevpcsc = shortcuts[index];
pcsc.init(_hInst, _hSelf);
pcsc.set_shortcut_info(_currentState,index);
prevpcsc = pcsc;
if (pcsc.doDialog() != -1 && prevpcsc != pcsc) { //shortcut was altered
nppParam->addPluginModifiedIndex(index);
generic_string keys=pcsc.toString();
shortcuts[index] = pcsc;
ListView_SetItemText(hlistview,selected_row,2,(LPWSTR)keys.c_str());
update_col_width(keys.c_str(),2);
//Notify current Accelerator class to update everything
nppParam->getAccelerator()->updateShortcuts();
TCHAR str[255];
if(0<check_in_use(_currentState,index,&pcsc.getKeyCombo(),nppParam,str,sizeof(str)/sizeof(TCHAR)))
MessageBox(_hSelf,str,L"Duplicates found",MB_OK);
unsigned long cmdID = pcsc.getID();
ShortcutKey shortcut;
shortcut._isAlt = pcsc.getKeyCombo()._isAlt;
shortcut._isCtrl = pcsc.getKeyCombo()._isCtrl;
shortcut._isShift = pcsc.getKeyCombo()._isShift;
shortcut._key = pcsc.getKeyCombo()._key;
::SendMessage(_hParent, NPPM_INTERNAL_PLUGINSHORTCUTMOTIFIED, cmdID, (LPARAM)&shortcut);
}
break;
}
case STATE_SCINTILLA: {
//Get ScintillaKeyMap corresponding to index
vector<ScintillaKeyMap> & shortcuts = nppParam->getScintillaKeyList();
ScintillaKeyMap skm = shortcuts[index], prevskm = shortcuts[index];
skm.init(_hInst, _hSelf);
skm.set_shortcut_info(_currentState,index);
if (skm.doDialog() != -1 && prevskm != skm)
{
//shortcut was altered
nppParam->addScintillaModifiedIndex(index);
shortcuts[index] = skm;
int i,max;
TCHAR str[40]={0};
max=skm.getSize();
for(i=0;i<max;i++){
generic_string keys=skm.toString(i);
_sntprintf_s(str,sizeof(str)/sizeof(TCHAR),_TRUNCATE,L"%s%s%c",str,keys.c_str(),i<(max-1)?L';':L'');
}
ListView_SetItemText(hlistview,selected_row,2,(LPWSTR)str);
update_col_width(str,2);
if(max>0){
TCHAR str[255];