/////////////////////////////////////////////////////////////////////////////
// Name: print.h
-// Purpose: documentation for wxPreviewControlBar class
+// Purpose: interface of wxPreviewControlBar
// Author: wxWidgets team
// RCS-ID: $Id$
// Licence: wxWindows license
/**
@class wxPreviewControlBar
@wxheader{print.h}
-
+
This is the default implementation of the preview control bar, a panel
with buttons and a zoom control. You can derive a new class from this and
override some or all member functions to change the behaviour and appearance;
or you can leave it as it is.
-
+
@library{wxbase}
@category{printing}
-
- @seealso
- wxPreviewFrame, wxPreviewCanvas, wxPrintPreview
+
+ @see wxPreviewFrame, wxPreviewCanvas, wxPrintPreview
*/
class wxPreviewControlBar : public wxPanel
{
/**
Gets the print preview object associated with the control bar.
*/
- wxPrintPreview * GetPrintPreview();
+ wxPrintPreview* GetPrintPreview();
/**
Gets the current zoom setting in percent.
/**
Constructor.
-
The buttons parameter may be a combination of the following, using the bitwise
'or' operator.
-
+
wxPREVIEW_PRINT
-
-
+
Create a print button.
-
+
wxPREVIEW_NEXT
-
-
+
Create a next page button.
-
+
wxPREVIEW_PREVIOUS
-
-
+
Create a previous page button.
-
+
wxPREVIEW_ZOOM
-
-
+
Create a zoom control.
-
+
wxPREVIEW_DEFAULT
-
-
+
Equivalent to a combination of wxPREVIEW_PREVIOUS, wxPREVIEW_NEXT and
wxPREVIEW_ZOOM.
*/
- wxPreviewControlBar(wxPrintPreview* preview, long buttons,
- wxWindow* parent,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = 0,
- const wxString& name = "panel");
+ wxPreviewControlBar(wxPrintPreview* preview, long buttons,
+ wxWindow* parent,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = 0,
+ const wxString& name = "panel");
};
+
/**
@class wxPreviewCanvas
@wxheader{print.h}
-
+
A preview canvas is the default canvas used by the print preview
system to display the preview.
-
+
@library{wxbase}
@category{printing}
-
- @seealso
- wxPreviewFrame, wxPreviewControlBar, wxPrintPreview
+
+ @see wxPreviewFrame, wxPreviewControlBar, wxPrintPreview
*/
class wxPreviewCanvas : public wxScrolledWindow
{
};
+
/**
@class wxPreviewFrame
@wxheader{print.h}
-
+
This class provides the default method of managing the print preview interface.
Member functions may be overridden to replace functionality, or the
class may be used without derivation.
-
+
@library{wxbase}
@category{printing}
-
- @seealso
- wxPreviewCanvas, wxPreviewControlBar, wxPrintPreview
+
+ @see wxPreviewCanvas, wxPreviewControlBar, wxPrintPreview
*/
class wxPreviewFrame : public wxFrame
{
Creates the preview canvas and control bar, and calls
wxWindow::MakeModal(@true) to disable other top-level windows
in the application.
-
This function should be called by the application prior to
showing the frame.
*/
};
+
/**
@class wxPrintPreview
@wxheader{print.h}
-
+
Objects of this class manage the print preview process. The object is passed
a wxPrintout object, and the wxPrintPreview object itself is passed to
a wxPreviewFrame object. Previewing is started by initializing and showing
the preview frame. Unlike wxPrinter::Print, flow of control returns to the
application
immediately after the frame is shown.
-
+
@library{wxbase}
@category{printing}
-
- @seealso
- @ref overview_printingoverview "Printing framework overview", wxPrinterDC,
+
+ @see @ref overview_printingoverview "Printing framework overview", wxPrinterDC,
wxPrintDialog, wxPrintout, wxPrinter, wxPreviewCanvas, wxPreviewControlBar, wxPreviewFrame.
*/
class wxPrintPreview : public wxObject
used for actual printing, and the address of an optional
block of printer data, which will be copied to the print preview object's
print data.
-
- If @e printoutForPrinting is non-@NULL, a @b Print... button will be placed on
+ If @a printoutForPrinting is non-@NULL, a @b Print... button will be placed on
the
preview frame so that the user can print directly from the preview interface.
-
Do not explicitly delete the printout objects once this destructor has been
called, since they will be deleted in the wxPrintPreview constructor.
- The same does not apply to the @e data argument.
-
+ The same does not apply to the @a data argument.
Test the Ok member to check whether the wxPrintPreview object was created
correctly.
Ok could return @false if there was a problem initializing the printer device
*/
wxPrintPreview(wxPrintout* printout,
wxPrintout* printoutForPrinting,
- wxPrintData* data=@NULL);
+ wxPrintData* data = NULL);
/**
Destructor. Deletes both print preview objects, so do not destroy these objects
Gets the frame used for displaying the print preview canvas
and control bar.
*/
- wxFrame * GetFrame();
+ wxFrame* GetFrame();
/**
Returns the maximum page number.
/**
Gets the preview printout object associated with the wxPrintPreview object.
*/
- wxPrintout * GetPrintout();
+ wxPrintout* GetPrintout();
/**
Gets the printout object to be used for printing from within the preview
interface,
or @NULL if none exists.
*/
- wxPrintout * GetPrintoutForPrinting();
+ wxPrintout* GetPrintoutForPrinting();
/**
Returns @true if the wxPrintPreview is valid, @false otherwise. It could return
problem initializing the printer device context (current printer not set, for
example).
*/
-#define bool Ok() /* implementation is private */
+ bool Ok();
/**
This refreshes the preview window with the preview image.
It must be called from the preview window's OnPaint member.
-
The implementation simply blits the preview bitmap onto
the canvas, creating a new preview bitmap if none exists.
*/
- bool PaintPage(wxPreviewCanvas * canvas, wxDC dc);
+ bool PaintPage(wxPreviewCanvas* canvas, wxDC dc);
/**
Invokes the print process using the second wxPrintout object
supplied in the wxPrintPreview constructor.
Will normally be called by the @b Print... panel item on the
preview frame's control bar.
-
Returns @false in case of error -- call
wxPrinter::GetLastError to get detailed
information about the kind of the error.
Sets the frame to be used for displaying the print preview canvas
and control bar.
*/
- void SetFrame(wxFrame * frame);
+ void SetFrame(wxFrame* frame);
/**
Associates a printout object with the wxPrintPreview object.
*/
- void SetPrintout(wxPrintout * printout);
+ void SetPrintout(wxPrintout* printout);
/**
Sets the percentage preview zoom, and refreshes the preview canvas
};
+
/**
@class wxPrinter
@wxheader{print.h}
-
+
This class represents the Windows or PostScript printer, and is the vehicle
through
which printing may be launched by an application. Printing can also
be achieved through using of lower functions and classes, but
this and associated classes provide a more convenient and general
method of printing.
-
+
@library{wxbase}
@category{printing}
-
- @seealso
- @ref overview_printingoverview "Printing framework overview", wxPrinterDC,
+
+ @see @ref overview_printingoverview "Printing framework overview", wxPrinterDC,
wxPrintDialog, wxPrintout, wxPrintPreview.
*/
class wxPrinter : public wxObject
/**
Constructor. Pass an optional pointer to a block of print
dialog data, which will be copied to the printer object's local data.
-
- @sa wxPrintDialogData, wxPrintData
+
+ @see wxPrintDialogData, wxPrintData
*/
- wxPrinter(wxPrintDialogData* data = @NULL);
+ wxPrinter(wxPrintDialogData* data = NULL);
/**
Creates the default printing abort window, with a cancel button.
/**
Return last error. Valid after calling Print(),
- PrintDialog() or
- wxPrintPreview::Print. These functions
+ PrintDialog() or
+ wxPrintPreview::Print. These functions
set last error to @b wxPRINTER_NO_ERROR if no error happened.
-
Returned value is one of the following:
-
-
+
@b wxPRINTER_NO_ERROR
-
-
+
No error happened.
-
+
@b wxPRINTER_CANCELLED
-
-
+
The user cancelled printing.
-
+
@b wxPRINTER_ERROR
-
-
+
There was an error during printing.
*/
static wxPrinterError GetLastError();
object which controls
the printing of a document, and whether the print dialog should be invoked
first.
-
Print could return @false if there was a problem initializing the printer device
context
(current printer not set, for example) or the user cancelled printing. Call
GetLastError() to get detailed
information about the kind of the error.
*/
- bool Print(wxWindow * parent, wxPrintout * printout,
- bool prompt=@true);
+ bool Print(wxWindow* parent, wxPrintout* printout,
+ bool prompt = true);
/**
Invokes the print dialog. If successful (the user did not press Cancel
(otherwise @NULL is returned -- call
GetLastError() to get detailed
information about the kind of the error).
-
The application must delete this device context to avoid a memory leak.
*/
- wxDC* PrintDialog(wxWindow * parent);
+ wxDC* PrintDialog(wxWindow* parent);
/**
Default error-reporting function.
*/
- void ReportError(wxWindow * parent, wxPrintout * printout,
+ void ReportError(wxWindow* parent, wxPrintout* printout,
const wxString& message);
/**
Invokes the print setup dialog. Note that the setup dialog is obsolete from
Windows 95, though retained for backward compatibility.
*/
- bool Setup(wxWindow * parent);
+ bool Setup(wxWindow* parent);
};
+
/**
@class wxPrintout
@wxheader{print.h}
-
+
This class encapsulates the functionality of printing out an application
document. A new class must be derived and members overridden to respond to calls
such as OnPrintPage and HasPage and to render the print image onto an associated
wxDC. Instances of this class are passed to wxPrinter::Print or
to a wxPrintPreview object to initiate printing or previewing.
-
+
Your derived wxPrintout is responsible for drawing both the preview image and
the printed page. If your windows' drawing routines accept an arbitrary DC as an
argument, you can re-use those routines within your wxPrintout subclass to draw
can easily use a single drawing routine to draw on your application's windows,
to create the print preview image, and to create the printed paper image, and
achieve a common appearance to the preview image and the printed page.
-
+
@library{wxbase}
@category{printing}
-
- @seealso
- @ref overview_printingoverview "Printing framework overview", wxPrinterDC,
+
+ @see @ref overview_printingoverview "Printing framework overview", wxPrinterDC,
wxPrintDialog, wxPageSetupDialog, wxPrinter, wxPrintPreview
*/
class wxPrintout : public wxObject
origin is at the top left corner of the page rectangle. On MSW and Mac, the page
rectangle is the printable area of the page. On other platforms and PostScript
printing, the page rectangle is the entire paper. Use this if you want your
- printed image as large as possible, but with the caveat that on some platforms,
+ printed image as large as possible, but with the caveat that on some platforms,
portions of the image might be cut off at the edges.
*/
void FitThisSizeToPage(const wxSize& imageSize);
or Mac,
a wxPostScriptDC if printing on other platforms, and a wxMemoryDC if previewing.
*/
-#define wxDC * GetDC() /* implementation is private */
+ wxDC* GetDC();
/**
Return the rectangle corresponding to the page margins specified by the given
/**
Return the rectangle corresponding to the page in the associated wxDC's
- logical coordinates for the current user scale and device origin.
+ logical coordinates for the current user scale and device origin.
On MSW and Mac, this will be the printable area of the paper. On other platforms
and PostScript printing, this will be the full paper rectangle.
*/
FitThisSizeToXXX() and MapScreenSizeToXXX routines below, which do most of the
scaling calculations for you.
*/
- void GetPPIPrinter(int * w, int * h);
+ void GetPPIPrinter(int* w, int* h);
/**
Returns the number of pixels per logical inch of the screen device context.
for drawing text onto the printer. If you are doing your own scaling, remember
to multiply this by a scaling factor to take the preview DC size into account.
*/
- void GetPPIScreen(int * w, int * h);
+ void GetPPIScreen(int* w, int* h);
/**
Called by the framework to obtain information from the application about minimum
and maximum page values that the user can select, and the required page range to
be printed. By default this returns 1, 32000 for the page minimum and maximum
values, and 1, 1 for the required page range.
-
- If @e minPage is zero, the page number controls in the print dialog will be
+ If @a minPage is zero, the page number controls in the print dialog will be
disabled.
*/
- void GetPageInfo(int * minPage, int * maxPage, int * pageFrom,
- int * pageTo);
+ void GetPageInfo(int* minPage, int* maxPage, int* pageFrom,
+ int* pageTo);
/**
Returns the size of the printer page in millimetres.
*/
- void GetPageSizeMM(int * w, int * h);
+ void GetPageSizeMM(int* w, int* h);
/**
Returns the size of the printer page in pixels, called the page rectangle.
the current preview zoom. The application must take this discrepancy into
account if previewing is to be supported.
*/
- void GetPageSizePixels(int * w, int * h);
+ void GetPageSizePixels(int* w, int* h);
/**
Returns the rectangle that corresponds to the entire paper in pixels, called the
Called by the framework at the start of document printing. Return @false from
this function cancels the print job. OnBeginDocument is called once for every
copy printed.
-
The base OnBeginDocument() @e must be called (and the return value
checked) from within the overridden function, since it calls wxDC::StartDoc.
*/
/**
Called by the framework at the end of document printing. OnEndDocument
is called once for every copy printed.
-
The base OnEndDocument() @e must be called
from within the overridden function, since it calls wxDC::EndDoc.
*/
*/
void SetLogicalOrigin(wxCoord x, wxCoord y);
};
+