1 /////////////////////////////////////////////////////////////////////////////
 
   3 // Purpose:     SWIG interface for wx????
 
   9 // Copyright:   (c) 2003 by Total Control Software
 
  10 // Licence:     wxWindows license
 
  11 /////////////////////////////////////////////////////////////////////////////
 
  16 //---------------------------------------------------------------------------
 
  20 #include "wx/wxPython/printfw.h"
 
  24 MAKE_CONST_WXSTRING2(PrintoutTitleStr, wxT("Printout"));
 
  25 MAKE_CONST_WXSTRING2(PreviewCanvasNameStr, wxT("previewcanvas"));
 
  28 //---------------------------------------------------------------------------
 
  32     wxPRINT_MODE_NONE =    0,
 
  33     wxPRINT_MODE_PREVIEW = 1,   // Preview in external application
 
  34     wxPRINT_MODE_FILE =    2,   // Print to file
 
  35     wxPRINT_MODE_PRINTER = 3,   // Send to printer
 
  36     wxPRINT_MODE_STREAM = 4     // Send postscript data into a stream 
 
  53     wxPRINTBIN_LARGECAPACITY,
 
  55     wxPRINTBIN_FORMSOURCE,
 
  61 class wxPrintData : public wxObject {
 
  63     %nokwargs wxPrintData;
 
  65     wxPrintData(const wxPrintData& data);  // for making copies
 
  75     const wxString& GetPrinterName();
 
  77     wxDuplexMode GetDuplex();
 
  78     wxPaperSize GetPaperId();
 
  79     const wxSize& GetPaperSize();
 
  83     wxPrintMode GetPrintMode() const;
 
  85     void SetNoCopies(int v);
 
  86     void SetCollate(bool flag);
 
  87     void SetOrientation(int orient);
 
  89     void SetPrinterName(const wxString& name);
 
  90     void SetColour(bool colour);
 
  91     void SetDuplex(wxDuplexMode duplex);
 
  92     void SetPaperId(wxPaperSize sizeId);
 
  93     void SetPaperSize(const wxSize& sz);
 
  94     void SetQuality(int quality);
 
  95     void SetBin(wxPrintBin bin);
 
  96     void SetPrintMode(wxPrintMode printMode);
 
  98     wxString GetFilename() const;
 
  99     void SetFilename( const wxString &filename );
 
 101     %pythoncode { def __nonzero__(self): return self.Ok() }
 
 103     //char* GetPrivData() const;
 
 104     //int GetPrivDataLen() const;
 
 105     //void SetPrivData( char *privData, int len );
 
 108         PyObject* GetPrivData() {
 
 110             wxPyBlock_t blocked = wxPyBeginBlockThreads();
 
 111             data = PyString_FromStringAndSize(self->GetPrivData(),
 
 112                                               self->GetPrivDataLen());
 
 113             wxPyEndBlockThreads(blocked);
 
 117         void SetPrivData(PyObject* data) {
 
 118             if (! PyString_Check(data)) {
 
 119                 wxPyBLOCK_THREADS(PyErr_SetString(PyExc_TypeError,
 
 120                                                   "Expected string object"));
 
 124             wxPyBlock_t blocked = wxPyBeginBlockThreads();
 
 125             self->SetPrivData(PyString_AS_STRING(data), PyString_GET_SIZE(data));
 
 126             wxPyEndBlockThreads(blocked);
 
 131     // NOTE: These are now inside of #if WXWIN_COMPATIBILITY_2_4, so be
 
 132     //       prepared to remove them...
 
 134     // PostScript-specific data
 
 135 // WXWIN_COMPATIBILITY_2_4
 
 137     const wxString& GetPrinterCommand();
 
 138     const wxString& GetPrinterOptions();
 
 139     const wxString& GetPreviewCommand();
 
 140     const wxString& GetFontMetricPath();
 
 141     double GetPrinterScaleX();
 
 142     double GetPrinterScaleY();
 
 143     long GetPrinterTranslateX();
 
 144     long GetPrinterTranslateY();
 
 145     void SetPrinterCommand(const wxString& command);
 
 146     void SetPrinterOptions(const wxString& options);
 
 147     void SetPreviewCommand(const wxString& command);
 
 148     void SetFontMetricPath(const wxString& path);
 
 149     void SetPrinterScaleX(double x);
 
 150     void SetPrinterScaleY(double y);
 
 151     void SetPrinterScaling(double x, double y);
 
 152     void SetPrinterTranslateX(long x);
 
 153     void SetPrinterTranslateY(long y);
 
 154     void SetPrinterTranslation(long x, long y);
 
 159 //---------------------------------------------------------------------------
 
 161 class wxPageSetupDialogData : public wxObject {
 
 163     %nokwargs wxPageSetupDialogData;
 
 164     wxPageSetupDialogData();
 
 165     wxPageSetupDialogData(const wxPageSetupDialogData& data);  // for making copies
 
 166     wxPageSetupDialogData(const wxPrintData& data); 
 
 167     ~wxPageSetupDialogData();
 
 169     void EnableHelp(bool flag);
 
 170     void EnableMargins(bool flag);
 
 171     void EnableOrientation(bool flag);
 
 172     void EnablePaper(bool flag);
 
 173     void EnablePrinter(bool flag);
 
 175     bool GetDefaultMinMargins();
 
 176     bool GetEnableMargins();
 
 177     bool GetEnableOrientation();
 
 178     bool GetEnablePaper();
 
 179     bool GetEnablePrinter();
 
 180     bool GetEnableHelp();
 
 181     bool GetDefaultInfo();
 
 182     wxPoint GetMarginTopLeft();
 
 183     wxPoint GetMarginBottomRight();
 
 184     wxPoint GetMinMarginTopLeft();
 
 185     wxPoint GetMinMarginBottomRight();
 
 186     wxPaperSize GetPaperId();
 
 187     wxSize GetPaperSize();
 
 189     wxPrintData& GetPrintData();
 
 193     void SetDefaultInfo(bool flag);
 
 194     void SetDefaultMinMargins(bool flag);
 
 195     void SetMarginTopLeft(const wxPoint& pt);
 
 196     void SetMarginBottomRight(const wxPoint& pt);
 
 197     void SetMinMarginTopLeft(const wxPoint& pt);
 
 198     void SetMinMarginBottomRight(const wxPoint& pt);
 
 199     void SetPaperId(wxPaperSize id);
 
 200     void SetPaperSize(const wxSize& size);
 
 202     void SetPrintData(const wxPrintData& printData);
 
 204     // Use paper size defined in this object to set the wxPrintData
 
 206     void CalculateIdFromPaperSize();
 
 208     // Use paper id in wxPrintData to set this object's paper size
 
 209     void CalculatePaperSizeFromId();
 
 211     %pythoncode { def __nonzero__(self): return self.Ok() }
 
 216 // NOTE: Contrary to it's name, this class doesn't derive from wxDialog.  It
 
 217 // is a facade in front of a platform-specific (native dialog) provided by the
 
 220 MustHaveApp(wxPageSetupDialog);
 
 222 class wxPageSetupDialog : public wxObject
 
 225     wxPageSetupDialog(wxWindow* parent, wxPageSetupDialogData* data = NULL);
 
 227     wxPageSetupDialogData& GetPageSetupData();
 
 228     wxPageSetupDialogData& GetPageSetupDialogData();
 
 232 //---------------------------------------------------------------------------
 
 235 class wxPrintDialogData : public wxObject {
 
 237     %nokwargs wxPrintDialogData;
 
 239     wxPrintDialogData(const wxPrintData& printData);
 
 240     wxPrintDialogData(const wxPrintDialogData& printData);  // for making copies
 
 241     ~wxPrintDialogData();
 
 243     int GetFromPage() const;
 
 244     int GetToPage() const;
 
 245     int GetMinPage() const;
 
 246     int GetMaxPage() const;
 
 247     int GetNoCopies() const;
 
 248     bool GetAllPages() const;
 
 249     bool GetSelection() const;
 
 250     bool GetCollate() const;
 
 251     bool GetPrintToFile() const;
 
 253     // WXWIN_COMPATIBILITY_2_4
 
 255     bool GetSetupDialog() const;
 
 256     void SetSetupDialog(bool flag);
 
 258     void SetFromPage(int v);
 
 259     void SetToPage(int v);
 
 260     void SetMinPage(int v);
 
 261     void SetMaxPage(int v);
 
 262     void SetNoCopies(int v);
 
 263     void SetAllPages(bool flag);
 
 264     void SetSelection(bool flag);
 
 265     void SetCollate(bool flag);
 
 266     void SetPrintToFile(bool flag);
 
 268     void EnablePrintToFile(bool flag);
 
 269     void EnableSelection(bool flag);
 
 270     void EnablePageNumbers(bool flag);
 
 271     void EnableHelp(bool flag);
 
 273     bool GetEnablePrintToFile() const;
 
 274     bool GetEnableSelection() const;
 
 275     bool GetEnablePageNumbers() const;
 
 276     bool GetEnableHelp() const;
 
 278     // Is this data OK for showing the print dialog?
 
 282     wxPrintData& GetPrintData();
 
 283     void SetPrintData(const wxPrintData& printData);
 
 285     %pythoncode { def __nonzero__(self): return self.Ok() }
 
 290 MustHaveApp(wxPrintDialog);
 
 293 // NOTE: Contrary to it's name, this class doesn't derive from wxDialog.  It
 
 294 // is a facade in front of a platform-specific (native dialog) provided by the
 
 297 class wxPrintDialog : public wxObject {
 
 299     wxPrintDialog(wxWindow* parent, wxPrintDialogData* data = NULL);
 
 301     // TODO?: wxPrintDialog(wxWindow *parent, wxPrintData* data);
 
 303     virtual int ShowModal();
 
 305     virtual wxPrintDialogData& GetPrintDialogData();
 
 306     virtual wxPrintData& GetPrintData();
 
 308     %newobject GetPrintDC;
 
 309     virtual wxDC *GetPrintDC();
 
 314 //---------------------------------------------------------------------------
 
 315 //---------------------------------------------------------------------------
 
 320     wxPRINTER_NO_ERROR = 0,
 
 326 MustHaveApp(wxPrinter);
 
 328 class wxPrinter : public wxObject {
 
 330     wxPrinter(wxPrintDialogData* data = NULL);
 
 333     virtual wxWindow *CreateAbortWindow(wxWindow *parent, wxPyPrintout *printout);
 
 334     virtual void ReportError(wxWindow *parent, wxPyPrintout *printout, const wxString& message);
 
 336     virtual bool Setup(wxWindow *parent);
 
 337     virtual bool Print(wxWindow *parent, wxPyPrintout *printout, bool prompt = true);
 
 338     virtual wxDC* PrintDialog(wxWindow *parent);
 
 340     virtual wxPrintDialogData& GetPrintDialogData() const;
 
 343     static wxPrinterError GetLastError();
 
 348 //---------------------------------------------------------------------------
 
 349 // Custom wxPrintout class that knows how to call python, See implementation in
 
 350 // include/sx/wxPython/printfw.h
 
 354 IMPLEMENT_ABSTRACT_CLASS(wxPyPrintout, wxPrintout);
 
 356 // Since this one would be tough and ugly to do with the Macros...
 
 357 void wxPyPrintout::GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo) {
 
 361     wxPyBlock_t blocked = wxPyBeginBlockThreads();
 
 362     if ((found = wxPyCBH_findCallback(m_myInst, "GetPageInfo"))) {
 
 363         PyObject* result = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));
 
 364         if (result && PyTuple_Check(result) && PyTuple_Size(result) == 4) {
 
 367             val = PyTuple_GetItem(result, 0);
 
 368             if (PyInt_Check(val))    *minPage = PyInt_AsLong(val);
 
 371             val = PyTuple_GetItem(result, 1);
 
 372             if (PyInt_Check(val))    *maxPage = PyInt_AsLong(val);
 
 375             val = PyTuple_GetItem(result, 2);
 
 376             if (PyInt_Check(val))    *pageFrom = PyInt_AsLong(val);
 
 379             val = PyTuple_GetItem(result, 3);
 
 380             if (PyInt_Check(val))    *pageTo = PyInt_AsLong(val);
 
 387             PyErr_SetString(PyExc_TypeError, "GetPageInfo should return a tuple of 4 integers.");
 
 392     wxPyEndBlockThreads(blocked);
 
 394         wxPrintout::GetPageInfo(minPage, maxPage, pageFrom, pageTo);
 
 399 IMP_PYCALLBACK_BOOL_INTINT(wxPyPrintout, wxPrintout, OnBeginDocument);
 
 400 IMP_PYCALLBACK__(wxPyPrintout, wxPrintout, OnEndDocument);
 
 401 IMP_PYCALLBACK__(wxPyPrintout, wxPrintout, OnBeginPrinting);
 
 402 IMP_PYCALLBACK__(wxPyPrintout, wxPrintout, OnEndPrinting);
 
 403 IMP_PYCALLBACK__(wxPyPrintout, wxPrintout, OnPreparePrinting);
 
 404 IMP_PYCALLBACK_BOOL_INT_pure(wxPyPrintout, wxPrintout, OnPrintPage);
 
 405 IMP_PYCALLBACK_BOOL_INT(wxPyPrintout, wxPrintout, HasPage);
 
 411 MustHaveApp(wxPyPrintout);
 
 413 // Now define the custom class for SWIGging
 
 414 %rename(Printout) wxPyPrintout;
 
 415 class wxPyPrintout  : public wxObject {
 
 417     %pythonAppend wxPyPrintout   "self._setCallbackInfo(self, Printout)"
 
 418     %typemap(out) wxPyPrintout*;    // turn off this typemap
 
 420     wxPyPrintout(const wxString& title = wxPyPrintoutTitleStr);
 
 423     // Turn it back on again
 
 424     %typemap(out) wxPyPrintout* { $result = wxPyMake_wxObject($1, $owner); }
 
 426     void _setCallbackInfo(PyObject* self, PyObject* _class);
 
 429     wxString GetTitle() const;
 
 431     void SetDC(wxDC *dc);
 
 433     void SetPageSizePixels(int w, int  h);
 
 435         void, GetPageSizePixels(int *OUTPUT, int *OUTPUT),
 
 436         "GetPageSizePixels() -> (w, h)");
 
 438     void SetPageSizeMM(int w, int  h);
 
 440         void, GetPageSizeMM(int *OUTPUT, int *OUTPUT),
 
 441         "GetPageSizeMM() -> (w, h)");
 
 443     void SetPPIScreen(int x, int y);
 
 445         void, GetPPIScreen(int *OUTPUT, int *OUTPUT),
 
 446         "GetPPIScreen() -> (x,y)");
 
 448     void SetPPIPrinter(int x, int y);
 
 450         void, GetPPIPrinter(int *OUTPUT, int *OUTPUT),
 
 451         "GetPPIPrinter() -> (x,y)");
 
 454     void SetIsPreview(bool p);
 
 457     bool OnBeginDocument(int startPage, int endPage);
 
 458     void OnEndDocument();
 
 459     void OnBeginPrinting();
 
 460     void OnEndPrinting();
 
 461     void OnPreparePrinting();
 
 462     bool HasPage(int page);
 
 464         void, GetPageInfo(int *OUTPUT, int *OUTPUT, int *OUTPUT, int *OUTPUT),
 
 465         "GetPageInfo() -> (minPage, maxPage, pageFrom, pageTo)");
 
 467     %MAKE_BASE_FUNC(Printout, OnBeginDocument);
 
 468     %MAKE_BASE_FUNC(Printout, OnEndDocument);
 
 469     %MAKE_BASE_FUNC(Printout, OnBeginPrinting);
 
 470     %MAKE_BASE_FUNC(Printout, OnEndPrinting);
 
 471     %MAKE_BASE_FUNC(Printout, OnPreparePrinting);
 
 472     %MAKE_BASE_FUNC(Printout, GetPageInfo);
 
 475 //---------------------------------------------------------------------------
 
 479 MustHaveApp(wxPreviewCanvas);
 
 481 class wxPreviewCanvas: public wxScrolledWindow
 
 484     %pythonAppend wxPreviewCanvas   "self._setOORInfo(self)"
 
 486     wxPreviewCanvas(wxPrintPreview *preview,
 
 488                     const wxPoint& pos = wxDefaultPosition,
 
 489                     const wxSize& size = wxDefaultSize,
 
 491                     const wxString& name = wxPyPreviewCanvasNameStr);
 
 495 MustHaveApp(wxPreviewFrame);
 
 497 class wxPreviewFrame : public wxFrame {
 
 499     %disownarg(wxPrintPreview*);
 
 501     %pythonAppend wxPreviewFrame   "self._setOORInfo(self)"
 
 502     wxPreviewFrame(wxPrintPreview* preview, wxFrame* parent, const wxString& title,
 
 503                    const wxPoint& pos = wxDefaultPosition,
 
 504                    const wxSize&  size = wxDefaultSize,
 
 505                    long style = wxDEFAULT_FRAME_STYLE,
 
 506                    const wxString& name = wxPyFrameNameStr);
 
 508     %cleardisown(wxPrintPreview*);
 
 511     void CreateControlBar();
 
 514     wxPreviewControlBar* GetControlBar() const;
 
 531     wxID_PREVIEW_PREVIOUS,
 
 539 MustHaveApp(wxPreviewControlBar);
 
 541 class wxPreviewControlBar: public wxPanel
 
 544     %pythonAppend wxPreviewControlBar   "self._setOORInfo(self)"
 
 546     wxPreviewControlBar(wxPrintPreview *preview,
 
 549                         const wxPoint& pos = wxDefaultPosition,
 
 550                         const wxSize& size = wxDefaultSize,
 
 551                         long style = wxTAB_TRAVERSAL,
 
 552                         const wxString& name = wxPyPanelNameStr);
 
 554     int GetZoomControl();
 
 555     void SetZoomControl(int zoom);
 
 556     wxPrintPreview* GetPrintPreview();
 
 567 //---------------------------------------------------------------------------
 
 569 MustHaveApp(wxPrintPreview);
 
 571 class wxPrintPreview : public wxObject {
 
 573     %disownarg(wxPyPrintout*);
 
 575     %nokwargs wxPrintPreview;
 
 576     wxPrintPreview(wxPyPrintout* printout,
 
 577                    wxPyPrintout* printoutForPrinting,
 
 578                    wxPrintDialogData *data=NULL);
 
 579     wxPrintPreview(wxPyPrintout* printout,
 
 580                   wxPyPrintout* printoutForPrinting,
 
 585     virtual bool SetCurrentPage(int pageNum);
 
 586     int GetCurrentPage();
 
 588     void SetPrintout(wxPyPrintout *printout);
 
 589     wxPyPrintout *GetPrintout();
 
 590     wxPyPrintout *GetPrintoutForPrinting();
 
 592     %cleardisown(wxPyPrintout*);
 
 594     void SetFrame(wxFrame *frame);
 
 595     void SetCanvas(wxPreviewCanvas *canvas);
 
 597     virtual wxFrame *GetFrame();
 
 598     virtual wxPreviewCanvas *GetCanvas();
 
 600     // The preview canvas should call this from OnPaint
 
 601     virtual bool PaintPage(wxPreviewCanvas *canvas, wxDC& dc);
 
 603     // This draws a blank page onto the preview canvas
 
 604     virtual bool DrawBlankPage(wxPreviewCanvas *canvas, wxDC& dc);
 
 606     // This is called by wxPrintPreview to render a page into a wxMemoryDC.
 
 607     virtual bool RenderPage(int pageNum);
 
 609     // Adjusts the scrollbars for the current scale
 
 610     virtual void AdjustScrollbars(wxPreviewCanvas *canvas);
 
 612     wxPrintDialogData& GetPrintDialogData();
 
 614     virtual void SetZoom(int percent);
 
 623     virtual bool Print(bool interactive);
 
 624     virtual void DetermineScaling();
 
 626     %pythoncode { def __nonzero__(self): return self.Ok() }
 
 631 //---------------------------------------------------------------------------
 
 633 // Python-derivable versions of the above preview classes
 
 637 #define DEC_PYCALLBACK_BOOL_PREWINDC(CBNAME)                                            \
 
 638     bool CBNAME(wxPreviewCanvas* a, wxDC& b)
 
 641 #define IMP_PYCALLBACK_BOOL_PREWINDC(CLASS, PCLASS, CBNAME)                             \
 
 642     bool CLASS::CBNAME(wxPreviewCanvas* a, wxDC& b) {                                   \
 
 645         wxPyBlock_t blocked = wxPyBeginBlockThreads();                                  \
 
 646         if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) {                        \
 
 647             PyObject* win = wxPyMake_wxObject(a,false);                                 \
 
 648             PyObject* dc  = wxPyMake_wxObject(&b,false);                                \
 
 649             rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OO)", win, dc));      \
 
 653         wxPyEndBlockThreads(blocked);                                                   \
 
 655             rval = PCLASS::CBNAME(a, b);                                                \
 
 662 class wxPyPrintPreview : public wxPrintPreview
 
 664     DECLARE_CLASS(wxPyPrintPreview)
 
 666     wxPyPrintPreview(wxPyPrintout* printout,
 
 667                      wxPyPrintout* printoutForPrinting,
 
 668                      wxPrintDialogData* data=NULL)
 
 669         : wxPrintPreview(printout, printoutForPrinting, data)
 
 671     wxPyPrintPreview(wxPyPrintout* printout,
 
 672                      wxPyPrintout* printoutForPrinting,
 
 674         : wxPrintPreview(printout, printoutForPrinting, data)
 
 677     DEC_PYCALLBACK_BOOL_INT(SetCurrentPage);
 
 678     DEC_PYCALLBACK_BOOL_PREWINDC(PaintPage);
 
 679     DEC_PYCALLBACK_BOOL_PREWINDC(DrawBlankPage);
 
 680     DEC_PYCALLBACK_BOOL_INT(RenderPage);
 
 681     DEC_PYCALLBACK_VOID_INT(SetZoom);
 
 682     DEC_PYCALLBACK_BOOL_BOOL(Print);
 
 683     DEC_PYCALLBACK_VOID_(DetermineScaling);
 
 688 // Stupid renamed classes...  Fix this in 2.5...
 
 689 #if defined(__WXMSW__)
 
 690 IMPLEMENT_CLASS( wxPyPrintPreview, wxWindowsPrintPreview );
 
 691 #elif defined(__WXMAC__)
 
 692 IMPLEMENT_CLASS( wxPyPrintPreview, wxMacPrintPreview );
 
 694 IMPLEMENT_CLASS( wxPyPrintPreview, wxPostScriptPrintPreview );
 
 697 IMP_PYCALLBACK_BOOL_INT     (wxPyPrintPreview, wxPrintPreview, SetCurrentPage);
 
 698 IMP_PYCALLBACK_BOOL_PREWINDC(wxPyPrintPreview, wxPrintPreview, PaintPage);
 
 699 IMP_PYCALLBACK_BOOL_PREWINDC(wxPyPrintPreview, wxPrintPreview, DrawBlankPage);
 
 700 IMP_PYCALLBACK_BOOL_INT     (wxPyPrintPreview, wxPrintPreview, RenderPage);
 
 701 IMP_PYCALLBACK_VOID_INT     (wxPyPrintPreview, wxPrintPreview, SetZoom);
 
 702 IMP_PYCALLBACK_BOOL_BOOL    (wxPyPrintPreview, wxPrintPreview, Print);
 
 703 IMP_PYCALLBACK_VOID_        (wxPyPrintPreview, wxPrintPreview, DetermineScaling);
 
 707 MustHaveApp(wxPyPrintPreview);
 
 709 class wxPyPrintPreview : public wxPrintPreview
 
 712     %disownarg(wxPyPrintout*);
 
 714     %pythonAppend wxPyPrintPreview   "self._setCallbackInfo(self, PyPrintPreview)"
 
 715     %nokwargs wxPyPrintPreview;
 
 716     wxPyPrintPreview(wxPyPrintout* printout,
 
 717                      wxPyPrintout* printoutForPrinting,
 
 718                      wxPrintDialogData* data=NULL);
 
 719     wxPyPrintPreview(wxPyPrintout* printout,
 
 720                      wxPyPrintout* printoutForPrinting,
 
 723     %cleardisown(wxPyPrintout*);
 
 725     void _setCallbackInfo(PyObject* self, PyObject* _class);
 
 727     bool SetCurrentPage(int pageNum);
 
 728     bool PaintPage(wxPreviewCanvas *canvas, wxDC& dc);
 
 729     bool DrawBlankPage(wxPreviewCanvas *canvas, wxDC& dc);
 
 730     bool RenderPage(int pageNum);
 
 731     void SetZoom(int percent);
 
 732     bool Print(bool interactive);
 
 733     void DetermineScaling();
 
 735     %MAKE_BASE_FUNC(PyPrintPreview, SetCurrentPage);
 
 736     %MAKE_BASE_FUNC(PyPrintPreview, PaintPage);
 
 737     %MAKE_BASE_FUNC(PyPrintPreview, DrawBlankPage);
 
 738     %MAKE_BASE_FUNC(PyPrintPreview, RenderPage);
 
 739     %MAKE_BASE_FUNC(PyPrintPreview, SetZoom);
 
 740     %MAKE_BASE_FUNC(PyPrintPreview, Print);
 
 741     %MAKE_BASE_FUNC(PyPrintPreview, DetermineScaling);
 
 748 class wxPyPreviewFrame : public wxPreviewFrame
 
 750     DECLARE_CLASS(wxPyPreviewFrame)
 
 752     wxPyPreviewFrame(wxPrintPreview* preview, wxFrame* parent,
 
 753                      const wxString& title,
 
 754                      const wxPoint& pos = wxDefaultPosition,
 
 755                      const wxSize&  size = wxDefaultSize,
 
 756                      long style = wxDEFAULT_FRAME_STYLE,
 
 757                      const wxString& name = wxPyFrameNameStr)
 
 758         : wxPreviewFrame(preview, parent, title, pos, size, style, name)
 
 761     void SetPreviewCanvas(wxPreviewCanvas* canvas) { m_previewCanvas = canvas; }
 
 762     void SetControlBar(wxPreviewControlBar* bar) { m_controlBar = bar; }
 
 764     DEC_PYCALLBACK_VOID_(Initialize);
 
 765     DEC_PYCALLBACK_VOID_(CreateCanvas);
 
 766     DEC_PYCALLBACK_VOID_(CreateControlBar);
 
 771 IMPLEMENT_CLASS(wxPyPreviewFrame, wxPreviewFrame);
 
 773 IMP_PYCALLBACK_VOID_(wxPyPreviewFrame, wxPreviewFrame, Initialize);
 
 774 IMP_PYCALLBACK_VOID_(wxPyPreviewFrame, wxPreviewFrame, CreateCanvas);
 
 775 IMP_PYCALLBACK_VOID_(wxPyPreviewFrame, wxPreviewFrame, CreateControlBar);
 
 779 MustHaveApp(wxPyPreviewFrame);
 
 781 class wxPyPreviewFrame : public wxPreviewFrame
 
 784     %pythonAppend wxPyPreviewFrame "self._setCallbackInfo(self, PyPreviewFrame); self._setOORInfo(self)"
 
 786     wxPyPreviewFrame(wxPrintPreview* preview, wxFrame* parent,
 
 787                      const wxString& title,
 
 788                      const wxPoint& pos = wxDefaultPosition,
 
 789                      const wxSize&  size = wxDefaultSize,
 
 790                      long style = wxDEFAULT_FRAME_STYLE,
 
 791                      const wxString& name = wxPyFrameNameStr);
 
 793     void _setCallbackInfo(PyObject* self, PyObject* _class);
 
 795     void SetPreviewCanvas(wxPreviewCanvas* canvas);
 
 796     void SetControlBar(wxPreviewControlBar* bar);
 
 800     void CreateControlBar();
 
 802     %MAKE_BASE_FUNC(PyPreviewFrame, Initialize);
 
 803     %MAKE_BASE_FUNC(PyPreviewFrame, CreateCanvas);
 
 804     %MAKE_BASE_FUNC(PyPreviewFrame, CreateControlBar);
 
 811 class wxPyPreviewControlBar : public wxPreviewControlBar
 
 813     DECLARE_CLASS(wxPyPreviewControlBar)
 
 815     wxPyPreviewControlBar(wxPrintPreview *preview,
 
 818                           const wxPoint& pos = wxDefaultPosition,
 
 819                           const wxSize& size = wxDefaultSize,
 
 821                           const wxString& name = wxPyPanelNameStr)
 
 822         : wxPreviewControlBar(preview, buttons, parent, pos, size, style, name)
 
 825     void SetPrintPreview(wxPrintPreview* preview) { m_printPreview = preview; }
 
 827     DEC_PYCALLBACK_VOID_(CreateButtons);
 
 828     DEC_PYCALLBACK_VOID_INT(SetZoomControl);
 
 833 IMPLEMENT_CLASS(wxPyPreviewControlBar, wxPreviewControlBar);
 
 834 IMP_PYCALLBACK_VOID_(wxPyPreviewControlBar, wxPreviewControlBar, CreateButtons);
 
 835 IMP_PYCALLBACK_VOID_INT(wxPyPreviewControlBar, wxPreviewControlBar, SetZoomControl);
 
 839 MustHaveApp(wxPyPreviewControlBar);
 
 841 class wxPyPreviewControlBar : public wxPreviewControlBar
 
 844     %pythonAppend wxPyPreviewControlBar   "self._setCallbackInfo(self, PyPreviewControlBar); self._setOORInfo(self)"
 
 846     wxPyPreviewControlBar(wxPrintPreview *preview,
 
 849                           const wxPoint& pos = wxDefaultPosition,
 
 850                           const wxSize& size = wxDefaultSize,
 
 852                           const wxString& name = wxPyPanelNameStr);
 
 854     void _setCallbackInfo(PyObject* self, PyObject* _class);
 
 856     void SetPrintPreview(wxPrintPreview* preview);
 
 858     void CreateButtons();
 
 859     void SetZoomControl(int zoom);
 
 861     %MAKE_BASE_FUNC(PreviewControlBar, CreateButtons);
 
 862     %MAKE_BASE_FUNC(PreviewControlBar, SetZoomControl);
 
 865 //---------------------------------------------------------------------------
 
 866 //---------------------------------------------------------------------------
 
 868     wxPyPtrTypeMap_Add("wxPrintout", "wxPyPrintout");
 
 870 //---------------------------------------------------------------------------