本文整理汇总了C++中UserCommand::getKeyCombo方法的典型用法代码示例。如果您正苦于以下问题:C++ UserCommand::getKeyCombo方法的具体用法?C++ UserCommand::getKeyCombo怎么用?C++ UserCommand::getKeyCombo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserCommand
的用法示例。
在下文中一共展示了UserCommand::getKeyCombo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run_dlgProc
//.........这里部分代码省略.........
if(sel!=0){
if(IDOK==MessageBox(_hSelf,TEXT("Ok to disable selected shortcuts?"),TEXT("Warning!"),MB_OKCANCEL|MB_SYSTEMMODAL)){
disable_selected(TRUE);
populateShortCuts();
}
}
}
break;
case IDC_SHORTCUT_MODIFY :
{
NppParameters *nppParam = NppParameters::getInstance();
int index;
int selected_row=getselectedrow();
if(selected_row<0)
break;
index=getitemindex(selected_row);
switch(_currentState) {
case STATE_MENU: {
//Get CommandShortcut corresponding to index
vector<CommandShortcut> & shortcuts = nppParam->getUserShortcuts();
CommandShortcut csc = shortcuts[index], prevcsc = shortcuts[index];
csc.init(_hInst, _hSelf);
csc.set_shortcut_info(_currentState,index);
if (csc.doDialog() != -1 && prevcsc != csc) { //shortcut was altered
generic_string keys=csc.toString();
nppParam->addUserModifiedIndex(index);
shortcuts[index] = csc;
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,&csc.getKeyCombo(),nppParam,str,sizeof(str)/sizeof(TCHAR)))
MessageBox(_hSelf,str,L"Duplicates found",MB_OK);
}
break;
}
case STATE_MACRO: {
//Get MacroShortcut corresponding to index
vector<MacroShortcut> & shortcuts = nppParam->getMacroList();
MacroShortcut msc = shortcuts[index], prevmsc = shortcuts[index];
msc.init(_hInst, _hSelf);
msc.set_shortcut_info(_currentState,index);
if (msc.doDialog() != -1 && prevmsc != msc) { //shortcut was altered
generic_string name=msc.getName();
generic_string keys=msc.toString();
shortcuts[index] = msc;
ListView_SetItemText(hlistview,selected_row,1,(LPWSTR)name.c_str());
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,&msc.getKeyCombo(),nppParam,str,sizeof(str)/sizeof(TCHAR)))
MessageBox(_hSelf,str,L"Duplicates found",MB_OK);
}
break;
}
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;