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