Click here to Skip to main content
15,892,298 members
Articles / Desktop Programming / MFC

MultiPage PrintPreview Enhancements for MFC Doc/View Applications

Rate me:
Please Sign up or sign in to vote.
4.73/5 (13 votes)
27 Apr 2002CPOL3 min read 166.1K   5.2K   34  
How to improve the standard MFC print preview options to allow preview from 1 to 9 pages at a time
IDR_MAINFRAME           BITMAP  MOVEABLE PURE   "res\\Toolbar.bmp"
IDB_PREV_END            BITMAP  DISCARDABLE     "RES\\PrevEnd.BMP"
IDB_PREV_HOME           BITMAP  DISCARDABLE     "RES\\PreviewHome.BMP"
IDB_PREV_NEXT           BITMAP  DISCARDABLE     "RES\\PreviewNext.BMP"
IDB_PREV_PREVIOUS       BITMAP  DISCARDABLE     "RES\\PrevPrevious.BMP"
IDB_PREV_PRINT          BITMAP  DISCARDABLE     "RES\\PrevPrint.BMP"
IDB_PREV_ZOOMIN         BITMAP  DISCARDABLE     "res\\PrevZoomin.bmp"
IDB_PREV_ZOOMOUT        BITMAP  DISCARDABLE     "RES\\PrevZoomout.BMP"

IDR_PREVIEW_PAGES MENU DISCARDABLE 
BEGIN
    POPUP "PAGES"
    BEGIN
        MENUITEM "1 Page",                      ID_PAGES_1PAGE
        MENUITEM "2 pages",                     ID_PAGES_2PAGES
        MENUITEM "3 Pages",                     ID_PAGES_3PAGES
        MENUITEM "4 pages",                     ID_PAGES_4PAGES
        MENUITEM "6 pages",                     ID_PAGES_6PAGES
        MENUITEM "9 pages",                     ID_PAGES_9PAGES
    END
END

IDD_PREVIEW DIALOGEX 0, 0, 319, 19
STYLE WS_CHILD
FONT 8, "MS Sans Serif"
BEGIN
    CONTROL         "",AFX_ID_PREVIEW_PRINT,"Button",BS_OWNERDRAW | 
                    WS_TABSTOP,4,3,15,13
    CONTROL         "",AFX_ID_PREVIEW_NEXT,"Button",BS_OWNERDRAW | 
                    WS_TABSTOP,23,3,15,13
    CONTROL         "",AFX_ID_PREVIEW_PREV,"Button",BS_OWNERDRAW | 
                    WS_TABSTOP,42,3,15,13
    CONTROL         "#",ID_PREVIEW_PAGES,"Button",BS_OWNERDRAW | WS_TABSTOP,
                    61,3,15,13
    CONTROL         "",AFX_ID_PREVIEW_ZOOMIN,"Button",BS_OWNERDRAW | 
                    WS_TABSTOP,113,3,15,13
    CONTROL         "",AFX_ID_PREVIEW_ZOOMOUT,"Button",BS_OWNERDRAW | 
                    WS_TABSTOP,132,3,15,13
    PUSHBUTTON      "&Close",AFX_ID_PREVIEW_CLOSE,160,3,37,13
    CONTROL         "Landscape print",IDC_LANDSCAPE,"Button",BS_AUTOCHECKBOX | 
                    WS_TABSTOP,204,3,67,13,WS_EX_CLIENTEDGE
END

STRINGTABLE DISCARDABLE 
BEGIN
    ID_PAGES_1PAGE          "Preview a single page"
    ID_PAGES_2PAGES         "Preview 2 pages"
    ID_PAGES_3PAGES         "Preview 3 pages"
    ID_PAGES_4PAGES         "Preview 4 pages"
    ID_PAGES_6PAGES         "Preview 6 pages"
    ID_PAGES_9PAGES         "Preview 9 pages"
END

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Sirius Analytical Instruments
United Kingdom United Kingdom
A research and development programmer working for a pharmaceutical instrument company for the past 17 years.

I am one of those lucky people who enjoys his work and spends more time than he should either doing work or reseaching new stuff. I can also be found on playing DDO on the Cannith server (Send a tell to "Maetrim" who is my current main)

I am also a keep fit fanatic, doing cross country running and am seriously into [url]http://www.ryushinkan.co.uk/[/url] Karate at this time of my life, training from 4-6 times a week and recently achieved my 1st Dan after 6 years.

Comments and Discussions