wordpad: Add replace dialog.

This commit is contained in:
Alexander Nicolaysen Sørnes 2007-08-26 15:01:44 +02:00 committed by Alexandre Julliard
parent 917fc5fd48
commit 48aba990bc
13 changed files with 43 additions and 13 deletions

View File

@ -35,7 +35,7 @@ BEGIN
END
POPUP "&Bearbeiten"
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 SEPARATOR
MENUITEM "Aus&schneiden\tCtrl+X", ID_EDIT_CUT
@ -46,6 +46,7 @@ BEGIN
MENUITEM SEPARATOR
MENUITEM "&Find . . .\tCrtl+F", ID_FIND
MENUITEM "Find &next\tF3", ID_FIND_NEXT
MENUITEM "&Replace . . .\tCtrl+H", ID_REPLACE
MENUITEM SEPARATOR
MENUITEM "Schreibgeschü&tzt", ID_EDIT_READONLY
MENUITEM "&Geändert", ID_EDIT_MODIFIED

View File

@ -36,7 +36,7 @@ BEGIN
POPUP "&Edit"
BEGIN
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 "Cu&t\tCtrl+X", ID_EDIT_CUT
MENUITEM "&Copy\tCtrl+C", ID_EDIT_COPY
@ -46,11 +46,12 @@ BEGIN
MENUITEM SEPARATOR
MENUITEM "&Find . . .\tCrtl+F", ID_FIND
MENUITEM "Find &next\tF3", ID_FIND_NEXT
MENUITEM "&Replace . . .\tCtrl+H", ID_REPLACE
MENUITEM SEPARATOR
MENUITEM "Read-&only", ID_EDIT_READONLY
MENUITEM "&Modified", ID_EDIT_MODIFIED
MENUITEM SEPARATOR
POPUP "&Extras"
POPUP "E&xtras"
BEGIN
MENUITEM "Selection &info", ID_EDIT_SELECTIONINFO
MENUITEM "Character &format", ID_EDIT_CHARFORMAT

View File

@ -36,7 +36,7 @@ BEGIN
POPUP "É&dition"
BEGIN
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 "&Couper\tCtrl+X", ID_EDIT_CUT
MENUITEM "Co&pier\tCtrl+C", ID_EDIT_COPY
@ -46,6 +46,7 @@ BEGIN
MENUITEM SEPARATOR
MENUITEM "&Find . . .\tCrtl+F", ID_FIND
MENUITEM "Find &next\tF3", ID_FIND_NEXT
MENUITEM "&Replace . . .\tCtrl+H", ID_REPLACE
MENUITEM SEPARATOR
MENUITEM "Lecture-&seule", ID_EDIT_READONLY
MENUITEM "&Modifié", ID_EDIT_MODIFIED

View File

@ -46,6 +46,7 @@ BEGIN
MENUITEM SEPARATOR
MENUITEM "&Find . . .\tCrtl+F", ID_FIND
MENUITEM "Find &next\tF3", ID_FIND_NEXT
MENUITEM "&Replace . . .\tCtrl+H", ID_REPLACE
MENUITEM SEPARATOR
MENUITEM "Csak &olvasható", ID_EDIT_READONLY
MENUITEM "Mó&dosítva", ID_EDIT_MODIFIED

View File

@ -37,7 +37,7 @@ BEGIN
POPUP "편집(&E)"
BEGIN
MENUITEM "되돌리기(&U)\tCtrl+Z", ID_EDIT_UNDO
MENUITEM "다시 실행(&R)\tCtrl+Y", ID_EDIT_REDO
MENUITEM "다시 실행(&E)\tCtrl+Y", ID_EDIT_REDO
MENUITEM SEPARATOR
MENUITEM "잘라내기(&T)\tCtrl+X", ID_EDIT_CUT
MENUITEM "복사(&C)\tCtrl+C", ID_EDIT_COPY
@ -47,11 +47,12 @@ BEGIN
MENUITEM SEPARATOR
MENUITEM "찾기(&F). . .\tCrtl+F", ID_FIND
MENUITEM "다음 찾기(&N)\tF3", ID_FIND_NEXT
MENUITEM "&Replace . . .\tCtrl+H", ID_REPLACE
MENUITEM SEPARATOR
MENUITEM "읽기 전용(&O)", ID_EDIT_READONLY
MENUITEM "수정 가능(&M)", ID_EDIT_MODIFIED
MENUITEM SEPARATOR
POPUP "기타(&E)"
POPUP "기타(&X)"
BEGIN
MENUITEM "선택 영역 정보(&I)", ID_EDIT_SELECTIONINFO
MENUITEM "문자 형식(&F)", ID_EDIT_CHARFORMAT

View File

@ -46,6 +46,7 @@ BEGIN
MENUITEM SEPARATOR
MENUITEM "&Find . . .\tCrtl+F", ID_FIND
MENUITEM "Find &next\tF3", ID_FIND_NEXT
MENUITEM "&Replace . . .\tCtrl+H", ID_REPLACE
MENUITEM SEPARATOR
MENUITEM "Alleen &lezen", ID_EDIT_READONLY
MENUITEM "&Gewijzigd", ID_EDIT_MODIFIED

View File

