diff --git a/programs/wordpad/De.rc b/programs/wordpad/De.rc index 809864ed336..1b333fd4f4d 100644 --- a/programs/wordpad/De.rc +++ b/programs/wordpad/De.rc @@ -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 diff --git a/programs/wordpad/En.rc b/programs/wordpad/En.rc index 3c06dda0ec6..e0724fb7fcf 100644 --- a/programs/wordpad/En.rc +++ b/programs/wordpad/En.rc @@ -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 diff --git a/programs/wordpad/Fr.rc b/programs/wordpad/Fr.rc index bde211d7649..dcf80ecfeea 100644 --- a/programs/wordpad/Fr.rc +++ b/programs/wordpad/Fr.rc @@ -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 diff --git a/programs/wordpad/Hu.rc b/programs/wordpad/Hu.rc index 2840495971d..feca301d8c9 100644 --- a/programs/wordpad/Hu.rc +++ b/programs/wordpad/Hu.rc @@ -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 diff --git a/programs/wordpad/Ko.rc b/programs/wordpad/Ko.rc index fac4733f7d3..571dbfbb124 100644 --- a/programs/wordpad/Ko.rc +++ b/programs/wordpad/Ko.rc @@ -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 diff --git a/programs/wordpad/Nl.rc b/programs/wordpad/Nl.rc index 73dc641621a..d6c5346b11b 100644 --- a/programs/wordpad/Nl.rc +++ b/programs/wordpad/Nl.rc @@ -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 diff --git a/programs/wordpad/No.rc b/programs/wordpad/No.rc index 3bf663d2852..3bebdf9e7b0 100644 --- a/programs/wordpad/No.rc +++ b/programs/wordpad/No.rc @@ -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" diff --git a/programs/wordpad/Pl.rc b/programs/wordpad/Pl.rc index f212fc32c7b..3b05326748b 100644 --- a/programs/wordpad/Pl.rc +++ b/programs/wordpad/Pl.rc @@ -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 diff --git a/programs/wordpad/Ru.rc b/programs/wordpad/Ru.rc index daceaf8880f..17828cc3900 100644 --- a/programs/wordpad/Ru.rc +++ b/programs/wordpad/Ru.rc @@ -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 diff --git a/programs/wordpad/Tr.rc b/programs/wordpad/Tr.rc index b748666dd9c..65cb31f9b2e 100644 --- a/programs/wordpad/Tr.rc +++ b/programs/wordpad/Tr.rc @@ -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 diff --git a/programs/wordpad/resource.h b/programs/wordpad/resource.h index 615c30c3109..b08ec853726 100644 --- a/programs/wordpad/resource.h +++ b/programs/wordpad/resource.h @@ -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 diff --git a/programs/wordpad/rsrc.rc b/programs/wordpad/rsrc.rc index 92bad345f36..142bd06c90a 100644 --- a/programs/wordpad/rsrc.rc +++ b/programs/wordpad/rsrc.rc @@ -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 diff --git a/programs/wordpad/wordpad.c b/programs/wordpad/wordpad.c index 20052bbb8f6..968f8d531c5 100644 --- a/programs/wordpad/wordpad.c +++ b/programs/wordpad/wordpad.c @@ -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; }