wxArt2D
Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
a2dViewPrintout Class Reference

to print what is displayed on a a2dCanvasView or the whole document as seen from the showobject of the drawer. More...

#include <candoc.h>

Inheritance diagram for a2dViewPrintout:
Inheritance graph
[legend]
Collaboration diagram for a2dViewPrintout:
Collaboration graph
[legend]

Public Member Functions

 a2dViewPrintout (const wxPageSetupDialogData &pageSetupData, a2dCanvasView *drawer, const wxString &title, const wxString &filename, a2dPrintWhat typeOfPrint, bool drawframe, double scalelimit, bool fitToPage)
 initialize mapping based on an existing canvas More...
 
 ~a2dViewPrintout (void)
 destructor
 
bool OnPrintPage (int)
 called for every page to print, for a2dCanvasDocument in general just one. More...
 
- Public Member Functions inherited from a2dDocumentPrintout
 a2dDocumentPrintout (a2dView *view=(a2dView *) NULL, const wxString &title=wxT("Printout"))
 
bool OnPrintPage (int page)
 
bool HasPage (int page)
 
bool OnBeginDocument (int startPage, int endPage)
 
void GetPageInfo (int *minPage, int *maxPage, int *selPageFrom, int *selPageTo)
 
virtual a2dViewGetView ()
 

Static Public Member Functions

static void SetPrintAsBitmap (bool printAsBitmap)
 if set, printing is done via a bitmap which is drawn into, and next bitmap is printed.
 
static bool GetPrintAsBitmap ()
 if set, printing is done via a bitmap which is drawn into, and next bitmap is printed.
 

Protected Attributes

const wxPageSetupDialogData & m_pageSetupData
 
a2dPrintWhat m_typeOfPrint
 type of print requested
 
a2dCanvasViewm_drawingView
 maping defined by this canvas
 
wxString m_title
 title put above printout
 
wxString m_filename
 filename put below printout
 
double m_scalelimit
 limit scaling to this value (world/pixel)
 
bool m_drawframe
 draw a frame around the page
 
bool m_fitToPage
 
- Protected Attributes inherited from a2dDocumentPrintout
a2dViewm_printoutView
 

Static Protected Attributes

static bool m_printAsBitmap = true
 if set print a bitmap that was drawn into
 

Detailed Description

to print what is displayed on a a2dCanvasView or the whole document as seen from the showobject of the drawer.

Internal a second wxDarwer class is initiated with a mapping that nicely fits that mapping of the input a2dCanvasView to a piece of paper. This mapping depends on the type of print. If only what is on the view needs to be printed, the mapping of the input drawer is used, but if the whole document is wanted as seen from the ShowObject() of the input drawer, the boundingbox of the showobject will be used for the mapping.

Definition at line 71 of file candoc.h.

Constructor & Destructor Documentation

a2dViewPrintout::a2dViewPrintout ( const wxPageSetupDialogData &  pageSetupData,
a2dCanvasView drawer,
const wxString &  title,
const wxString &  filename,
a2dPrintWhat  typeOfPrint,
bool  drawframe,
double  scalelimit,
bool  fitToPage 
)

initialize mapping based on an existing canvas

Parameters
drawerthe a2dCanvasView from which the print is wanted.
titletitle at top of the print
filenamethe name of the file to be printed (may be empty )
typeOfPrintWhen called from a2dDocumentCommandProcessor, the a2dCommand* which lead to this call.

Depending on the command one can organize printing features. Like in the default implementation:

{
Print,
Preview,
PrintView,
PreviewView,
PrintDocument,
PreviewDocument,
PrintSetup
};

Here View is to only print what is the visible view. Document print the document as seen from the a2dView::ShowObject(), it fits this to the paper.

Parameters
drawframeprint a frame rectangle in bounding box of drawing/view
scalelimitlimits the scaling (world/pixel) to the given value, so that small graphics are not zoomed to full page
fitToPagescale to fit the page

Definition at line 65 of file candoc.cpp.

Member Function Documentation

bool a2dViewPrintout::OnPrintPage ( int  )

called for every page to print, for a2dCanvasDocument in general just one.

It redraws/rerenders without double buffering the view or document on the pinter its wxDC. Internal a a2dDcDrawer is used to redraw the a2dCanvasDocument on the device.

needed ?

Definition at line 82 of file candoc.cpp.

Member Data Documentation

bool a2dViewPrintout::m_fitToPage
protected

draw a view without real scale, the scaling in X and Y may differ. The drawing is adjusted in X and Y seperately to draw until the sides/border of the printer area

Definition at line 150 of file candoc.h.


The documentation for this class was generated from the following files:
a2dViewPrintout Class Reference -- Sun Oct 12 2014 17:04:52 -- Sun Oct 12 2014 -- 1.8.5 -- wxArt2D -- . -- Main Page Reference Documentation