本文整理汇总了C++中NppParameters::addPluginModifiedIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ NppParameters::addPluginModifiedIndex方法的具体用法?C++ NppParameters::addPluginModifiedIndex怎么用?C++ NppParameters::addPluginModifiedIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NppParameters
的用法示例。
在下文中一共展示了NppParameters::addPluginModifiedIndex方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run_dlgProc
//.........这里部分代码省略.........
vector<UserCommand> & shortcuts = nppParam->getUserCommandList();
UserCommand ucmd = shortcuts[row - 1];
ucmd.init(_hInst, _hSelf);
UserCommand prevucmd = ucmd;
if (ucmd.doDialog() != -1 && prevucmd != ucmd)
{
//shortcut was altered
shortcuts[row - 1] = ucmd;
//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();
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)
{
示例2: run_dlgProc
//.........这里部分代码省略.........
if (msc.doDialog() != -1 && prevmsc != msc) { //shortcut was altered
shortcuts[row - 1] = msc;
_babygrid.setText(row, 1, msc.getName());
_babygrid.setText(row, 2, msc.toString().c_str());
//Notify current Accelerator class to update everything
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;
}
示例3: run_dlgProc
//.........这里部分代码省略.........
case STATE_USER: {
//Get UserCommand corresponding to index
vector<UserCommand> & shortcuts = nppParam->getUserCommandList();
UserCommand ucmd = shortcuts[index], prevucmd = shortcuts[index];
ucmd.init(_hInst, _hSelf);
ucmd.set_shortcut_info(_currentState,index);
prevucmd = ucmd;
if (ucmd.doDialog() != -1 && prevucmd != ucmd) { //shortcut was altered
generic_string name=ucmd.getName();
generic_string keys=ucmd.toString();
shortcuts[index] = ucmd;
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;