diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp index 4529a7f7c..808d7cdb9 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp @@ -1693,6 +1693,63 @@ intptr_t CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA enableMarkFunc(); return TRUE; + case IDC_NEXT_TAB: + case IDC_PREV_TAB: + { + const int lastTab = TabCtrl_GetItemCount(_tab.getHSelf()) - 1; + int selTab = TabCtrl_GetCurSel(_tab.getHSelf()); + + if (LOWORD(wParam) == IDC_NEXT_TAB) + { + if (selTab++ == lastTab) + { + selTab = 0; + } + } + else + { + if (selTab-- == 0) + { + selTab = lastTab; + } + } + + switch (static_cast(selTab)) + { + case DIALOG_TYPE::FIND_DLG: + { + enableReplaceFunc(false); + break; + } + + case DIALOG_TYPE::REPLACE_DLG: + { + enableReplaceFunc(true); + break; + } + + case DIALOG_TYPE::FINDINFILES_DLG: + { + enableFindInFilesFunc(); + break; + } + + case DIALOG_TYPE::FINDINPROJECTS_DLG: + { + enableFindInProjectsFunc(); + break; + } + + case DIALOG_TYPE::MARK_DLG: + { + enableMarkFunc(); + break; + } + } + + return TRUE; + } + case IDREPLACE: { std::lock_guard lock(findOps_mutex); diff --git a/PowerEditor/src/WinControls/shortcut/shortcut.cpp b/PowerEditor/src/WinControls/shortcut/shortcut.cpp index e5f95f2e2..f0b16cc98 100644 --- a/PowerEditor/src/WinControls/shortcut/shortcut.cpp +++ b/PowerEditor/src/WinControls/shortcut/shortcut.cpp @@ -626,6 +626,11 @@ void Accelerator::updateShortcuts() if (_hFindAccTab) ::DestroyAcceleratorTable(_hFindAccTab); + + ACCEL accNextTab{ BYTE{FVIRTKEY | FCONTROL}, VK_TAB, IDC_NEXT_TAB }; + ACCEL accPrevTab{ BYTE{FVIRTKEY | FCONTROL | FSHIFT}, VK_TAB, IDC_PREV_TAB }; + findReplaceAcc.emplace_back(accNextTab); + findReplaceAcc.emplace_back(accPrevTab); size_t nbFindReplaceAcc = findReplaceAcc.size(); if (nbFindReplaceAcc) { diff --git a/PowerEditor/src/resource.h b/PowerEditor/src/resource.h index c34f7ac64..81f6d4361 100644 --- a/PowerEditor/src/resource.h +++ b/PowerEditor/src/resource.h @@ -439,6 +439,9 @@ //#define IDC_KEY_SELECT_2_HOME (IDCMD+8) //#define IDC_KEY_SELECT_2_END (IDCMD+9) + #define IDC_NEXT_TAB IDC_NEXT_DOC + #define IDC_PREV_TAB IDC_PREV_DOC + #define IDCMD_LIMIT (IDCMD+20) #define IDSCINTILLA 60000