wordpad: Add replace dialog.
This commit is contained in:
parent
917fc5fd48
commit
48aba990bc
|
@ -35,7 +35,7 @@ BEGIN
|
||||||
END
|
END
|
||||||
POPUP "&Bearbeiten"
|
POPUP "&Bearbeiten"
|
||||||
BEGIN
|
BEGIN
|
||||||
MENUITEM "&Rückgängig\tCtrl+Z", ID_EDIT_UNDO
|
MENUITEM "Rü&ckgängig\tCtrl+Z", ID_EDIT_UNDO
|
||||||
MENUITEM "&Wiederholen\tCtrl+Y", ID_EDIT_REDO
|
MENUITEM "&Wiederholen\tCtrl+Y", ID_EDIT_REDO
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Aus&schneiden\tCtrl+X", ID_EDIT_CUT
|
MENUITEM "Aus&schneiden\tCtrl+X", ID_EDIT_CUT
|
||||||
|
@ -46,6 +46,7 @@ BEGIN
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "&Find . . .\tCrtl+F", ID_FIND
|
MENUITEM "&Find . . .\tCrtl+F", ID_FIND
|
||||||
MENUITEM "Find &next\tF3", ID_FIND_NEXT
|
MENUITEM "Find &next\tF3", ID_FIND_NEXT
|
||||||
|
MENUITEM "&Replace . . .\tCtrl+H", ID_REPLACE
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Schreibgeschü&tzt", ID_EDIT_READONLY
|
MENUITEM "Schreibgeschü&tzt", ID_EDIT_READONLY
|
||||||
MENUITEM "&Geändert", ID_EDIT_MODIFIED
|
MENUITEM "&Geändert", ID_EDIT_MODIFIED
|
||||||
|
|
|
@ -36,7 +36,7 @@ BEGIN
|
||||||
POPUP "&Edit"
|
POPUP "&Edit"
|
||||||
BEGIN
|
BEGIN
|
||||||
MENUITEM "&Undo\tCtrl+Z", ID_EDIT_UNDO
|
MENUITEM "&Undo\tCtrl+Z", ID_EDIT_UNDO
|
||||||
MENUITEM "&Redo\tCtrl+Y", ID_EDIT_REDO
|
MENUITEM "R&edo\tCtrl+Y", ID_EDIT_REDO
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Cu&t\tCtrl+X", ID_EDIT_CUT
|
MENUITEM "Cu&t\tCtrl+X", ID_EDIT_CUT
|
||||||
MENUITEM "&Copy\tCtrl+C", ID_EDIT_COPY
|
MENUITEM "&Copy\tCtrl+C", ID_EDIT_COPY
|
||||||
|
@ -46,11 +46,12 @@ BEGIN
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "&Find . . .\tCrtl+F", ID_FIND
|
MENUITEM "&Find . . .\tCrtl+F", ID_FIND
|
||||||
MENUITEM "Find &next\tF3", ID_FIND_NEXT
|
MENUITEM "Find &next\tF3", ID_FIND_NEXT
|
||||||
|
MENUITEM "&Replace . . .\tCtrl+H", ID_REPLACE
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Read-&only", ID_EDIT_READONLY
|
MENUITEM "Read-&only", ID_EDIT_READONLY
|
||||||
MENUITEM "&Modified", ID_EDIT_MODIFIED
|
MENUITEM "&Modified", ID_EDIT_MODIFIED
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
POPUP "&Extras"
|
POPUP "E&xtras"
|
||||||
BEGIN
|
BEGIN
|
||||||
MENUITEM "Selection &info", ID_EDIT_SELECTIONINFO
|
MENUITEM "Selection &info", ID_EDIT_SELECTIONINFO
|
||||||
MENUITEM "Character &format", ID_EDIT_CHARFORMAT
|
MENUITEM "Character &format", ID_EDIT_CHARFORMAT
|
||||||
|
|
|
@ -36,7 +36,7 @@ BEGIN
|
||||||
POPUP "É&dition"
|
POPUP "É&dition"
|
||||||
BEGIN
|
BEGIN
|
||||||
MENUITEM "&Annuler\tCtrl+Z", ID_EDIT_UNDO
|
MENUITEM "&Annuler\tCtrl+Z", ID_EDIT_UNDO
|
||||||
MENUITEM "&Répéter\tCtrl+Y", ID_EDIT_REDO
|
MENUITEM "Ré&péter\tCtrl+Y", ID_EDIT_REDO
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "&Couper\tCtrl+X", ID_EDIT_CUT
|
MENUITEM "&Couper\tCtrl+X", ID_EDIT_CUT
|
||||||
MENUITEM "Co&pier\tCtrl+C", ID_EDIT_COPY
|
MENUITEM "Co&pier\tCtrl+C", ID_EDIT_COPY
|
||||||
|
@ -46,6 +46,7 @@ BEGIN
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "&Find . . .\tCrtl+F", ID_FIND
|
MENUITEM "&Find . . .\tCrtl+F", ID_FIND
|
||||||
MENUITEM "Find &next\tF3", ID_FIND_NEXT
|
MENUITEM "Find &next\tF3", ID_FIND_NEXT
|
||||||
|
MENUITEM "&Replace . . .\tCtrl+H", ID_REPLACE
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Lecture-&seule", ID_EDIT_READONLY
|
MENUITEM "Lecture-&seule", ID_EDIT_READONLY
|
||||||
MENUITEM "&Modifié", ID_EDIT_MODIFIED
|
MENUITEM "&Modifié", ID_EDIT_MODIFIED
|
||||||
|
|
|
@ -46,6 +46,7 @@ BEGIN
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "&Find . . .\tCrtl+F", ID_FIND
|
MENUITEM "&Find . . .\tCrtl+F", ID_FIND
|
||||||
MENUITEM "Find &next\tF3", ID_FIND_NEXT
|
MENUITEM "Find &next\tF3", ID_FIND_NEXT
|
||||||
|
MENUITEM "&Replace . . .\tCtrl+H", ID_REPLACE
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Csak &olvasható", ID_EDIT_READONLY
|
MENUITEM "Csak &olvasható", ID_EDIT_READONLY
|
||||||
MENUITEM "Mó&dosítva", ID_EDIT_MODIFIED
|
MENUITEM "Mó&dosítva", ID_EDIT_MODIFIED
|
||||||
|
|
|
@ -37,7 +37,7 @@ BEGIN
|
||||||
POPUP "편집(&E)"
|
POPUP "편집(&E)"
|
||||||
BEGIN
|
BEGIN
|
||||||
MENUITEM "되돌리기(&U)\tCtrl+Z", ID_EDIT_UNDO
|
MENUITEM "되돌리기(&U)\tCtrl+Z", ID_EDIT_UNDO
|
||||||
MENUITEM "다시 실행(&R)\tCtrl+Y", ID_EDIT_REDO
|
MENUITEM "다시 실행(&E)\tCtrl+Y", ID_EDIT_REDO
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "잘라내기(&T)\tCtrl+X", ID_EDIT_CUT
|
MENUITEM "잘라내기(&T)\tCtrl+X", ID_EDIT_CUT
|
||||||
MENUITEM "복사(&C)\tCtrl+C", ID_EDIT_COPY
|
MENUITEM "복사(&C)\tCtrl+C", ID_EDIT_COPY
|
||||||
|
@ -47,11 +47,12 @@ BEGIN
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "찾기(&F). . .\tCrtl+F", ID_FIND
|
MENUITEM "찾기(&F). . .\tCrtl+F", ID_FIND
|
||||||
MENUITEM "다음 찾기(&N)\tF3", ID_FIND_NEXT
|
MENUITEM "다음 찾기(&N)\tF3", ID_FIND_NEXT
|
||||||
|
MENUITEM "&Replace . . .\tCtrl+H", ID_REPLACE
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "읽기 전용(&O)", ID_EDIT_READONLY
|
MENUITEM "읽기 전용(&O)", ID_EDIT_READONLY
|
||||||
MENUITEM "수정 가능(&M)", ID_EDIT_MODIFIED
|
MENUITEM "수정 가능(&M)", ID_EDIT_MODIFIED
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
POPUP "기타(&E)"
|
POPUP "기타(&X)"
|
||||||
BEGIN
|
BEGIN
|
||||||
MENUITEM "선택 영역 정보(&I)", ID_EDIT_SELECTIONINFO
|
MENUITEM "선택 영역 정보(&I)", ID_EDIT_SELECTIONINFO
|
||||||
MENUITEM "문자 형식(&F)", ID_EDIT_CHARFORMAT
|
MENUITEM "문자 형식(&F)", ID_EDIT_CHARFORMAT
|
||||||
|
|
|
@ -46,6 +46,7 @@ BEGIN
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "&Find . . .\tCrtl+F", ID_FIND
|
MENUITEM "&Find . . .\tCrtl+F", ID_FIND
|
||||||
MENUITEM "Find &next\tF3", ID_FIND_NEXT
|
MENUITEM "Find &next\tF3", ID_FIND_NEXT
|
||||||
|
MENUITEM "&Replace . . .\tCtrl+H", ID_REPLACE
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Alleen &lezen", ID_EDIT_READONLY
|
MENUITEM "Alleen &lezen", ID_EDIT_READONLY
|
||||||
MENUITEM "&Gewijzigd", ID_EDIT_MODIFIED
|
MENUITEM "&Gewijzigd", ID_EDIT_MODIFIED
|
||||||
|
|
|
@ -46,8 +46,9 @@ BEGIN
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "&Søk etter . . .\tCrtl+F", ID_FIND
|
MENUITEM "&Søk etter . . .\tCrtl+F", ID_FIND
|
||||||
MENUITEM "Søk etter &neste\tF3", ID_FIND_NEXT
|
MENUITEM "Søk etter &neste\tF3", ID_FIND_NEXT
|
||||||
|
MENUITEM "E&rstatt . . .\tCtrl+H", ID_REPLACE
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Sk&rivebeskyttet", ID_EDIT_READONLY
|
MENUITEM "S&krivebeskyttet", ID_EDIT_READONLY
|
||||||
MENUITEM "E&ndret", ID_EDIT_MODIFIED
|
MENUITEM "E&ndret", ID_EDIT_MODIFIED
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
POPUP "&Ekstra"
|
POPUP "&Ekstra"
|
||||||
|
|
|
@ -47,6 +47,7 @@ BEGIN
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "&Find . . .\tCrtl+F", ID_FIND
|
MENUITEM "&Find . . .\tCrtl+F", ID_FIND
|
||||||
MENUITEM "Find &next\tF3", ID_FIND_NEXT
|
MENUITEM "Find &next\tF3", ID_FIND_NEXT
|
||||||
|
MENUITEM "&Replace . . .\tCtrl+H", ID_REPLACE
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Tylko do &odczytu", ID_EDIT_READONLY
|
MENUITEM "Tylko do &odczytu", ID_EDIT_READONLY
|
||||||
MENUITEM "&Zmodifykowany", ID_EDIT_MODIFIED
|
MENUITEM "&Zmodifykowany", ID_EDIT_MODIFIED
|
||||||
|
|
|
@ -45,6 +45,7 @@ BEGIN
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "&Find . . .\tCrtl+F", ID_FIND
|
MENUITEM "&Find . . .\tCrtl+F", ID_FIND
|
||||||
MENUITEM "Find &next\tF3", ID_FIND_NEXT
|
MENUITEM "Find &next\tF3", ID_FIND_NEXT
|
||||||
|
MENUITEM "&Replace . . .\tCtrl+H", ID_REPLACE
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "&Òîëüêî äëÿ ÷òåíèÿ", ID_EDIT_READONLY
|
MENUITEM "&Òîëüêî äëÿ ÷òåíèÿ", ID_EDIT_READONLY
|
||||||
MENUITEM "&Èçìåíåí", ID_EDIT_MODIFIED
|
MENUITEM "&Èçìåíåí", ID_EDIT_MODIFIED
|
||||||
|
|
|
@ -49,6 +49,7 @@ BEGIN
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "&Find . . .\tCrtl+F", ID_FIND
|
MENUITEM "&Find . . .\tCrtl+F", ID_FIND
|
||||||
MENUITEM "Find &next\tF3", ID_FIND_NEXT
|
MENUITEM "Find &next\tF3", ID_FIND_NEXT
|
||||||
|
MENUITEM "&Replace . . .\tCtrl+H", ID_REPLACE
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Salt-&okunur", ID_EDIT_READONLY
|
MENUITEM "Salt-&okunur", ID_EDIT_READONLY
|
||||||
MENUITEM "&Deðiþmiþ", ID_EDIT_MODIFIED
|
MENUITEM "&Deðiþmiþ", ID_EDIT_MODIFIED
|
||||||
|
|
|
@ -36,9 +36,10 @@
|
||||||
|
|
||||||
#define ID_FIND 1014
|
#define ID_FIND 1014
|
||||||
#define ID_FIND_NEXT 1015
|
#define ID_FIND_NEXT 1015
|
||||||
|
#define ID_REPLACE 1016
|
||||||
|
|
||||||
#define ID_PREVIEW_NEXTPAGE 1016
|
#define ID_PREVIEW_NEXTPAGE 1017
|
||||||
#define ID_PREVIEW_PREVPAGE 1017
|
#define ID_PREVIEW_PREVPAGE 1018
|
||||||
|
|
||||||
#define ID_ALIGN_LEFT 1100
|
#define ID_ALIGN_LEFT 1100
|
||||||
#define ID_ALIGN_CENTER 1101
|
#define ID_ALIGN_CENTER 1101
|
||||||
|
|
|
@ -31,6 +31,7 @@ BEGIN
|
||||||
"R", ID_ALIGN_RIGHT, VIRTKEY, CONTROL
|
"R", ID_ALIGN_RIGHT, VIRTKEY, CONTROL
|
||||||
"F", ID_FIND, VIRTKEY, CONTROL
|
"F", ID_FIND, VIRTKEY, CONTROL
|
||||||
VK_F3, ID_FIND_NEXT, VIRTKEY
|
VK_F3, ID_FIND_NEXT, VIRTKEY
|
||||||
|
"H", ID_REPLACE, VIRTKEY, CONTROL
|
||||||
"A", ID_EDIT_SELECTALL, VIRTKEY, CONTROL
|
"A", ID_EDIT_SELECTALL, VIRTKEY, CONTROL
|
||||||
"X", ID_EDIT_CUT, VIRTKEY, CONTROL
|
"X", ID_EDIT_CUT, VIRTKEY, CONTROL
|
||||||
"C", ID_EDIT_COPY, VIRTKEY, CONTROL
|
"C", ID_EDIT_COPY, VIRTKEY, CONTROL
|
||||||
|
|
|
@ -1844,7 +1844,9 @@ static LRESULT handle_findmsg(LPFINDREPLACEW pFr)
|
||||||
hFindWnd = 0;
|
hFindWnd = 0;
|
||||||
pFr->Flags = FR_FINDNEXT;
|
pFr->Flags = FR_FINDNEXT;
|
||||||
return 0;
|
return 0;
|
||||||
} else if(pFr->Flags & FR_FINDNEXT)
|
}
|
||||||
|
|
||||||
|
if(pFr->Flags & FR_FINDNEXT || pFr->Flags & FR_REPLACE || pFr->Flags & FR_REPLACEALL)
|
||||||
{
|
{
|
||||||
DWORD flags = FR_DOWN;
|
DWORD flags = FR_DOWN;
|
||||||
FINDTEXTW ft;
|
FINDTEXTW ft;
|
||||||
|
@ -1918,13 +1920,19 @@ static LRESULT handle_findmsg(LPFINDREPLACEW pFr)
|
||||||
cr.cpMin = end;
|
cr.cpMin = end;
|
||||||
SendMessageW(hEditorWnd, EM_SETSEL, (WPARAM)ret, (LPARAM)end);
|
SendMessageW(hEditorWnd, EM_SETSEL, (WPARAM)ret, (LPARAM)end);
|
||||||
SendMessageW(hEditorWnd, EM_SCROLLCARET, 0, 0);
|
SendMessageW(hEditorWnd, EM_SCROLLCARET, 0, 0);
|
||||||
|
|
||||||
|
if(pFr->Flags & FR_REPLACE || pFr->Flags & FR_REPLACEALL)
|
||||||
|
SendMessageW(hEditorWnd, EM_REPLACESEL, TRUE, (LPARAM)pFr->lpstrReplaceWith);
|
||||||
|
|
||||||
|
if(pFr->Flags & FR_REPLACEALL)
|
||||||
|
handle_findmsg(pFr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dialog_find(LPFINDREPLACEW fr)
|
static void dialog_find(LPFINDREPLACEW fr, BOOL replace)
|
||||||
{
|
{
|
||||||
static WCHAR findBuffer[MAX_STRING_LEN];
|
static WCHAR findBuffer[MAX_STRING_LEN];
|
||||||
|
|
||||||
|
@ -1936,6 +1944,9 @@ static void dialog_find(LPFINDREPLACEW fr)
|
||||||
fr->lCustData = -1;
|
fr->lCustData = -1;
|
||||||
fr->wFindWhatLen = MAX_STRING_LEN*sizeof(WCHAR);
|
fr->wFindWhatLen = MAX_STRING_LEN*sizeof(WCHAR);
|
||||||
|
|
||||||
|
if(replace)
|
||||||
|
hFindWnd = ReplaceTextW(fr);
|
||||||
|
else
|
||||||
hFindWnd = FindTextW(fr);
|
hFindWnd = FindTextW(fr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2716,13 +2727,17 @@ static LRESULT OnCommand( HWND hWnd, WPARAM wParam, LPARAM lParam)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_FIND:
|
case ID_FIND:
|
||||||
dialog_find(&findreplace);
|
dialog_find(&findreplace, FALSE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_FIND_NEXT:
|
case ID_FIND_NEXT:
|
||||||
handle_findmsg(&findreplace);
|
handle_findmsg(&findreplace);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ID_REPLACE:
|
||||||
|
dialog_find(&findreplace, TRUE);
|
||||||
|
break;
|
||||||
|
|
||||||
case ID_FONTSETTINGS:
|
case ID_FONTSETTINGS:
|
||||||
dialog_choose_font();
|
dialog_choose_font();
|
||||||
break;
|
break;
|
||||||
|
@ -3048,6 +3063,9 @@ static LRESULT OnInitPopupMenu( HWND hWnd, WPARAM wParam, LPARAM lParam )
|
||||||
|
|
||||||
EnableMenuItem(hMenu, ID_FIND_NEXT, MF_BYCOMMAND|((textLength && mi.dwItemData) ?
|
EnableMenuItem(hMenu, ID_FIND_NEXT, MF_BYCOMMAND|((textLength && mi.dwItemData) ?
|
||||||
MF_ENABLED : MF_GRAYED));
|
MF_ENABLED : MF_GRAYED));
|
||||||
|
|
||||||
|
EnableMenuItem(hMenu, ID_REPLACE, MF_BYCOMMAND|(textLength ? MF_ENABLED : MF_GRAYED));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue