]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/_printfw.i
reSWIGged
[wxWidgets.git] / wxPython / src / _printfw.i
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: _????.i
3 // Purpose: SWIG interface for wx????
4 //
5 // Author: Robin Dunn
6 //
7 // Created: 9-Aug-2003
8 // RCS-ID: $Id$
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
12
13 // Not a %module
14
15
16 //---------------------------------------------------------------------------
17 %newgroup
18
19 %{
20 #include "wx/wxPython/printfw.h"
21
22 static const wxChar* wxPrintoutTitleStr = wxT("Printout");
23 DECLARE_DEF_STRING(PrintoutTitleStr);
24 static const wxChar* wxPreviewCanvasNameStr = wxT("previewcanvas");
25 DECLARE_DEF_STRING(PreviewCanvasNameStr);
26
27 %}
28
29
30 //---------------------------------------------------------------------------
31
32 enum wxPrintMode
33 {
34 wxPRINT_MODE_NONE = 0,
35 wxPRINT_MODE_PREVIEW = 1, // Preview in external application
36 wxPRINT_MODE_FILE = 2, // Print to file
37 wxPRINT_MODE_PRINTER = 3 // Send to printer
38 };
39
40
41
42 class wxPrintData : public wxObject {
43 public:
44 wxPrintData();
45 ~wxPrintData();
46
47 int GetNoCopies();
48 bool GetCollate();
49 int GetOrientation();
50
51 bool Ok();
52
53 const wxString& GetPrinterName();
54 bool GetColour();
55 wxDuplexMode GetDuplex();
56 wxPaperSize GetPaperId();
57 const wxSize& GetPaperSize();
58
59 wxPrintQuality GetQuality();
60
61 void SetNoCopies(int v);
62 void SetCollate(bool flag);
63 void SetOrientation(int orient);
64
65 void SetPrinterName(const wxString& name);
66 void SetColour(bool colour);
67 void SetDuplex(wxDuplexMode duplex);
68 void SetPaperId(wxPaperSize sizeId);
69 void SetPaperSize(const wxSize& sz);
70 void SetQuality(wxPrintQuality quality);
71
72 // PostScript-specific data
73 const wxString& GetPrinterCommand();
74 const wxString& GetPrinterOptions();
75 const wxString& GetPreviewCommand();
76 const wxString& GetFilename();
77 const wxString& GetFontMetricPath();
78 double GetPrinterScaleX();
79 double GetPrinterScaleY();
80 long GetPrinterTranslateX();
81 long GetPrinterTranslateY();
82 wxPrintMode GetPrintMode();
83
84 void SetPrinterCommand(const wxString& command);
85 void SetPrinterOptions(const wxString& options);
86 void SetPreviewCommand(const wxString& command);
87 void SetFilename(const wxString& filename);
88 void SetFontMetricPath(const wxString& path);
89 void SetPrinterScaleX(double x);
90 void SetPrinterScaleY(double y);
91 void SetPrinterScaling(double x, double y);
92 void SetPrinterTranslateX(long x);
93 void SetPrinterTranslateY(long y);
94 void SetPrinterTranslation(long x, long y);
95 void SetPrintMode(wxPrintMode printMode);
96
97 %pythoncode { def __nonzero__(self): return self.Ok() }
98 };
99
100 //---------------------------------------------------------------------------
101
102 class wxPageSetupDialogData : public wxObject {
103 public:
104 wxPageSetupDialogData();
105 ~wxPageSetupDialogData();
106
107 void EnableHelp(bool flag);
108 void EnableMargins(bool flag);
109 void EnableOrientation(bool flag);
110 void EnablePaper(bool flag);
111 void EnablePrinter(bool flag);
112 bool GetDefaultMinMargins();
113 bool GetEnableMargins();
114 bool GetEnableOrientation();
115 bool GetEnablePaper();
116 bool GetEnablePrinter();
117 bool GetEnableHelp();
118 bool GetDefaultInfo();
119 wxPoint GetMarginTopLeft();
120 wxPoint GetMarginBottomRight();
121 wxPoint GetMinMarginTopLeft();
122 wxPoint GetMinMarginBottomRight();
123 wxPaperSize GetPaperId();
124 wxSize GetPaperSize();
125
126 wxPrintData& GetPrintData();
127 // %addmethods {
128 // %new wxPrintData* GetPrintData() {
129 // return new wxPrintData(self->GetPrintData()); // force a copy
130 // }
131 // }
132
133 bool Ok();
134
135 void SetDefaultInfo(bool flag);
136 void SetDefaultMinMargins(bool flag);
137 void SetMarginTopLeft(const wxPoint& pt);
138 void SetMarginBottomRight(const wxPoint& pt);
139 void SetMinMarginTopLeft(const wxPoint& pt);
140 void SetMinMarginBottomRight(const wxPoint& pt);
141 void SetPaperId(wxPaperSize id);
142 void SetPaperSize(const wxSize& size);
143 void SetPrintData(const wxPrintData& printData);
144
145 %pythoncode { def __nonzero__(self): return self.Ok() }
146 };
147
148
149
150 class wxPageSetupDialog : public wxDialog {
151 public:
152 %addtofunc wxPageSetupDialog "self._setOORInfo(self)"
153
154 wxPageSetupDialog(wxWindow* parent, wxPageSetupDialogData* data = NULL);
155
156 wxPageSetupDialogData& GetPageSetupData();
157 int ShowModal();
158 };
159
160 //---------------------------------------------------------------------------
161
162
163 class wxPrintDialogData : public wxObject {
164 public:
165 wxPrintDialogData();
166 ~wxPrintDialogData();
167
168 int GetFromPage() const;
169 int GetToPage() const;
170 int GetMinPage() const;
171 int GetMaxPage() const;
172 int GetNoCopies() const;
173 bool GetAllPages() const;
174 bool GetSelection() const;
175 bool GetCollate() const;
176 bool GetPrintToFile() const;
177 bool GetSetupDialog() const;
178
179 void SetFromPage(int v);
180 void SetToPage(int v);
181 void SetMinPage(int v);
182 void SetMaxPage(int v);
183 void SetNoCopies(int v);
184 void SetAllPages(bool flag);
185 void SetSelection(bool flag);
186 void SetCollate(bool flag);
187 void SetPrintToFile(bool flag);
188 void SetSetupDialog(bool flag);
189
190 void EnablePrintToFile(bool flag);
191 void EnableSelection(bool flag);
192 void EnablePageNumbers(bool flag);
193 void EnableHelp(bool flag);
194
195 bool GetEnablePrintToFile() const;
196 bool GetEnableSelection() const;
197 bool GetEnablePageNumbers() const;
198 bool GetEnableHelp() const;
199
200 // Is this data OK for showing the print dialog?
201 bool Ok() const;
202
203
204 wxPrintData& GetPrintData();
205 // %addmethods {
206 // %new wxPrintData* GetPrintData() {
207 // return new wxPrintData(self->GetPrintData()); // force a copy
208 // }
209 // }
210 void SetPrintData(const wxPrintData& printData);
211
212 %pythoncode { def __nonzero__(self): return self.Ok() }
213 };
214
215
216 class wxPrintDialog : public wxDialog {
217 public:
218 %addtofunc wxPrintDialog "self._setOORInfo(self)"
219
220 wxPrintDialog(wxWindow* parent, wxPrintDialogData* data = NULL);
221
222 wxPrintDialogData& GetPrintDialogData();
223
224 %newobject GetPrintDC;
225 wxDC* GetPrintDC();
226 int ShowModal();
227 };
228
229
230 //---------------------------------------------------------------------------
231 //---------------------------------------------------------------------------
232
233
234 enum wxPrinterError
235 {
236 wxPRINTER_NO_ERROR = 0,
237 wxPRINTER_CANCELLED,
238 wxPRINTER_ERROR
239 };
240
241
242 class wxPrinter : public wxObject {
243 public:
244 wxPrinter(wxPrintDialogData* data = NULL);
245 ~wxPrinter();
246
247 void CreateAbortWindow(wxWindow* parent, wxPyPrintout* printout);
248 wxPrintDialogData& GetPrintDialogData();
249 bool Print(wxWindow *parent, wxPyPrintout *printout, int prompt=True);
250 wxDC* PrintDialog(wxWindow *parent);
251 void ReportError(wxWindow *parent, wxPyPrintout *printout, const wxString& message);
252 bool Setup(wxWindow *parent);
253 bool GetAbort();
254
255 static wxPrinterError GetLastError();
256 };
257
258
259 //---------------------------------------------------------------------------
260 // Custom wxPrintout class that knows how to call python
261 %{
262
263
264 // Since this one would be tough and ugly to do with the Macros...
265 void wxPyPrintout::GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo) {
266 bool hadErr = False;
267 bool found;
268
269 wxPyBeginBlockThreads();
270 if ((found = wxPyCBH_findCallback(m_myInst, "GetPageInfo"))) {
271 PyObject* result = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));
272 if (result && PyTuple_Check(result) && PyTuple_Size(result) == 4) {
273 PyObject* val;
274
275 val = PyTuple_GetItem(result, 0);
276 if (PyInt_Check(val)) *minPage = PyInt_AsLong(val);
277 else hadErr = True;
278
279 val = PyTuple_GetItem(result, 1);
280 if (PyInt_Check(val)) *maxPage = PyInt_AsLong(val);
281 else hadErr = True;
282
283 val = PyTuple_GetItem(result, 2);
284 if (PyInt_Check(val)) *pageFrom = PyInt_AsLong(val);
285 else hadErr = True;
286
287 val = PyTuple_GetItem(result, 3);
288 if (PyInt_Check(val)) *pageTo = PyInt_AsLong(val);
289 else hadErr = True;
290 }
291 else
292 hadErr = True;
293
294 if (hadErr) {
295 PyErr_SetString(PyExc_TypeError, "GetPageInfo should return a tuple of 4 integers.");
296 PyErr_Print();
297 }
298 Py_DECREF(result);
299 }
300 wxPyEndBlockThreads();
301 if (! found)
302 wxPrintout::GetPageInfo(minPage, maxPage, pageFrom, pageTo);
303 }
304
305 void wxPyPrintout::base_GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo) {
306 wxPrintout::GetPageInfo(minPage, maxPage, pageFrom, pageTo);
307 }
308
309
310 IMP_PYCALLBACK_BOOL_INTINT(wxPyPrintout, wxPrintout, OnBeginDocument);
311 IMP_PYCALLBACK__(wxPyPrintout, wxPrintout, OnEndDocument);
312 IMP_PYCALLBACK__(wxPyPrintout, wxPrintout, OnBeginPrinting);
313 IMP_PYCALLBACK__(wxPyPrintout, wxPrintout, OnEndPrinting);
314 IMP_PYCALLBACK__(wxPyPrintout, wxPrintout, OnPreparePrinting);
315 IMP_PYCALLBACK_BOOL_INT_pure(wxPyPrintout, wxPrintout, OnPrintPage);
316 IMP_PYCALLBACK_BOOL_INT(wxPyPrintout, wxPrintout, HasPage);
317
318
319 %}
320
321
322 // Now define the custom class for SWIGging
323 %name(Printout) class wxPyPrintout : public wxObject {
324 public:
325 %addtofunc wxPyPrintout "self._setCallbackInfo(self, Printout)"
326
327 wxPyPrintout(const wxString& title = wxPyPrintoutTitleStr);
328 //~wxPyPrintout(); wxPrintPreview object takes ownership...
329
330 void _setCallbackInfo(PyObject* self, PyObject* _class);
331
332
333 wxString GetTitle() const;
334 wxDC* GetDC();
335 void SetDC(wxDC *dc);
336
337 void GetPageSizePixels(int *OUTPUT, int *OUTPUT);
338 void SetPageSizePixels(int w, int h);
339
340 void SetPageSizeMM(int w, int h);
341 void GetPageSizeMM(int *OUTPUT, int *OUTPUT);
342
343 void SetPPIScreen(int x, int y);
344 void GetPPIScreen(int *OUTPUT, int *OUTPUT);
345
346 void SetPPIPrinter(int x, int y);
347 void GetPPIPrinter(int *OUTPUT, int *OUTPUT);
348
349 bool IsPreview();
350 void SetIsPreview(bool p);
351
352
353 bool base_OnBeginDocument(int startPage, int endPage);
354 void base_OnEndDocument();
355 void base_OnBeginPrinting();
356 void base_OnEndPrinting();
357 void base_OnPreparePrinting();
358 void base_GetPageInfo(int *OUTPUT, int *OUTPUT, int *OUTPUT, int *OUTPUT);
359 bool base_HasPage(int page);
360 };
361
362 //---------------------------------------------------------------------------
363
364
365
366 class wxPreviewCanvas: public wxScrolledWindow
367 {
368 public:
369 %addtofunc wxPreviewCanvas "self._self._setOORInfo(self)"
370
371 wxPreviewCanvas(wxPrintPreview *preview,
372 wxWindow *parent,
373 const wxPoint& pos = wxDefaultPosition,
374 const wxSize& size = wxDefaultSize,
375 long style = 0,
376 const wxString& name = wxPyPreviewCanvasNameStr);
377 };
378
379
380 class wxPreviewFrame : public wxFrame {
381 public:
382 %addtofunc wxPreviewFrame "self._self._setOORInfo(self)"
383
384 wxPreviewFrame(wxPrintPreview* preview, wxFrame* parent, const wxString& title,
385 const wxPoint& pos = wxDefaultPosition,
386 const wxSize& size = wxDefaultSize,
387 long style = wxDEFAULT_FRAME_STYLE,
388 const wxString& name = wxPyFrameNameStr);
389
390 void Initialize();
391 void CreateControlBar();
392 void CreateCanvas();
393
394 wxPreviewControlBar* GetControlBar() const;
395 };
396
397
398
399 enum {
400 wxPREVIEW_PRINT,
401 wxPREVIEW_PREVIOUS,
402 wxPREVIEW_NEXT,
403 wxPREVIEW_ZOOM,
404 wxPREVIEW_FIRST,
405 wxPREVIEW_LAST,
406 wxPREVIEW_GOTO,
407 wxPREVIEW_DEFAULT,
408
409 wxID_PREVIEW_CLOSE,
410 wxID_PREVIEW_NEXT,
411 wxID_PREVIEW_PREVIOUS,
412 wxID_PREVIEW_PRINT,
413 wxID_PREVIEW_ZOOM,
414 wxID_PREVIEW_FIRST,
415 wxID_PREVIEW_LAST,
416 wxID_PREVIEW_GOTO
417 };
418
419 class wxPreviewControlBar: public wxPanel
420 {
421 public:
422 %addtofunc wxPreviewControlBar "self._self._setOORInfo(self)"
423
424 wxPreviewControlBar(wxPrintPreview *preview,
425 long buttons,
426 wxWindow *parent,
427 const wxPoint& pos = wxDefaultPosition,
428 const wxSize& size = wxDefaultSize,
429 long style = wxTAB_TRAVERSAL,
430 const wxString& name = wxPyPanelNameStr);
431
432 int GetZoomControl();
433 void SetZoomControl(int zoom);
434 wxPrintPreview* GetPrintPreview();
435
436 void OnNext();
437 void OnPrevious();
438 void OnFirst();
439 void OnLast();
440 void OnGoto();
441 };
442
443
444
445 //---------------------------------------------------------------------------
446
447 class wxPrintPreview : public wxObject {
448 public:
449 wxPrintPreview(wxPyPrintout* printout,
450 wxPyPrintout* printoutForPrinting,
451 wxPrintData* data=NULL);
452
453 virtual bool SetCurrentPage(int pageNum);
454 int GetCurrentPage();
455
456 void SetPrintout(wxPyPrintout *printout);
457 wxPyPrintout *GetPrintout();
458 wxPyPrintout *GetPrintoutForPrinting();
459
460 void SetFrame(wxFrame *frame);
461 void SetCanvas(wxPreviewCanvas *canvas);
462
463 virtual wxFrame *GetFrame();
464 virtual wxPreviewCanvas *GetCanvas();
465
466 // The preview canvas should call this from OnPaint
467 virtual bool PaintPage(wxPreviewCanvas *canvas, wxDC& dc);
468
469 // This draws a blank page onto the preview canvas
470 virtual bool DrawBlankPage(wxPreviewCanvas *canvas, wxDC& dc);
471
472 // This is called by wxPrintPreview to render a page into a wxMemoryDC.
473 virtual bool RenderPage(int pageNum);
474
475 // Adjusts the scrollbars for the current scale
476 virtual void AdjustScrollbars(wxPreviewCanvas *canvas);
477
478 wxPrintDialogData& GetPrintDialogData();
479
480 virtual void SetZoom(int percent);
481 int GetZoom();
482
483 int GetMaxPage();
484 int GetMinPage();
485
486 bool Ok();
487 void SetOk(bool ok);
488
489 virtual bool Print(bool interactive);
490 virtual void DetermineScaling();
491
492 %pythoncode { def __nonzero__(self): return self.Ok() }
493 };
494
495
496
497 //---------------------------------------------------------------------------
498
499 // Python-derivable versions of the above preview classes
500
501 %{
502
503 #define DEC_PYCALLBACK_BOOL_PREWINDC(CBNAME) \
504 bool CBNAME(wxPreviewCanvas* a, wxDC& b); \
505 bool base_##CBNAME(wxPreviewCanvas* a, wxDC& b)
506
507
508 #define IMP_PYCALLBACK_BOOL_PREWINDC(CLASS, PCLASS, CBNAME) \
509 bool CLASS::CBNAME(wxPreviewCanvas* a, wxDC& b) { \
510 bool rval=False; \
511 bool found; \
512 wxPyBeginBlockThreads(); \
513 if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
514 PyObject* win = wxPyMake_wxObject(a); \
515 PyObject* dc = wxPyMake_wxObject(&b); \
516 rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OO)", win, dc));\
517 Py_DECREF(win); \
518 Py_DECREF(dc); \
519 } \
520 wxPyEndBlockThreads(); \
521 if (! found) \
522 rval = PCLASS::CBNAME(a, b); \
523 return rval; \
524 } \
525 bool CLASS::base_##CBNAME(wxPreviewCanvas* a, wxDC& b) { \
526 return PCLASS::CBNAME(a, b); \
527 }
528
529
530
531
532 class wxPyPrintPreview : public wxPrintPreview
533 {
534 DECLARE_CLASS(wxPyPrintPreview)
535 public:
536 wxPyPrintPreview(wxPyPrintout* printout,
537 wxPyPrintout* printoutForPrinting,
538 wxPrintData* data=NULL)
539 : wxPrintPreview(printout, printoutForPrinting, data)
540 {}
541
542 DEC_PYCALLBACK_BOOL_INT(SetCurrentPage);
543 DEC_PYCALLBACK_BOOL_PREWINDC(PaintPage);
544 DEC_PYCALLBACK_BOOL_PREWINDC(DrawBlankPage);
545 DEC_PYCALLBACK_BOOL_INT(RenderPage);
546 DEC_PYCALLBACK_VOID_INT(SetZoom);
547 DEC_PYCALLBACK_BOOL_BOOL(Print);
548 DEC_PYCALLBACK_VOID_(DetermineScaling);
549
550 PYPRIVATE;
551 };
552
553 // Stupid renamed classes... Fix this in 2.5...
554 #if defined(__WXMSW__)
555 IMPLEMENT_CLASS( wxPyPrintPreview, wxWindowsPrintPreview );
556 #elif defined(__WXMAC__)
557 IMPLEMENT_CLASS( wxPyPrintPreview, wxMacPrintPreview );
558 #else
559 IMPLEMENT_CLASS( wxPyPrintPreview, wxPostScriptPrintPreview );
560 #endif
561
562 IMP_PYCALLBACK_BOOL_INT (wxPyPrintPreview, wxPrintPreview, SetCurrentPage);
563 IMP_PYCALLBACK_BOOL_PREWINDC(wxPyPrintPreview, wxPrintPreview, PaintPage);
564 IMP_PYCALLBACK_BOOL_PREWINDC(wxPyPrintPreview, wxPrintPreview, DrawBlankPage);
565 IMP_PYCALLBACK_BOOL_INT (wxPyPrintPreview, wxPrintPreview, RenderPage);
566 IMP_PYCALLBACK_VOID_INT (wxPyPrintPreview, wxPrintPreview, SetZoom);
567 IMP_PYCALLBACK_BOOL_BOOL (wxPyPrintPreview, wxPrintPreview, Print);
568 IMP_PYCALLBACK_VOID_ (wxPyPrintPreview, wxPrintPreview, DetermineScaling);
569 %}
570
571
572 class wxPyPrintPreview : public wxPrintPreview
573 {
574 public:
575 %addtofunc wxPyPrintPreview "self._setCallbackInfo(self, PyPrintPreview)"
576
577 wxPyPrintPreview(wxPyPrintout* printout,
578 wxPyPrintout* printoutForPrinting,
579 wxPrintData* data=NULL);
580
581 void _setCallbackInfo(PyObject* self, PyObject* _class);
582
583 bool base_SetCurrentPage(int pageNum);
584 bool base_PaintPage(wxPreviewCanvas *canvas, wxDC& dc);
585 bool base_DrawBlankPage(wxPreviewCanvas *canvas, wxDC& dc);
586 bool base_RenderPage(int pageNum);
587 void base_SetZoom(int percent);
588 bool base_Print(bool interactive);
589 void base_DetermineScaling();
590 };
591
592
593
594
595 %{
596 class wxPyPreviewFrame : public wxPreviewFrame
597 {
598 DECLARE_CLASS(wxPyPreviewFrame);
599 public:
600 wxPyPreviewFrame(wxPrintPreview* preview, wxFrame* parent,
601 const wxString& title,
602 const wxPoint& pos = wxDefaultPosition,
603 const wxSize& size = wxDefaultSize,
604 long style = wxDEFAULT_FRAME_STYLE,
605 const wxString& name = wxPyFrameNameStr)
606 : wxPreviewFrame(preview, parent, title, pos, size, style, name)
607 {}
608
609 void SetPreviewCanvas(wxPreviewCanvas* canvas) { m_previewCanvas = canvas; }
610 void SetControlBar(wxPreviewControlBar* bar) { m_controlBar = bar; }
611
612 DEC_PYCALLBACK_VOID_(Initialize);
613 DEC_PYCALLBACK_VOID_(CreateCanvas);
614 DEC_PYCALLBACK_VOID_(CreateControlBar);
615
616 PYPRIVATE;
617 };
618
619 IMPLEMENT_CLASS(wxPyPreviewFrame, wxPreviewFrame);
620
621 IMP_PYCALLBACK_VOID_(wxPyPreviewFrame, wxPreviewFrame, Initialize);
622 IMP_PYCALLBACK_VOID_(wxPyPreviewFrame, wxPreviewFrame, CreateCanvas);
623 IMP_PYCALLBACK_VOID_(wxPyPreviewFrame, wxPreviewFrame, CreateControlBar);
624 %}
625
626
627 class wxPyPreviewFrame : public wxPreviewFrame
628 {
629 public:
630 %addtofunc wxPyPreviewFrame "self._setCallbackInfo(self, PyPreviewFrame); self._setOORInfo(self)"
631
632 wxPyPreviewFrame(wxPrintPreview* preview, wxFrame* parent,
633 const wxString& title,
634 const wxPoint& pos = wxDefaultPosition,
635 const wxSize& size = wxDefaultSize,
636 long style = wxDEFAULT_FRAME_STYLE,
637 const wxString& name = wxPyFrameNameStr);
638
639 void _setCallbackInfo(PyObject* self, PyObject* _class);
640
641 void SetPreviewCanvas(wxPreviewCanvas* canvas);
642 void SetControlBar(wxPreviewControlBar* bar);
643
644 void base_Initialize();
645 void base_CreateCanvas();
646 void base_CreateControlBar();
647 };
648
649
650
651
652 %{
653 class wxPyPreviewControlBar : public wxPreviewControlBar
654 {
655 DECLARE_CLASS(wxPyPreviewControlBar);
656 public:
657 wxPyPreviewControlBar(wxPrintPreview *preview,
658 long buttons,
659 wxWindow *parent,
660 const wxPoint& pos = wxDefaultPosition,
661 const wxSize& size = wxDefaultSize,
662 long style = 0,
663 const wxString& name = wxPyPanelNameStr)
664 : wxPreviewControlBar(preview, buttons, parent, pos, size, style, name)
665 {}
666
667 void SetPrintPreview(wxPrintPreview* preview) { m_printPreview = preview; }
668
669 DEC_PYCALLBACK_VOID_(CreateButtons);
670 DEC_PYCALLBACK_VOID_INT(SetZoomControl);
671
672 PYPRIVATE;
673 };
674
675 IMPLEMENT_CLASS(wxPyPreviewControlBar, wxPreviewControlBar);
676 IMP_PYCALLBACK_VOID_(wxPyPreviewControlBar, wxPreviewControlBar, CreateButtons);
677 IMP_PYCALLBACK_VOID_INT(wxPyPreviewControlBar, wxPreviewControlBar, SetZoomControl);
678 %}
679
680
681 class wxPyPreviewControlBar : public wxPreviewControlBar
682 {
683 public:
684 %addtofunc wxPyPreviewControlBar "self._setCallbackInfo(self, PyPreviewControlBar); self._setOORInfo(self)"
685
686 wxPyPreviewControlBar(wxPrintPreview *preview,
687 long buttons,
688 wxWindow *parent,
689 const wxPoint& pos = wxDefaultPosition,
690 const wxSize& size = wxDefaultSize,
691 long style = 0,
692 const wxString& name = wxPyPanelNameStr);
693
694 void _setCallbackInfo(PyObject* self, PyObject* _class);
695
696 void SetPrintPreview(wxPrintPreview* preview);
697
698 void base_CreateButtons();
699 void base_SetZoomControl(int zoom);
700 };
701
702
703 //---------------------------------------------------------------------------
704 //---------------------------------------------------------------------------
705 %init %{
706 wxPyPtrTypeMap_Add("wxPrintout", "wxPyPrintout");
707 %}
708 //---------------------------------------------------------------------------