Allow Ctrl-TAB to switch tabs in FindReplace dialog

Fix #14975, close #14988
This commit is contained in:
ozone10 2024-04-13 08:34:05 +02:00 committed by Don Ho
parent 896d78a5db
commit 7cfa79b8cd
3 changed files with 65 additions and 0 deletions

View File

@ -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<DIALOG_TYPE>(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<std::mutex> lock(findOps_mutex);

View File

@ -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)
{

View File

@ -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