Commit 48aba990 authored by Alexander Nicolaysen Sørnes's avatar Alexander Nicolaysen Sørnes Committed by Alexandre Julliard

wordpad: Add replace dialog.

parent 917fc5fd
......@@ -35,7 +35,7 @@ BEGIN
END
POPUP "&Bearbeiten"
BEGIN
MENUITEM "&Rckgngig\tCtrl+Z", ID_EDIT_UNDO
MENUITEM "R&ckgngig\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 "&Gendert", ID_EDIT_MODIFIED
......
......@@ -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
......
......@@ -36,7 +36,7 @@ BEGIN
POPUP "&dition"
BEGIN
MENUITEM "&Annuler\tCtrl+Z", ID_EDIT_UNDO
MENUITEM "&Rpter\tCtrl+Y", ID_EDIT_REDO
MENUITEM "R&pter\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
......
......@@ -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&dostva", ID_EDIT_MODIFIED
......
......@@ -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
......
......@@ -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
......
......@@ -46,8 +46,9 @@ BEGIN
MENUITEM SEPARATOR
MENUITEM "&Sk etter . . .\tCrtl+F", ID_FIND
MENUITEM "Sk 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"
......
......@@ -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
......
......@@ -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
......
......@@ -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 "&Deimi", ID_EDIT_MODIFIED
......
......@@ -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
......
......@@ -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
......
......@@ -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,7 +1944,10 @@ static void dialog_find(LPFINDREPLACEW fr)
fr->lCustData = -1;
fr->wFindWhatLen = MAX_STRING_LEN*sizeof(WCHAR);
hFindWnd = FindTextW(fr);
if(replace)
hFindWnd = ReplaceTextW(fr);
else
hFindWnd = FindTextW(fr);
}
static void registry_read_options(void)
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment