MFC Grid manual

CGridPrintPreview Class Reference

Print preview dialog. More...

#include <Dapfor/GUI/GridPrintPreview.h>

List of all members.


Public Member Functions

 CGridPrintPreview (CGrid &grid, const CPrintSettings &settings, CPrintInfo *printInfo=0, bool destroyOnClose=true)
 Constructor.
virtual ~CGridPrintPreview ()
 Virtual destructor.
bool CreatePrintPreview (CWnd *parent)
 Initializes a dialog.
int GetPagesCount ()
 Total pages to be printed.
void Print ()
 Prints grid contents.
void PrintSetup ()
 Opens a printer setup dialog.
void Close ()
 Closes a current dialog.
ScreenZoom GetScreenZoom () const
 Gets a current screen zoom.
void SetScreenZoom (ScreenZoom zoom)
 Sets a new screen zoom.
double GetPrinterZoom () const
 Gets a printer zoom.
void SetPrinterZoom (double zoom)
 Sets a new printer zoom.
void SetPrinterZoom (PrinterZoom zoom)
 Sets a new printer zoom, where the value is one of PrinterZoom enumeration.
CGridGetGrid ()
 Gets the grid.

Detailed Description

Print preview dialog.

It is intended for displaying grid contents in the way they are printed. This dialogue enables visual display of up to three pages with grid contents and size customization. Grid contents can also be scaled while being displayed on the printer. It is possible to set scale by means of PrinterZoom enumeration or by directly calling SetPrinterZoom() function with transfering it double type parameter. When the given parameter equals 1, scaling is not applied. Besides, the dialogue gives the opportunity of adjusting the printer before printing, choosing paper type and image type and can also be used to start printing.


Constructor & Destructor Documentation

CGridPrintPreview ( CGrid grid,
const CPrintSettings settings,
CPrintInfo *  printInfo = 0,
bool  destroyOnClose = true 
)

Constructor.

Parameters:
[in] grid Grid, the content of which should be printed.
[in] settings Settings, containing layouts, zoom and other parameters to print the grid's contents.
[in] printInfo Stores the information about a print or print-preview job.
[in] destroyOnClose Value indicating that the dialog will be autodestroyed when the user closes it. True - the object of this class is destroyed when the user closes the window. Otherwise - non.


Member Function Documentation

bool CreatePrintPreview ( CWnd *  parent  ) 

Initializes a dialog.

Parameters:
[in] parent Parent window
Returns:
True if the dialog has been successfully initialized. Otherwise false.

int GetPagesCount (  ) 

Total pages to be printed.

Returns:
Total pages count to be printed

CGridPrintPreview::ScreenZoom GetScreenZoom (  )  const

Gets a current screen zoom.

Returns:
Value indicating a current screen zoom

void SetScreenZoom ( ScreenZoom  zoom  ) 

Sets a new screen zoom.

Parameters:
[in] zoom Value indicating a current screen zoom

double GetPrinterZoom (  )  const

Gets a printer zoom.

Returns:
Current printer zoom

void SetPrinterZoom ( double  zoom  ) 

Sets a new printer zoom.

Parameters:
[in] zoom New zoom

void SetPrinterZoom ( PrinterZoom  zoom  ) 

Sets a new printer zoom, where the value is one of PrinterZoom enumeration.

Parameters:
[in] zoom New zoom

CGrid & GetGrid (  ) 

Gets the grid.

Returns:
Grid, contents of which is to be printed.