mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
[NOTEPAD] Shift+F3 for backward search (#5101)
- Add Shift+F3 accelerator as command CMD_SEARCH_PREV. - Extend DIALOG_SearchNext function with bDown argument for the action of CMD_SEARCH_PREV. - Modify the message loop for effective F3 key on Find/Replace dialog. CORE-17064
This commit is contained in:
parent
a9b1e059f4
commit
55e3feba53
44 changed files with 58 additions and 8 deletions
|
@ -1070,8 +1070,13 @@ VOID DIALOG_Search(VOID)
|
|||
DIALOG_SearchDialog(FindText);
|
||||
}
|
||||
|
||||
VOID DIALOG_SearchNext(VOID)
|
||||
VOID DIALOG_SearchNext(BOOL bDown)
|
||||
{
|
||||
if (bDown)
|
||||
Globals.find.Flags |= FR_DOWN;
|
||||
else
|
||||
Globals.find.Flags &= ~FR_DOWN;
|
||||
|
||||
if (Globals.find.lpstrFindWhat != NULL)
|
||||
NOTEPAD_FindNext(&Globals.find, FALSE, TRUE);
|
||||
else
|
||||
|
|
|
@ -39,7 +39,7 @@ VOID DIALOG_EditTimeDate(VOID);
|
|||
VOID DIALOG_EditWrap(VOID);
|
||||
|
||||
VOID DIALOG_Search(VOID);
|
||||
VOID DIALOG_SearchNext(VOID);
|
||||
VOID DIALOG_SearchNext(BOOL bDown);
|
||||
VOID DIALOG_Replace(VOID);
|
||||
VOID DIALOG_GoTo(VOID);
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ BEGIN
|
|||
"^X", CMD_CUT
|
||||
"^Z", CMD_UNDO
|
||||
VK_F3, CMD_SEARCH_NEXT, VIRTKEY
|
||||
VK_F3, CMD_SEARCH_PREV, VIRTKEY, SHIFT
|
||||
VK_F5, CMD_TIME_DATE, VIRTKEY
|
||||
END
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* Copyright 1997,98 Marcel Baur <mbaur@g26.ethz.ch>
|
||||
* Copyright 2002 Sylvain Petreolle <spetreolle@yahoo.fr>
|
||||
* Copyright 2002 Andriy Palamarchuk
|
||||
* Copyright 2020 Katayama Hirofumi MZ
|
||||
* Copyright 2020-2023 Katayama Hirofumi MZ
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -37,6 +37,7 @@ VOID NOTEPAD_EnableSearchMenu()
|
|||
UINT uEnable = MF_BYCOMMAND | (bEmpty ? MF_GRAYED : MF_ENABLED);
|
||||
EnableMenuItem(Globals.hMenu, CMD_SEARCH, uEnable);
|
||||
EnableMenuItem(Globals.hMenu, CMD_SEARCH_NEXT, uEnable);
|
||||
EnableMenuItem(Globals.hMenu, CMD_SEARCH_PREV, uEnable);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -83,9 +84,10 @@ static int NOTEPAD_MenuCommand(WPARAM wParam)
|
|||
case CMD_TIME_DATE: DIALOG_EditTimeDate(); break;
|
||||
|
||||
case CMD_SEARCH: DIALOG_Search(); break;
|
||||
case CMD_SEARCH_NEXT: DIALOG_SearchNext(); break;
|
||||
case CMD_SEARCH_NEXT: DIALOG_SearchNext(TRUE); break;
|
||||
case CMD_REPLACE: DIALOG_Replace(); break;
|
||||
case CMD_GOTO: DIALOG_GoTo(); break;
|
||||
case CMD_SEARCH_PREV: DIALOG_SearchNext(FALSE); break;
|
||||
|
||||
case CMD_WRAP: DIALOG_EditWrap(); break;
|
||||
case CMD_FONT: DIALOG_SelectFont(); break;
|
||||
|
@ -647,14 +649,17 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE prev, LPTSTR cmdline, int sh
|
|||
|
||||
hAccel = LoadAccelerators(hInstance, MAKEINTRESOURCE(ID_ACCEL));
|
||||
|
||||
while (GetMessage(&msg, 0, 0, 0))
|
||||
while (GetMessage(&msg, NULL, 0, 0))
|
||||
{
|
||||
if (!IsDialogMessage(Globals.hFindReplaceDlg, &msg) &&
|
||||
!TranslateAccelerator(Globals.hMainWnd, hAccel, &msg))
|
||||
if (!TranslateAccelerator(Globals.hMainWnd, hAccel, &msg) &&
|
||||
!IsDialogMessage(Globals.hFindReplaceDlg, &msg))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
|
||||
DestroyAcceleratorTable(hAccel);
|
||||
|
||||
return (int) msg.wParam;
|
||||
}
|
||||
|
|
|
@ -99,5 +99,5 @@ void NOTEPAD_LoadSettingsFromRegistry(void);
|
|||
void NOTEPAD_SaveSettingsToRegistry(void);
|
||||
|
||||
/* from main.c */
|
||||
BOOL NOTEPAD_FindNext(FINDREPLACE *, BOOL , BOOL );
|
||||
BOOL NOTEPAD_FindNext(FINDREPLACE *pFindReplace, BOOL bReplace, BOOL bShowAlert);
|
||||
VOID NOTEPAD_EnableSearchMenu(VOID);
|
||||
|
|
|
@ -54,6 +54,7 @@
|
|||
#define CMD_SEARCH_NEXT 0x121
|
||||
#define CMD_REPLACE 0x122
|
||||
#define CMD_GOTO 0x123
|
||||
#define CMD_SEARCH_PREV 0x124
|
||||
|
||||
#define CMD_WRAP 0x119
|
||||
#define CMD_FONT 0x140
|
||||
|
|
Loading…
Reference in a new issue