Commit 0c46da86 authored by Dylan Smith's avatar Dylan Smith Committed by Alexandre Julliard

wordpad: Implement zooming in for print preview.

The preview is now drawn onto it's own window rather directly onto the client area of the top level window. This is done to allow for scrollbars, since the page won't usually fit in the window when zoomed in. Refactoring was needed as a result of this, and in order to provide more granularity for updates to avoid EM_FORMATRANGE messages being sent when the page the same page is being displayed.
parent aaabd9f2
......@@ -218,6 +218,8 @@ BEGIN
STRING_PREVIEW_PREVPAGE, "Forrige side"
STRING_PREVIEW_TWOPAGES, "To sider"
STRING_PREVIEW_ONEPAGE, "n side"
STRING_PREVIEW_ZOOMIN, "Zoom in"
STRING_PREVIEW_ZOOMOUT, "Zoom out"
STRING_PREVIEW_CLOSE, "Luk"
END
......
......@@ -220,6 +220,8 @@ BEGIN
STRING_PREVIEW_PREVPAGE, "&Vorherige"
STRING_PREVIEW_TWOPAGES, "Zwei Seiten"
STRING_PREVIEW_ONEPAGE, "Eine Seite"
STRING_PREVIEW_ZOOMIN, "Zoom in"
STRING_PREVIEW_ZOOMOUT, "Zoom out"
STRING_PREVIEW_CLOSE, "&Schließen"
END
......
......@@ -210,6 +210,8 @@ BEGIN
STRING_PREVIEW_PREVPAGE, "Previous page"
STRING_PREVIEW_TWOPAGES, "Two pages"
STRING_PREVIEW_ONEPAGE, "One page"
STRING_PREVIEW_ZOOMIN, "Zoom in"
STRING_PREVIEW_ZOOMOUT, "Zoom out"
STRING_PREVIEW_CLOSE, "Close"
STRING_UNITS_CM, "cm"
END
......
......@@ -221,6 +221,8 @@ BEGIN
STRING_PREVIEW_PREVPAGE, "Page précédente"
STRING_PREVIEW_TWOPAGES, "Deux pages"
STRING_PREVIEW_ONEPAGE, "Une page"
STRING_PREVIEW_ZOOMIN, "Zoom in"
STRING_PREVIEW_ZOOMOUT, "Zoom out"
STRING_PREVIEW_CLOSE, "Fermer"
END
......
......@@ -218,6 +218,8 @@ BEGIN
STRING_PREVIEW_PREVPAGE, "Previous page"
STRING_PREVIEW_TWOPAGES, "Two pages"
STRING_PREVIEW_ONEPAGE, "One page"
STRING_PREVIEW_ZOOMIN, "Zoom in"
STRING_PREVIEW_ZOOMOUT, "Zoom out"
STRING_PREVIEW_CLOSE, "Close"
END
......
......@@ -221,6 +221,8 @@ BEGIN
STRING_PREVIEW_PREVPAGE, "前のページ"
STRING_PREVIEW_TWOPAGES, "2ページ"
STRING_PREVIEW_ONEPAGE, "1ページ"
STRING_PREVIEW_ZOOMIN, "Zoom in"
STRING_PREVIEW_ZOOMOUT, "Zoom out"
STRING_PREVIEW_CLOSE, "閉じる"
END
......
......@@ -212,6 +212,8 @@ BEGIN
STRING_PREVIEW_PREVPAGE, "이전 페이지"
STRING_PREVIEW_TWOPAGES, "두 페이지"
STRING_PREVIEW_ONEPAGE, "한 페이지"
STRING_PREVIEW_ZOOMIN, "Zoom in"
STRING_PREVIEW_ZOOMOUT, "Zoom out"
STRING_PREVIEW_CLOSE, "닫기"
STRING_UNITS_CM, "cm"
END
......
......@@ -221,6 +221,8 @@ BEGIN
STRING_PREVIEW_PREVPAGE, "Ankstesnis puslapis"
STRING_PREVIEW_TWOPAGES, "Du puslapiai"
STRING_PREVIEW_ONEPAGE, "Vienas puslapis"
STRING_PREVIEW_ZOOMIN, "Zoom in"
STRING_PREVIEW_ZOOMOUT, "Zoom out"
STRING_PREVIEW_CLOSE, "Užverti"
END
......
......@@ -211,6 +211,8 @@ BEGIN
STRING_PREVIEW_PREVPAGE, "Vorige pagina"
STRING_PREVIEW_TWOPAGES, "Twee pagina's"
STRING_PREVIEW_ONEPAGE, "Een pagina"
STRING_PREVIEW_ZOOMIN, "Zoom in"
STRING_PREVIEW_ZOOMOUT, "Zoom out"
STRING_PREVIEW_CLOSE, "Sluiten"
END
......
......@@ -220,6 +220,8 @@ BEGIN
STRING_PREVIEW_PREVPAGE, "Forrige side"
STRING_PREVIEW_TWOPAGES, "To sider"
STRING_PREVIEW_ONEPAGE, "Én side"
STRING_PREVIEW_ZOOMIN, "Zoom in"
STRING_PREVIEW_ZOOMOUT, "Zoom out"
STRING_PREVIEW_CLOSE, "Lukk"
END
......
......@@ -219,6 +219,8 @@ BEGIN
STRING_PREVIEW_PREVPAGE, "Poprz. strona"
STRING_PREVIEW_TWOPAGES, "Two pages"
STRING_PREVIEW_ONEPAGE, "One page"
STRING_PREVIEW_ZOOMIN, "Zoom in"
STRING_PREVIEW_ZOOMOUT, "Zoom out"
STRING_PREVIEW_CLOSE, "Zamknij"
END
......
......@@ -222,6 +222,8 @@ BEGIN
STRING_PREVIEW_PREVPAGE, "Página anterior"
STRING_PREVIEW_TWOPAGES, "Duas páginas"
STRING_PREVIEW_ONEPAGE, "Uma página"
STRING_PREVIEW_ZOOMIN, "Zoom in"
STRING_PREVIEW_ZOOMOUT, "Zoom out"
STRING_PREVIEW_CLOSE, "Fechar"
END
......
......@@ -221,6 +221,8 @@ BEGIN
STRING_PREVIEW_PREVPAGE, "Предыдущая страница"
STRING_PREVIEW_TWOPAGES, "Две страницы"
STRING_PREVIEW_ONEPAGE, "Одна страница"
STRING_PREVIEW_ZOOMIN, "Zoom in"
STRING_PREVIEW_ZOOMOUT, "Zoom out"
STRING_PREVIEW_CLOSE, "Закрыть"
END
......
......@@ -220,6 +220,8 @@ BEGIN
STRING_PREVIEW_PREVPAGE, "Prejšnja"
STRING_PREVIEW_TWOPAGES, "Dve strani"
STRING_PREVIEW_ONEPAGE, "Ena stran"
STRING_PREVIEW_ZOOMIN, "Zoom in"
STRING_PREVIEW_ZOOMOUT, "Zoom out"
STRING_PREVIEW_CLOSE, "Zapri"
END
......
......@@ -220,6 +220,8 @@ BEGIN
STRING_PREVIEW_PREVPAGE, "Föregående sida"
STRING_PREVIEW_TWOPAGES, "Två sidor"
STRING_PREVIEW_ONEPAGE, "En sida"
STRING_PREVIEW_ZOOMIN, "Zoom in"
STRING_PREVIEW_ZOOMOUT, "Zoom out"
STRING_PREVIEW_CLOSE, "Stäng"
END
......
......@@ -220,6 +220,8 @@ BEGIN
STRING_PREVIEW_PREVPAGE, "Previous page"
STRING_PREVIEW_TWOPAGES, "Two pages"
STRING_PREVIEW_ONEPAGE, "One page"
STRING_PREVIEW_ZOOMIN, "Zoom in"
STRING_PREVIEW_ZOOMOUT, "Zoom out"
STRING_PREVIEW_CLOSE, "Close"
END
......
......@@ -223,6 +223,8 @@ BEGIN
STRING_PREVIEW_PREVPAGE, "上一页"
STRING_PREVIEW_TWOPAGES, "双页"
STRING_PREVIEW_ONEPAGE, "单页"
STRING_PREVIEW_ZOOMIN, "Zoom in"
STRING_PREVIEW_ZOOMOUT, "Zoom out"
STRING_PREVIEW_CLOSE, "关闭"
END
......
......@@ -56,6 +56,9 @@ static const WCHAR wszMainWndClass[] = {'W','O','R','D','P','A','D','T','O','P',
static const WCHAR stringFormat[] = {'%','2','d','\0'};
const WCHAR wszPreviewWndClass[] = {'P','r','t','P','r','e','v','i','e','w',0};
LRESULT CALLBACK preview_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
static HWND hMainWnd;
static HWND hEditorWnd;
static HWND hFindWnd;
......@@ -2447,7 +2450,7 @@ static LRESULT OnSize( HWND hWnd, WPARAM wParam, LPARAM lParam )
{
int nStatusSize = 0;
RECT rc;
HWND hwndEditor = GetDlgItem(hWnd, IDC_EDITOR);
HWND hwndEditor = preview_isactive() ? GetDlgItem(hWnd, IDC_PREVIEW) : GetDlgItem(hWnd, IDC_EDITOR);
HWND hwndStatusBar = GetDlgItem(hWnd, IDC_STATUSBAR);
HWND hwndReBar = GetDlgItem(hWnd, IDC_REBAR);
HWND hRulerWnd = GetDlgItem(hWnd, IDC_RULER);
......@@ -2550,9 +2553,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
}
break;
case WM_PAINT:
if(preview_isactive())
return print_preview(hWnd);
else
if(!preview_isactive())
return DefWindowProcW(hWnd, msg, wParam, lParam);
default:
......@@ -2592,6 +2593,18 @@ int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hOldInstance, LPSTR szCmdPar
wc.lpszClassName = wszMainWndClass;
RegisterClassW(&wc);
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = preview_proc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = NULL;
wc.hCursor = LoadCursor(NULL, IDC_IBEAM);
wc.hbrBackground = GetSysColorBrush(COLOR_WINDOW);
wc.lpszMenuName = NULL;
wc.lpszClassName = wszPreviewWndClass;
RegisterClassW(&wc);
registry_read_winrect(&rc);
hMainWnd = CreateWindowExW(0, wszMainWndClass, wszAppTitle, WS_CLIPCHILDREN|WS_OVERLAPPEDWINDOW,
rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, NULL, NULL, hInstance, NULL);
......
......@@ -49,6 +49,8 @@
#define ID_PREVIEW_NEXTPAGE 1017
#define ID_PREVIEW_PREVPAGE 1018
#define ID_PREVIEW_NUMPAGES 1019
#define ID_PREVIEW_ZOOMIN 1020
#define ID_PREVIEW_ZOOMOUT 1021
#define ID_ALIGN_LEFT 1100
#define ID_ALIGN_CENTER 1101
......@@ -84,7 +86,7 @@
#define ID_TOGGLE_STATUSBAR 1502
#define ID_TOGGLE_RULER 1503
#define PREVIEW_BUTTONS 5
#define PREVIEW_BUTTONS 7
#define FILELIST_ENTRIES 4
#define FILELIST_ENTRY_LENGTH 33
......@@ -101,7 +103,9 @@
#define BANDID_PREVIEW_BTN3 8
#define BANDID_PREVIEW_BTN4 9
#define BANDID_PREVIEW_BTN5 10
#define BANDID_PREVIEW_BUFFER 11
#define BANDID_PREVIEW_BTN6 11
#define BANDID_PREVIEW_BTN7 12
#define BANDID_PREVIEW_BUFFER 13
#define ID_WORDWRAP_NONE 0
#define ID_WORDWRAP_WINDOW 1
......@@ -145,6 +149,7 @@
#define IDC_FONTLIST 2013
#define IDC_SIZELIST 2014
#define IDC_RULER 2015
#define IDC_PREVIEW 2016
#define IDD_DATETIME 2100
#define IDD_NEWFILE 2101
......@@ -187,9 +192,11 @@
#define STRING_PREVIEW_PREVPAGE 1450
#define STRING_PREVIEW_TWOPAGES 1451
#define STRING_PREVIEW_ONEPAGE 1452
#define STRING_PREVIEW_CLOSE 1453
#define STRING_PREVIEW_ZOOMIN 1453
#define STRING_PREVIEW_ZOOMOUT 1454
#define STRING_PREVIEW_CLOSE 1455
#define STRING_UNITS_CM 1454
#define STRING_UNITS_CM 1456
#define STRING_DEFAULT_FILENAME 1700
#define STRING_PROMPT_SAVE_CHANGES 1701
......
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