Commit Graph

30 Commits

Author SHA1 Message Date
Dylan Smith 3264450c35 wordpad: Avoid forward declarations in print.c. 2010-02-22 12:08:28 +01:00
Dylan Smith 20dea9a890 wordpad: Don't waste time getting the number of preview pages.
For print preview it will take more time to wait for the whole text to be
wrapped for EM_FORMATRANGE than to wait for just the first page.  Trying to
get the total number of pages will cause the whole test to be wrapped.
Instead all that is needed is to just determine if a page is the last page,
which can be determined by it's page end offset compared to the text length.
2010-02-22 12:08:20 +01:00
Dylan Smith f235c48cae wordpad: Avoid unnecessary deletion of hdcSized. 2010-02-22 12:08:11 +01:00
Dylan Smith 8f19111325 wordpad: Cache text length. 2010-02-22 12:08:06 +01:00
Dylan Smith 7a9f72863d wordpad: Update bitmaps outside of WM_PAINT.
This avoids having to delete the device context and the bitmap selected
into it just to update the bitmap, since it was setting preview.hdc to
NULL to indicate that these bitmaps needed to be updated. This patch
also helps make WM_PAINT messages get processed faster by moving this out
of the code for handling WM_PAINT.
2010-02-22 12:07:59 +01:00
Dylan Smith a75bf390d7 wordpad: Use pages_shown variables to indicate pages shown.
Previously hdc2 needed to be deleted and set to NULL to indicate that only
one page should be shown. I have avoided this using a new variable for
the preview structure.

The device context were also being deleted without deleting the bitmaps
created for them and selected into them, so this patch also gets these
bitmaps and deletes them with their device context.
2010-02-22 12:07:49 +01:00
Dylan Smith b278101580 wordpad: Get preview page character boundaries with number of pages.
Rather than making seperate calls to EM_FORMATRANGE to get the number of
pages and the character boundaries, it would be easiest to get both
together.  The time to process EM_FORMATRANGE seems like it would take a
lot longer than the time needed to cache the character page boundaries.
2010-02-22 12:07:33 +01:00
Dylan Smith 7451facf2f wordpad: Added missing calls to DeleteDC and ReleaseDC. 2010-02-22 12:07:22 +01:00
Dylan Smith 003e7e9675 wordpad: Avoid making monochrome bitmaps for print preview.
Previewly monochrome bitmaps were being created by CreateCompatibleBitmap
because the hdc passed into that call came from CreateCompatibleDC which is
initialized with a single pixel monochrome bitmap.
2010-02-18 12:18:26 +01:00
Dylan Smith 7aba35c608 wordpad: Fixed quick print so that it doesn't print blank pages. 2010-02-10 11:35:01 +01:00
Dylan Smith 0c46da86bf 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.
2010-01-29 14:59:02 +01:00
Dylan Smith aaabd9f2f3 wordpad: Fixed spacing calculations for print preview. 2010-01-29 14:59:02 +01:00
Dylan Smith ad52ae67a5 wordpad: Don't render the text when getting the number of pages.
EM_FORMATRANGE will render the text if wParam is non-zero, and there
is no reason to actually render the text when just getting the number
of pages.
2010-01-27 18:46:06 +01:00
Dylan Smith fc473e0f63 wordpad: Reset rc.bottom between calls to EM_FORMATRANGE.
EM_FORMATRANGE will set rc.bottom within the FORMATRANGE struct to be the
bottom of the area actually printed to, so this must be reset between calls
to make sure that the page boundaries are consistent between the pages.
2010-01-27 18:46:06 +01:00
Alexandre Julliard 55f024afe1 wordpad: Use the main module instance instead of getting it from the window. 2009-12-28 14:20:37 +01:00
Dylan Smith 19c6edd497 wordpad: Use smaller cbSize for REBARBANDINFOW for compatibility.
The cbSize field for the REBARBANDINFOW structure was previously set to
the sizeof(REBARBANDINFOW), however, new fields were added to this
structure for newer version of windows.  Testing in Windows XP (or with
comctl32.dll from Windows XP) I found this larger size was rejected
causing the rebar to not be displayed in wordpad.
2009-08-17 13:57:50 +02:00
Michael Stefaniuc 645486e8c2 wordpad: Replace long with LONG. 2009-04-07 11:21:45 +02:00
Michael Stefaniuc 688bdb645f wordpad: Remove superfluous pointer casts. 2009-01-19 12:46:42 +01:00
Dylan Smith f124a586d4 wordpad: Added option to disable word wrap. 2008-10-14 13:41:55 +02:00
Andrey Turkin ef23ef9335 wordpad: Use inches instead of cm in calculations. 2008-10-13 11:55:24 +02:00
Andrey Turkin fbfb165d56 wordpad: Fix some compile-time warnings. 2008-10-10 14:13:07 +02:00
Gerald Pfeifer 412cd04cfc wordpad: Remove unused parameter for preview_command(). 2008-07-23 11:20:50 +02:00
Alexandre Julliard 2004d2b2f6 wordpad: Don't pass an invalid DC to CreateCompatibleDC. 2008-04-14 12:05:57 +02:00
Dmitry Timoshkov 2c8476a078 wordpad: Fix Win64 warnings. 2008-04-09 16:27:20 +02:00
Michael Stefaniuc 1bdd2ab628 wordpad: Remove bogus ';' after the if statement. 2008-03-27 17:47:53 +01:00
Alexander Nicolaysen Sørnes 1ea82f7cd4 wordpad: Add support for previewing two pages side-by-side. 2008-03-27 11:05:45 +01:00
Alexander Nicolaysen Sørnes 9a1b626481 wordpad: Add basic ruler. 2008-01-14 15:31:37 +01:00
Alexander Nicolaysen Sørnes e1e147da4d wordpad: Fix width when text break = margins. 2008-01-14 15:31:37 +01:00
Alexander Nicolaysen Sørnes fb5d0bfee1 wordpad: Draw margin lines in print preview. 2008-01-08 12:54:34 +01:00
Alexander Nicolaysen Sørnes a1378190a5 wordpad: Move printing functions to a separate file. 2007-11-20 14:58:03 +01:00