@ -46,8 +46,9 @@ BEGIN
MENUITEM SEPARATOR
MENUITEM "&Søk etter . . .\tCrtl+F", ID_FIND
MENUITEM "Søk etter &neste\tF3", ID_FIND_NEXT
MENUITEM "E&rstatt . . .\tCtrl+H", ID_REPLACE
MENUITEM SEPARATOR
MENUITEM "Sk&rivebeskyttet", ID_EDIT_READONLY
MENUITEM "S&krivebeskyttet", ID_EDIT_READONLY
MENUITEM "E&ndret", ID_EDIT_MODIFIED
MENUITEM SEPARATOR
POPUP "&Ekstra"

View File

@ -47,6 +47,7 @@ BEGIN
MENUITEM SEPARATOR
MENUITEM "&Find . . .\tCrtl+F", ID_FIND
MENUITEM "Find &next\tF3", ID_FIND_NEXT
MENUITEM "&Replace . . .\tCtrl+H", ID_REPLACE
MENUITEM SEPARATOR
MENUITEM "Tylko do &odczytu", ID_EDIT_READONLY
MENUITEM "&Zmodifykowany", ID_EDIT_MODIFIED

View File

@ -45,6 +45,7 @@ BEGIN
MENUITEM SEPARATOR
MENUITEM "&Find . . .\tCrtl+F", ID_FIND
MENUITEM "Find &next\tF3", ID_FIND_NEXT
MENUITEM "&Replace . . .\tCtrl+H", ID_REPLACE
MENUITEM SEPARATOR
MENUITEM "&Òîëüêî äëÿ ÷òåíèÿ", ID_EDIT_READONLY
MENUITEM "&Èçìåíåí", ID_EDIT_MODIFIED

View File

@ -49,6 +49,7 @@ BEGIN
MENUITEM SEPARATOR
MENUITEM "&Find . . .\tCrtl+F", ID_FIND
MENUITEM "Find &next\tF3", ID_FIND_NEXT
MENUITEM "&Replace . . .\tCtrl+H", ID_REPLACE
MENUITEM SEPARATOR
MENUITEM "Salt-&okunur", ID_EDIT_READONLY
MENUITEM "&Deðiþmiþ", ID_EDIT_MODIFIED

View File

@ -36,9 +36,10 @@
#define ID_FIND 1014
#define ID_FIND_NEXT 1015
#define ID_REPLACE 1016
#define ID_PREVIEW_NEXTPAGE 1016
#define ID_PREVIEW_PREVPAGE 1017
#define ID_PREVIEW_NEXTPAGE 1017
#define ID_PREVIEW_PREVPAGE 1018
#define ID_ALIGN_LEFT 1100
#define ID_ALIGN_CENTER 1101

View File

@ -31,6 +31,7 @@ BEGIN
"R", ID_ALIGN_RIGHT, VIRTKEY, CONTROL
"F", ID_FIND, VIRTKEY, CONTROL
VK_F3, ID_FIND_NEXT, VIRTKEY
"H", ID_REPLACE, VIRTKEY, CONTROL
"A", ID_EDIT_SELECTALL, VIRTKEY, CONTROL
"X", ID_EDIT_CUT, VIRTKEY, CONTROL
"C", ID_EDIT_COPY, VIRTKEY, CONTROL

View File

@ -1844,7 +1844,9 @@ static LRESULT handle_findmsg(LPFINDREPLACEW pFr)
hFindWnd = 0;
pFr->Flags = FR_FINDNEXT;
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;
FINDTEXTW ft;
@ -1918,13 +1920,19 @@ static LRESULT handle_findmsg(LPFINDREPLACEW pFr)
cr.cpMin = end;
SendMessageW(hEditorWnd, EM_SETSEL, (WPARAM)ret, (LPARAM)end);
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;
}
static void dialog_find(LPFINDREPLACEW fr)
static void dialog_find(LPFINDREPLACEW fr, BOOL replace)
{
static WCHAR findBuffer[MAX_STRING_LEN];
@ -1936,6 +1944,9 @@ static void dialog_find(LPFINDREPLACEW fr)
fr->lCustData = -1;
fr->wFindWhatLen = MAX_STRING_LEN*sizeof(WCHAR);
if(replace)
hFindWnd = ReplaceTextW(fr);
else
hFindWnd = FindTextW(fr);
}
@ -2716,13 +2727,17 @@ static LRESULT OnCommand( HWND hWnd, WPARAM wParam, LPARAM lParam)
break;
case ID_FIND:
dialog_find(&findreplace);
dialog_find(&findreplace, FALSE);
break;
case ID_FIND_NEXT:
handle_findmsg(&findreplace);
break;
case ID_REPLACE:
dialog_find(&findreplace, TRUE);
break;
case ID_FONTSETTINGS:
dialog_choose_font();
break;
@ -3048,6 +3063,9 @@ static LRESULT OnInitPopupMenu( HWND hWnd, WPARAM wParam, LPARAM lParam )
EnableMenuItem(hMenu, ID_FIND_NEXT, MF_BYCOMMAND|((textLength && mi.dwItemData) ?
MF_ENABLED : MF_GRAYED));
EnableMenuItem(hMenu, ID_REPLACE, MF_BYCOMMAND|(textLength ? MF_ENABLED : MF_GRAYED));
return 0;
}