Author: dreimer
Date: Thu Mar 27 08:13:54 2008
New Revision: 32772
URL:
http://svn.reactos.org/svn/reactos?rev=32772&view=rev
Log:
Once more update WinHelp and wordpad. Seems like we have a problem with wordpad, even on
windows. Try open it and goto the options dialog and close it again. Then you will see.
Can someone investigate in it?
Modified:
trunk/reactos/base/applications/winhelp/lang/de-DE.rc
trunk/reactos/base/applications/winhelp/winhelp.rbuild
trunk/reactos/base/applications/wordpad/De.rc
trunk/reactos/base/applications/wordpad/En.rc
trunk/reactos/base/applications/wordpad/Fr.rc
trunk/reactos/base/applications/wordpad/Hu.rc
trunk/reactos/base/applications/wordpad/Ko.rc
trunk/reactos/base/applications/wordpad/Nl.rc
trunk/reactos/base/applications/wordpad/No.rc
trunk/reactos/base/applications/wordpad/Pl.rc
trunk/reactos/base/applications/wordpad/Ru.rc
trunk/reactos/base/applications/wordpad/Tr.rc
trunk/reactos/base/applications/wordpad/print.c
trunk/reactos/base/applications/wordpad/wordpad.c
trunk/reactos/base/applications/wordpad/wordpad.h
trunk/reactos/base/applications/wordpad/wordpad.rbuild
Modified: trunk/reactos/base/applications/winhelp/lang/de-DE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winhelp/…
==============================================================================
--- trunk/reactos/base/applications/winhelp/lang/de-DE.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/winhelp/lang/de-DE.rc [iso-8859-1] Thu Mar 27 08:13:54
2008
@@ -50,6 +50,16 @@
}
}
+IDD_INDEX DIALOG DISCARDABLE 0, 0, 200, 190 LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL
+STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
+FONT 8, "MS Shell Dlg"
+CAPTION "Index"
+{
+ LISTBOX IDC_INDEXLIST, 10, 10, 180, 150, LBS_NOINTEGRALHEIGHT | WS_VSCROLL |
WS_BORDER
+ PUSHBUTTON "&OK", IDOK, 40, 170, 50, 12
+ PUSHBUTTON "&Abbrechen", IDCANCEL, 120, 170, 50, 12
+}
+
/* Strings */
STRINGTABLE DISCARDABLE LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL
@@ -64,8 +74,8 @@
STID_SEARCH, "&Suchen"
STID_BACK, "&Zurück"
STID_HISTORY, "&Bisher"
-STID_TOPICS, "&Topics"
+STID_TOPICS, "&Themen"
STID_ALL_FILES, "Alle Dateien (*.*)"
STID_HELP_FILES_HLP, "Hilfe-Dateien (*.hlp)"
-STID_FILE_NOT_FOUND_s "Cannot find '%s'. Do you want to find this file
yourself?"
+STID_FILE_NOT_FOUND_s "'%s' konnte nicht gefunden werden. Wollen Sie selber
nach dieser Datei suchen?"
}
Modified: trunk/reactos/base/applications/winhelp/winhelp.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/winhelp/…
==============================================================================
--- trunk/reactos/base/applications/winhelp/winhelp.rbuild [iso-8859-1] (original)
+++ trunk/reactos/base/applications/winhelp/winhelp.rbuild [iso-8859-1] Thu Mar 27
08:13:54 2008
@@ -5,14 +5,11 @@
<define name="_WIN32_IE">0x0600</define>
<define name="_WIN32_WINNT">0x0501</define>
<library>wine</library>
- <library>kernel32</library>
+ <library>comdlg32</library>
+ <library>shell32</library>
<library>user32</library>
<library>gdi32</library>
- <library>ntdll</library>
- <library>comdlg32</library>
- <library>advapi32</library>
- <library>shell32</library>
- <library>comctl32</library>
+ <library>kernel32</library>
<file>callback.c</file>
<file>hlpfile.c</file>
<file>macro.c</file>
Modified: trunk/reactos/base/applications/wordpad/De.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
==============================================================================
--- trunk/reactos/base/applications/wordpad/De.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/wordpad/De.rc [iso-8859-1] Thu Mar 27 08:13:54 2008
@@ -213,6 +213,8 @@
STRING_PREVIEW_PRINT, "&Drucken"
STRING_PREVIEW_NEXTPAGE, "&Nächste"
STRING_PREVIEW_PREVPAGE, "&Vorherige"
+ STRING_PREVIEW_TWOPAGES, "Zwei Seiten"
+ STRING_PREVIEW_ONEPAGE, "Eine Seite"
STRING_PREVIEW_CLOSE, "&Schließen"
END
Modified: trunk/reactos/base/applications/wordpad/En.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
==============================================================================
--- trunk/reactos/base/applications/wordpad/En.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/wordpad/En.rc [iso-8859-1] Thu Mar 27 08:13:54 2008
@@ -213,6 +213,8 @@
STRING_PREVIEW_PRINT, "Print"
STRING_PREVIEW_NEXTPAGE, "Next page"
STRING_PREVIEW_PREVPAGE, "Previous page"
+ STRING_PREVIEW_TWOPAGES, "Two pages"
+ STRING_PREVIEW_ONEPAGE, "One page"
STRING_PREVIEW_CLOSE, "Close"
END
Modified: trunk/reactos/base/applications/wordpad/Fr.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
==============================================================================
--- trunk/reactos/base/applications/wordpad/Fr.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/wordpad/Fr.rc [iso-8859-1] Thu Mar 27 08:13:54 2008
@@ -213,6 +213,8 @@
STRING_PREVIEW_PRINT, "Imprimer"
STRING_PREVIEW_NEXTPAGE, "Page suivante"
STRING_PREVIEW_PREVPAGE, "Page précédente"
+ STRING_PREVIEW_TWOPAGES, "Two pages"
+ STRING_PREVIEW_ONEPAGE, "One page"
STRING_PREVIEW_CLOSE, "Fermer"
END
Modified: trunk/reactos/base/applications/wordpad/Hu.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
==============================================================================
--- trunk/reactos/base/applications/wordpad/Hu.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/wordpad/Hu.rc [iso-8859-1] Thu Mar 27 08:13:54 2008
@@ -213,6 +213,8 @@
STRING_PREVIEW_PRINT, "Print"
STRING_PREVIEW_NEXTPAGE, "Next page"
STRING_PREVIEW_PREVPAGE, "Previous page"
+ STRING_PREVIEW_TWOPAGES, "Two pages"
+ STRING_PREVIEW_ONEPAGE, "One page"
STRING_PREVIEW_CLOSE, "Close"
END
Modified: trunk/reactos/base/applications/wordpad/Ko.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
==============================================================================
--- trunk/reactos/base/applications/wordpad/Ko.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/wordpad/Ko.rc [iso-8859-1] Thu Mar 27 08:13:54 2008
@@ -208,6 +208,8 @@
STRING_PREVIEW_PRINT, "Àμâ"
STRING_PREVIEW_NEXTPAGE, "´ÙÀ½ ÆäÀÌÁö"
STRING_PREVIEW_PREVPAGE, "ÀÌÀü ÆäÀÌÁö"
+ STRING_PREVIEW_TWOPAGES, "Two pages"
+ STRING_PREVIEW_ONEPAGE, "One page"
STRING_PREVIEW_CLOSE, "´Ý±â"
END
Modified: trunk/reactos/base/applications/wordpad/Nl.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
==============================================================================
--- trunk/reactos/base/applications/wordpad/Nl.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/wordpad/Nl.rc [iso-8859-1] Thu Mar 27 08:13:54 2008
@@ -213,6 +213,8 @@
STRING_PREVIEW_PRINT, "Print"
STRING_PREVIEW_NEXTPAGE, "Next page"
STRING_PREVIEW_PREVPAGE, "Previous page"
+ STRING_PREVIEW_TWOPAGES, "Two pages"
+ STRING_PREVIEW_ONEPAGE, "One page"
STRING_PREVIEW_CLOSE, "Close"
END
Modified: trunk/reactos/base/applications/wordpad/No.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
==============================================================================
--- trunk/reactos/base/applications/wordpad/No.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/wordpad/No.rc [iso-8859-1] Thu Mar 27 08:13:54 2008
@@ -213,6 +213,8 @@
STRING_PREVIEW_PRINT, "Skriv ut"
STRING_PREVIEW_NEXTPAGE, "Neste side"
STRING_PREVIEW_PREVPAGE, "Forrige side"
+ STRING_PREVIEW_TWOPAGES, "To sider"
+ STRING_PREVIEW_ONEPAGE, "Én side"
STRING_PREVIEW_CLOSE, "Lukk"
END
Modified: trunk/reactos/base/applications/wordpad/Pl.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
==============================================================================
--- trunk/reactos/base/applications/wordpad/Pl.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/wordpad/Pl.rc [iso-8859-1] Thu Mar 27 08:13:54 2008
@@ -214,6 +214,8 @@
STRING_PREVIEW_PRINT, "Drukuj"
STRING_PREVIEW_NEXTPAGE, "Nast. strona"
STRING_PREVIEW_PREVPAGE, "Poprz. strona"
+ STRING_PREVIEW_TWOPAGES, "Two pages"
+ STRING_PREVIEW_ONEPAGE, "One page"
STRING_PREVIEW_CLOSE, "Zamknij"
END
Modified: trunk/reactos/base/applications/wordpad/Ru.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
==============================================================================
--- trunk/reactos/base/applications/wordpad/Ru.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/wordpad/Ru.rc [iso-8859-1] Thu Mar 27 08:13:54 2008
@@ -212,6 +212,8 @@
STRING_PREVIEW_PRINT, "Ïå÷àòü"
STRING_PREVIEW_NEXTPAGE, "Ñëåäóþùàÿ ñòðàíèöà"
STRING_PREVIEW_PREVPAGE, "Ïðåäûäóùàÿ ñòðàíèöà"
+ STRING_PREVIEW_TWOPAGES, "Two pages"
+ STRING_PREVIEW_ONEPAGE, "One page"
STRING_PREVIEW_CLOSE, "Çàêðûòü"
END
Modified: trunk/reactos/base/applications/wordpad/Tr.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
==============================================================================
--- trunk/reactos/base/applications/wordpad/Tr.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/wordpad/Tr.rc [iso-8859-1] Thu Mar 27 08:13:54 2008
@@ -216,6 +216,8 @@
STRING_PREVIEW_PRINT, "Print"
STRING_PREVIEW_NEXTPAGE, "Next page"
STRING_PREVIEW_PREVPAGE, "Previous page"
+ STRING_PREVIEW_TWOPAGES, "Two pages"
+ STRING_PREVIEW_ONEPAGE, "One page"
STRING_PREVIEW_CLOSE, "Close"
END
Modified: trunk/reactos/base/applications/wordpad/print.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
==============================================================================
--- trunk/reactos/base/applications/wordpad/print.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/wordpad/print.c [iso-8859-1] Thu Mar 27 08:13:54 2008
@@ -29,7 +29,9 @@
int page;
int pages;
HDC hdc;
+ HDC hdc2;
HDC hdcSized;
+ HDC hdcSized2;
RECT window;
LPWSTR wszFileName;
} previewinfo, *ppreviewinfo;
@@ -229,6 +231,7 @@
static int get_num_pages(HWND hEditorWnd, FORMATRANGE fr)
{
int page = 0;
+ fr.chrg.cpMin = 0;
do
{
@@ -245,11 +248,10 @@
{
int i;
- for(i = 1; i <= page; i++)
- {
- if(i == page)
- break;
-
+ fr->chrg.cpMin = 0;
+
+ for(i = 1; i < page; i++)
+ {
fr->chrg.cpMin = SendMessageW(hEditorWnd, EM_FORMATRANGE, TRUE, (LPARAM)fr);
}
}
@@ -431,7 +433,8 @@
AddTextButton(hReBar, STRING_PREVIEW_PRINT, ID_PRINT, BANDID_PREVIEW_BTN1);
AddTextButton(hReBar, STRING_PREVIEW_NEXTPAGE, ID_PREVIEW_NEXTPAGE,
BANDID_PREVIEW_BTN2);
AddTextButton(hReBar, STRING_PREVIEW_PREVPAGE, ID_PREVIEW_PREVPAGE,
BANDID_PREVIEW_BTN3);
- AddTextButton(hReBar, STRING_PREVIEW_CLOSE, ID_FILE_EXIT, BANDID_PREVIEW_BTN4);
+ AddTextButton(hReBar, STRING_PREVIEW_TWOPAGES, ID_PREVIEW_NUMPAGES,
BANDID_PREVIEW_BTN4);
+ AddTextButton(hReBar, STRING_PREVIEW_CLOSE, ID_FILE_EXIT, BANDID_PREVIEW_BTN5);
hStatic = CreateWindowW(WC_STATICW, NULL,
WS_VISIBLE | WS_CHILD, 0, 0, 0, 0,
@@ -458,6 +461,7 @@
{
preview.page = 1;
preview.hdc = 0;
+ preview.hdc2 = 0;
preview.wszFileName = wszFileName;
preview_bar_show(hMainWnd, TRUE);
}
@@ -616,17 +620,63 @@
return 0;
}
+void draw_preview_page(HDC hdc, HDC* hdcSized, FORMATRANGE* lpFr, float ratio, int
bmNewWidth, int bmNewHeight, int bmWidth, int bmHeight)
+{
+ HBITMAP hBitmapScaled = CreateCompatibleBitmap(hdc, bmNewWidth, bmNewHeight);
+ HPEN hPen;
+ int TopMargin = (int)((float)twips_to_pixels(lpFr->rc.top, GetDeviceCaps(hdc,
LOGPIXELSX)) * ratio);
+ int BottomMargin = (int)((float)twips_to_pixels(lpFr->rc.bottom,
GetDeviceCaps(hdc, LOGPIXELSX)) * ratio);
+ int LeftMargin = (int)((float)twips_to_pixels(lpFr->rc.left, GetDeviceCaps(hdc,
LOGPIXELSY)) * ratio);
+ int RightMargin = (int)((float)twips_to_pixels(lpFr->rc.right, GetDeviceCaps(hdc,
LOGPIXELSY)) * ratio);
+
+ if(*hdcSized);
+ DeleteDC(*hdcSized);
+ *hdcSized = CreateCompatibleDC(hdc);
+ SelectObject(*hdcSized, hBitmapScaled);
+
+ StretchBlt(*hdcSized, 0, 0, bmNewWidth, bmNewHeight, hdc, 0, 0, bmWidth, bmHeight,
SRCCOPY);
+
+ /* Draw margin lines */
+ hPen = CreatePen(PS_DOT, 1, RGB(0,0,0));
+ SelectObject(*hdcSized, hPen);
+
+ MoveToEx(*hdcSized, 0, TopMargin, NULL);
+ LineTo(*hdcSized, bmNewWidth, TopMargin);
+ MoveToEx(*hdcSized, 0, BottomMargin, NULL);
+ LineTo(*hdcSized, bmNewWidth, BottomMargin);
+
+ MoveToEx(*hdcSized, LeftMargin, 0, NULL);
+ LineTo(*hdcSized, LeftMargin, bmNewHeight);
+ MoveToEx(*hdcSized, RightMargin, 0, NULL);
+ LineTo(*hdcSized, RightMargin, bmNewHeight);
+
+}
+
+static void draw_preview(HWND hEditorWnd, FORMATRANGE* lpFr, int bmWidth, int bmHeight,
RECT* paper, int page)
+{
+ HBITMAP hBitmapCapture = CreateCompatibleBitmap(lpFr->hdc, bmWidth, bmHeight);
+
+ char_from_pagenum(hEditorWnd, lpFr, page);
+ SelectObject(lpFr->hdc, hBitmapCapture);
+ FillRect(lpFr->hdc, paper, GetStockObject(WHITE_BRUSH));
+ SendMessageW(hEditorWnd, EM_FORMATRANGE, TRUE, (LPARAM)lpFr);
+ /* EM_FORMATRANGE sets fr.rc to indicate the area printed in, but we want to
+ keep the original for drawing margins */
+ lpFr->rc = get_print_rect(lpFr->hdcTarget);
+ SendMessageW(hEditorWnd, EM_FORMATRANGE, FALSE, 0);
+}
+
LRESULT print_preview(HWND hMainWnd)
{
FORMATRANGE fr;
GETTEXTLENGTHEX gt;
HDC hdc;
RECT window, background;
- HBITMAP hBitmapCapture, hBitmapScaled;
int bmWidth, bmHeight, bmNewWidth, bmNewHeight;
float ratioWidth, ratioHeight, ratio;
int xOffset, yOffset;
int barheight;
+ float spacing = 20.0;
HWND hReBar = GetDlgItem(hMainWnd, IDC_REBAR);
PAINTSTRUCT ps;
@@ -643,14 +693,20 @@
bmWidth = twips_to_pixels(fr.rcPage.right, GetDeviceCaps(hdc, LOGPIXELSX));
bmHeight = twips_to_pixels(fr.rcPage.bottom, GetDeviceCaps(hdc, LOGPIXELSY));
- hBitmapCapture = CreateCompatibleBitmap(hdc, bmWidth, bmHeight);
-
if(!preview.hdc)
{
RECT paper;
HWND hEditorWnd = GetDlgItem(hMainWnd, IDC_EDITOR);
preview.hdc = CreateCompatibleDC(hdc);
+
+ if(preview.hdc2)
+ {
+ if((int)preview.hdc2 != -1)
+ DeleteDC(preview.hdc2);
+ preview.hdc2 = CreateCompatibleDC(hdc);
+ }
+
fr.hdc = preview.hdc;
gt.flags = GTL_DEFAULT;
gt.codepage = 1200;
@@ -665,21 +721,29 @@
if(!preview.pages)
preview.pages = get_num_pages(hEditorWnd, fr);
- SelectObject(preview.hdc, hBitmapCapture);
-
- char_from_pagenum(hEditorWnd, &fr, preview.page);
-
- FillRect(preview.hdc, &paper, GetStockObject(WHITE_BRUSH));
- SendMessageW(hEditorWnd, EM_FORMATRANGE, TRUE, (LPARAM)&fr);
- SendMessageW(hEditorWnd, EM_FORMATRANGE, FALSE, 0);
+ fr.hdc = preview.hdc;
+ draw_preview(hEditorWnd, &fr, bmWidth, bmHeight, &paper, preview.page);
+
+ if(preview.hdc2)
+ {
+ fr.hdc = preview.hdc2;
+ draw_preview(hEditorWnd, &fr, bmWidth, bmHeight, &paper, preview.page
+ 1);
+ }
EnableWindow(GetDlgItem(hReBar, ID_PREVIEW_PREVPAGE), preview.page > 1);
- EnableWindow(GetDlgItem(hReBar, ID_PREVIEW_NEXTPAGE), preview.page <
preview.pages);
+ EnableWindow(GetDlgItem(hReBar, ID_PREVIEW_NEXTPAGE), preview.hdc2 ?
+ (preview.page + 1) <
preview.pages :
+ preview.page <
preview.pages);
+ EnableWindow(GetDlgItem(hReBar, ID_PREVIEW_NUMPAGES), preview.pages > 1);
}
barheight = SendMessageW(hReBar, RB_GETBARHEIGHT, 0, 0);
- ratioWidth = ((float)window.right - 20.0) / (float)bmHeight;
- ratioHeight = ((float)window.bottom - 20.0 - (float)barheight) / (float)bmHeight;
+ ratioHeight = ((float)window.bottom - spacing - (float)barheight) / (float)bmHeight;
+
+ if(preview.hdc2)
+ ratioWidth = ((float)window.right / 2.0 - spacing * 2.0) / (float)bmWidth;
+ else
+ ratioWidth = ((float)window.right - spacing * 3.0) / (float)bmWidth;
if(ratioWidth > ratioHeight)
ratio = ratioHeight;
@@ -688,44 +752,16 @@
bmNewWidth = (int)((float)bmWidth * ratio);
bmNewHeight = (int)((float)bmHeight * ratio);
- hBitmapScaled = CreateCompatibleBitmap(hdc, bmNewWidth, bmNewHeight);
-
- xOffset = ((window.right - bmNewWidth) / 2);
+
yOffset = ((window.bottom - bmNewHeight + barheight) / 2);
- if(window.right != preview.window.right || window.bottom != preview.window.bottom)
- {
- HPEN hPen;
- int TopMargin = (int)((float)twips_to_pixels(fr.rc.top, GetDeviceCaps(hdc,
LOGPIXELSX)) * ratio);
- int BottomMargin = (int)((float)twips_to_pixels(fr.rc.bottom, GetDeviceCaps(hdc,
LOGPIXELSX)) * ratio);
- int LeftMargin = (int)((float)twips_to_pixels(fr.rc.left, GetDeviceCaps(hdc,
LOGPIXELSY)) * ratio);
- int RightMargin = (int)((float)twips_to_pixels(fr.rc.right, GetDeviceCaps(hdc,
LOGPIXELSY)) * ratio);
-
- DeleteDC(preview.hdcSized);
- preview.hdcSized = CreateCompatibleDC(hdc);
- SelectObject(preview.hdcSized, hBitmapScaled);
-
- StretchBlt(preview.hdcSized, 0, 0, bmNewWidth, bmNewHeight, preview.hdc, 0, 0,
bmWidth, bmHeight, SRCCOPY);
-
- /* Draw margin lines */
- hPen = CreatePen(PS_DOT, 1, RGB(0,0,0));
- SelectObject(preview.hdcSized, hPen);
-
- MoveToEx(preview.hdcSized, 0, TopMargin, NULL);
- LineTo(preview.hdcSized, bmNewWidth, TopMargin);
- MoveToEx(preview.hdcSized, 0, BottomMargin, NULL);
- LineTo(preview.hdcSized, bmNewWidth, BottomMargin);
-
- MoveToEx(preview.hdcSized, LeftMargin, 0, NULL);
- LineTo(preview.hdcSized, LeftMargin, bmNewHeight);
- MoveToEx(preview.hdcSized, RightMargin, 0, NULL);
- LineTo(preview.hdcSized, RightMargin, bmNewHeight);
- }
+ if(!preview.hdc2)
+ xOffset = (window.right - bmNewWidth) / 2;
+ else
+ xOffset = (window.right - bmNewWidth * 2) / 2;
window.top = barheight;
FillRect(hdc, &window, GetStockObject(GRAY_BRUSH));
-
- SelectObject(hdc, hBitmapScaled);
background.left = xOffset - 2;
background.right = xOffset + bmNewWidth + 2;
@@ -734,7 +770,27 @@
FillRect(hdc, &background, GetStockObject(BLACK_BRUSH));
+ if(window.right != preview.window.right || window.bottom != preview.window.bottom)
+ {
+ draw_preview_page(preview.hdc, &preview.hdcSized, &fr, ratio, bmNewWidth,
bmNewHeight, bmWidth, bmHeight);
+
+ if(preview.hdc2)
+ {
+ background.left += bmNewWidth + spacing;
+ background.right += bmNewWidth + spacing;
+
+ FillRect(hdc, &background, GetStockObject(BLACK_BRUSH));
+
+ draw_preview_page(preview.hdc2, &preview.hdcSized2, &fr, ratio,
bmNewWidth, bmNewHeight, bmWidth, bmHeight);
+ }
+ }
+
BitBlt(hdc, xOffset, yOffset, bmNewWidth, bmNewHeight, preview.hdcSized, 0, 0,
SRCCOPY);
+
+ if(preview.hdc2)
+ {
+ BitBlt(hdc, xOffset + bmNewWidth + spacing, yOffset, bmNewWidth, bmNewHeight,
preview.hdcSized2, 0, 0, SRCCOPY);
+ }
DeleteDC(fr.hdcTarget);
preview.window = window;
@@ -742,6 +798,20 @@
EndPaint(hMainWnd, &ps);
return 0;
+}
+
+void update_preview(HWND hWnd)
+{
+ RECT rc;
+
+ DeleteDC(preview.hdc);
+ preview.hdc = 0;
+
+ preview.window.right = 0;
+
+ GetClientRect(hWnd, &rc);
+ rc.top += SendMessageW(GetDlgItem(hWnd, IDC_REBAR), RB_GETBARHEIGHT, 0, 0);
+ InvalidateRect(hWnd, &rc, TRUE);
}
LRESULT preview_command(HWND hWnd, WPARAM wParam, LPARAM lParam)
@@ -755,20 +825,37 @@
case ID_PREVIEW_NEXTPAGE:
case ID_PREVIEW_PREVPAGE:
{
- HWND hReBar = GetDlgItem(hWnd, IDC_REBAR);
- RECT rc;
-
if(LOWORD(wParam) == ID_PREVIEW_NEXTPAGE)
preview.page++;
else
preview.page--;
- preview.hdc = 0;
- preview.window.right = 0;
-
- GetClientRect(hWnd, &rc);
- rc.top += SendMessageW(hReBar, RB_GETBARHEIGHT, 0, 0);
- InvalidateRect(hWnd, &rc, TRUE);
+ update_preview(hWnd);
+ }
+ break;
+
+ case ID_PREVIEW_NUMPAGES:
+ {
+ HWND hReBar = GetDlgItem(hWnd, IDC_REBAR);
+ WCHAR name[MAX_STRING_LEN];
+ HINSTANCE hInst = (HINSTANCE)GetWindowLongPtrW(hWnd, GWLP_HINSTANCE);
+
+ if(preview.hdc2)
+ {
+ DeleteDC(preview.hdc2);
+ preview.hdc2 = 0;
+ } else
+ {
+ if(preview.page == preview.pages)
+ preview.page--;
+ preview.hdc2 = (HDC)-1;
+ }
+
+ LoadStringW(hInst, preview.hdc2 ? STRING_PREVIEW_ONEPAGE :
STRING_PREVIEW_TWOPAGES,
+ name, MAX_STRING_LEN);
+
+ SetWindowTextW(GetDlgItem(hReBar, ID_PREVIEW_NUMPAGES), name);
+ update_preview(hWnd);
}
break;
Modified: trunk/reactos/base/applications/wordpad/wordpad.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
==============================================================================
--- trunk/reactos/base/applications/wordpad/wordpad.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/wordpad/wordpad.c [iso-8859-1] Thu Mar 27 08:13:54
2008
@@ -20,7 +20,7 @@
*/
#define WIN32_LEAN_AND_MEAN
-//#define _WIN32_IE 0x0400
+#define _WIN32_IE 0x0400
#include <stdarg.h>
#include <stdlib.h>
Modified: trunk/reactos/base/applications/wordpad/wordpad.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
==============================================================================
--- trunk/reactos/base/applications/wordpad/wordpad.h [iso-8859-1] (original)
+++ trunk/reactos/base/applications/wordpad/wordpad.h [iso-8859-1] Thu Mar 27 08:13:54
2008
@@ -44,6 +44,7 @@
#define ID_PREVIEW_NEXTPAGE 1017
#define ID_PREVIEW_PREVPAGE 1018
+#define ID_PREVIEW_NUMPAGES 1019
#define ID_ALIGN_LEFT 1100
#define ID_ALIGN_CENTER 1101
@@ -79,7 +80,7 @@
#define ID_TOGGLE_STATUSBAR 1502
#define ID_TOGGLE_RULER 1503
-#define PREVIEW_BUTTONS 4
+#define PREVIEW_BUTTONS 5
#define FILELIST_ENTRIES 4
#define FILELIST_ENTRY_LENGTH 33
@@ -95,7 +96,8 @@
#define BANDID_PREVIEW_BTN2 7
#define BANDID_PREVIEW_BTN3 8
#define BANDID_PREVIEW_BTN4 9
-#define BANDID_PREVIEW_BUFFER 10
+#define BANDID_PREVIEW_BTN5 10
+#define BANDID_PREVIEW_BUFFER 11
#define ID_WORDWRAP_NONE 0
#define ID_WORDWRAP_WINDOW 1
@@ -178,9 +180,11 @@
#define STRING_PREVIEW_PRINT 1414
#define STRING_PREVIEW_NEXTPAGE 1415
#define STRING_PREVIEW_PREVPAGE 1416
-#define STRING_PREVIEW_CLOSE 1417
-
-#define STRING_UNITS_CM 1418
+#define STRING_PREVIEW_TWOPAGES 1417
+#define STRING_PREVIEW_ONEPAGE 1418
+#define STRING_PREVIEW_CLOSE 1419
+
+#define STRING_UNITS_CM 1420
#define STRING_DEFAULT_FILENAME 1700
#define STRING_PROMPT_SAVE_CHANGES 1701
Modified: trunk/reactos/base/applications/wordpad/wordpad.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/wordpad/…
==============================================================================
--- trunk/reactos/base/applications/wordpad/wordpad.rbuild [iso-8859-1] (original)
+++ trunk/reactos/base/applications/wordpad/wordpad.rbuild [iso-8859-1] Thu Mar 27
08:13:54 2008
@@ -4,12 +4,13 @@
<include base="wordpad">.</include>
<define name="_WIN32_IE">0x0600</define>
<define name="_WIN32_WINNT">0x0501</define>
- <library>kernel32</library>
+ <library>comdlg32</library>
+ <library>shell32</library>
<library>user32</library>
<library>gdi32</library>
- <library>comdlg32</library>
+ <library>msvcrt</library>
<library>advapi32</library>
- <library>shell32</library>
+ <library>kernel32</library>
<library>comctl32</library>
<compilationunit name="unit.c">
<file>print.c</file>