1//--------------------------------------------------------------------------- 2// This file is generated by wxPython's SIP generator. Do not edit by hand. 3// 4// Copyright: (c) 2018 by Total Control Software 5// License: wxWindows License 6// 7// This file will be included by _core.sip 8// 9//--------------------------------------------------------------------------- 10 11//--------------------------------------------------------------------------- 12 13const int wxPREVIEW_PRINT; 14const int wxPREVIEW_PREVIOUS; 15const int wxPREVIEW_NEXT; 16const int wxPREVIEW_ZOOM; 17const int wxPREVIEW_FIRST; 18const int wxPREVIEW_LAST; 19const int wxPREVIEW_GOTO; 20const int wxPREVIEW_DEFAULT; 21const int wxID_PREVIEW_CLOSE; 22const int wxID_PREVIEW_NEXT; 23const int wxID_PREVIEW_PREVIOUS; 24const int wxID_PREVIEW_PRINT; 25const int wxID_PREVIEW_ZOOM; 26const int wxID_PREVIEW_FIRST; 27const int wxID_PREVIEW_LAST; 28const int wxID_PREVIEW_GOTO; 29const int wxID_PREVIEW_ZOOM_IN; 30const int wxID_PREVIEW_ZOOM_OUT; 31enum wxPrinterError 32{ 33 wxPRINTER_NO_ERROR, 34 wxPRINTER_CANCELLED, 35 wxPRINTER_ERROR 36}; 37 38enum wxPreviewFrameModalityKind 39{ 40 wxPreviewFrame_AppModal, 41 wxPreviewFrame_WindowModal, 42 wxPreviewFrame_NonModal 43}; 44 45class wxPreviewControlBar : wxPanel 46{ 47 %Docstring 48 PreviewControlBar(preview, buttons, parent, pos=DefaultPosition, size=DefaultSize, style=0, name="panel") 49 50 This is the default implementation of the preview control bar, a panel 51 with buttons and a zoom control. 52 %End 53 %TypeHeaderCode 54 #include <wx/print.h> 55 %End 56 57public: 58 wxPreviewControlBar( 59 wxPrintPreview * preview, 60 long buttons, 61 wxWindow * parent /TransferThis/, 62 const wxPoint & pos = wxDefaultPosition, 63 const wxSize & size = wxDefaultSize, 64 long style = 0, 65 const wxString & name = "panel" 66 ); 67 %PreMethodCode 68 if (!wxPyCheckForApp()) return NULL; 69 %End 70 71 ~wxPreviewControlBar(); 72 73 virtual 74 void CreateButtons(); 75 %Docstring 76 CreateButtons() 77 78 Creates buttons, according to value of the button style flags. 79 %End 80 81 wxPrintPreview* GetPrintPreview() const; 82 %Docstring 83 GetPrintPreview() -> PrintPreview 84 85 Gets the print preview object associated with the control bar. 86 %End 87 %MethodCode 88 PyErr_Clear(); 89 Py_BEGIN_ALLOW_THREADS 90 sipRes = _wxPreviewControlBar_GetPrintPreview(sipCpp); 91 Py_END_ALLOW_THREADS 92 if (PyErr_Occurred()) sipIsErr = 1; 93 %End 94 %TypeCode 95 wxPrintPreview* _wxPreviewControlBar_GetPrintPreview(const wxPreviewControlBar* self) 96 { 97 return static_cast<wxPrintPreview*>(self->GetPrintPreview()); 98 } 99 %End 100 101 virtual 102 int GetZoomControl(); 103 %Docstring 104 GetZoomControl() -> int 105 106 Gets the current zoom setting in percent. 107 %End 108 109 virtual 110 void SetZoomControl( 111 int percent 112 ); 113 %Docstring 114 SetZoomControl(percent) 115 116 Sets the zoom control. 117 %End 118 119 public: 120 virtual wxPoint GetClientAreaOrigin() const; 121 virtual bool Validate(); 122 virtual bool TransferDataToWindow(); 123 virtual bool TransferDataFromWindow(); 124 virtual void InitDialog(); 125 virtual bool AcceptsFocus() const; 126 virtual bool AcceptsFocusRecursively() const; 127 virtual bool AcceptsFocusFromKeyboard() const; 128 virtual void AddChild( wxWindowBase *child ); 129 virtual void RemoveChild( wxWindowBase *child ); 130 virtual void InheritAttributes(); 131 virtual bool ShouldInheritColours() const; 132 virtual void OnInternalIdle(); 133 virtual wxWindow *GetMainWindowOfCompositeControl(); 134 virtual bool InformFirstDirection(int direction, int size, int availableOtherDir); 135 virtual void SetCanFocus(bool canFocus); 136 virtual bool Destroy(); 137 virtual void SetValidator( const wxValidator &validator ); 138 virtual wxValidator* GetValidator(); 139 140 141 protected: 142 virtual bool ProcessEvent(wxEvent & event); 143 virtual void DoEnable(bool enable); 144 virtual void DoGetPosition(int *x, int *y) const; 145 virtual void DoGetSize(int *width, int *height) const; 146 virtual void DoGetClientSize(int *width, int *height) const; 147 virtual wxSize DoGetBestSize() const; 148 virtual wxSize DoGetBestClientSize() const; 149 virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags); 150 virtual void DoSetClientSize(int width, int height); 151 virtual void DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH ); 152 virtual wxSize DoGetBorderSize() const; 153 virtual void DoMoveWindow(int x, int y, int width, int height); 154 virtual void DoSetWindowVariant( wxWindowVariant variant); 155 virtual wxBorder GetDefaultBorder() const; 156 virtual wxBorder GetDefaultBorderForControl() const; 157 virtual void DoFreeze(); 158 virtual void DoThaw(); 159 virtual bool HasTransparentBackground(); 160 virtual bool TryBefore(wxEvent& event); 161 virtual bool TryAfter(wxEvent& event); 162 163 164 public: 165 166 167 static 168 wxVisualAttributes GetClassDefaultAttributes( 169 wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL 170 ); 171 %Docstring 172 GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes 173 %End 174 %PreMethodCode 175 if (!wxPyCheckForApp()) return NULL; 176 %End 177 178 public: 179 180 181 %Property(name=PrintPreview, get=GetPrintPreview) 182 %Property(name=ZoomControl, get=GetZoomControl, set=SetZoomControl) 183}; // end of class wxPreviewControlBar 184 185 186class wxPreviewCanvas : wxScrolledWindow 187{ 188 %Docstring 189 PreviewCanvas(preview, parent, pos=DefaultPosition, size=DefaultSize, style=0, name="canvas") 190 191 A preview canvas is the default canvas used by the print preview 192 system to display the preview. 193 %End 194 %TypeHeaderCode 195 #include <wx/print.h> 196 %End 197 198public: 199 wxPreviewCanvas( 200 wxPrintPreview * preview, 201 wxWindow * parent /TransferThis/, 202 const wxPoint & pos = wxDefaultPosition, 203 const wxSize & size = wxDefaultSize, 204 long style = 0, 205 const wxString & name = "canvas" 206 ); 207 %PreMethodCode 208 if (!wxPyCheckForApp()) return NULL; 209 %End 210 211 ~wxPreviewCanvas(); 212 213 void OnPaint( 214 wxPaintEvent & event 215 ); 216 %Docstring 217 OnPaint(event) 218 219 Calls wxPrintPreview::PaintPage() to refresh the canvas. 220 %End 221 222 public: 223 virtual wxPoint GetClientAreaOrigin() const; 224 virtual bool Validate(); 225 virtual bool TransferDataToWindow(); 226 virtual bool TransferDataFromWindow(); 227 virtual void InitDialog(); 228 virtual bool AcceptsFocus() const; 229 virtual bool AcceptsFocusRecursively() const; 230 virtual bool AcceptsFocusFromKeyboard() const; 231 virtual void AddChild( wxWindowBase *child ); 232 virtual void RemoveChild( wxWindowBase *child ); 233 virtual void InheritAttributes(); 234 virtual bool ShouldInheritColours() const; 235 virtual void OnInternalIdle(); 236 virtual wxWindow *GetMainWindowOfCompositeControl(); 237 virtual bool InformFirstDirection(int direction, int size, int availableOtherDir); 238 virtual void SetCanFocus(bool canFocus); 239 virtual bool Destroy(); 240 virtual void SetValidator( const wxValidator &validator ); 241 virtual wxValidator* GetValidator(); 242 243 244 protected: 245 virtual bool ProcessEvent(wxEvent & event); 246 virtual void DoEnable(bool enable); 247 virtual void DoGetPosition(int *x, int *y) const; 248 virtual void DoGetSize(int *width, int *height) const; 249 virtual void DoGetClientSize(int *width, int *height) const; 250 virtual wxSize DoGetBestSize() const; 251 virtual wxSize DoGetBestClientSize() const; 252 virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags); 253 virtual void DoSetClientSize(int width, int height); 254 virtual void DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH ); 255 virtual wxSize DoGetBorderSize() const; 256 virtual void DoMoveWindow(int x, int y, int width, int height); 257 virtual void DoSetWindowVariant( wxWindowVariant variant); 258 virtual wxBorder GetDefaultBorder() const; 259 virtual wxBorder GetDefaultBorderForControl() const; 260 virtual void DoFreeze(); 261 virtual void DoThaw(); 262 virtual bool HasTransparentBackground(); 263 virtual bool TryBefore(wxEvent& event); 264 virtual bool TryAfter(wxEvent& event); 265 266 267 public: 268 269 270 static 271 wxVisualAttributes GetClassDefaultAttributes( 272 wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL 273 ); 274 %Docstring 275 GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes 276 %End 277 %PreMethodCode 278 if (!wxPyCheckForApp()) return NULL; 279 %End 280 281}; // end of class wxPreviewCanvas 282 283 284class wxPreviewFrame : wxFrame 285{ 286 %Docstring 287 PreviewFrame(preview, parent, title="PrintPreview", pos=DefaultPosition, size=DefaultSize, style=DEFAULT_FRAME_STYLE, name=FrameNameStr) 288 289 This class provides the default method of managing the print preview 290 interface. 291 %End 292 %TypeHeaderCode 293 #include <wx/print.h> 294 %End 295 296public: 297 wxPreviewFrame( 298 wxPrintPreview* preview /Transfer/, 299 wxWindow * parent, 300 const wxString & title = "Print Preview", 301 const wxPoint & pos = wxDefaultPosition, 302 const wxSize & size = wxDefaultSize, 303 long style = wxDEFAULT_FRAME_STYLE, 304 const wxString & name = wxFrameNameStr 305 ) /Transfer/; 306 %PreMethodCode 307 if (!wxPyCheckForApp()) return NULL; 308 %End 309 310 ~wxPreviewFrame(); 311 312 virtual 313 void CreateCanvas(); 314 %Docstring 315 CreateCanvas() 316 317 Creates a wxPreviewCanvas. 318 %End 319 320 virtual 321 void CreateControlBar(); 322 %Docstring 323 CreateControlBar() 324 325 Creates a wxPreviewControlBar. 326 %End 327 328 virtual 329 void Initialize(); 330 %Docstring 331 Initialize() 332 333 Initializes the frame elements and prepares for showing it. 334 %End 335 336 void InitializeWithModality( 337 wxPreviewFrameModalityKind kind 338 ); 339 %Docstring 340 InitializeWithModality(kind) 341 342 Initializes the frame elements and prepares for showing it with the 343 given modality kind. 344 %End 345 346 void OnCloseWindow( 347 wxCloseEvent & event 348 ); 349 %Docstring 350 OnCloseWindow(event) 351 352 Enables any disabled frames in the application, and deletes the print 353 preview object, implicitly deleting any printout objects associated 354 with the print preview object. 355 %End 356 357 public: 358 virtual wxPoint GetClientAreaOrigin() const; 359 virtual bool Validate(); 360 virtual bool TransferDataToWindow(); 361 virtual bool TransferDataFromWindow(); 362 virtual void InitDialog(); 363 virtual bool AcceptsFocus() const; 364 virtual bool AcceptsFocusRecursively() const; 365 virtual bool AcceptsFocusFromKeyboard() const; 366 virtual void AddChild( wxWindowBase *child ); 367 virtual void RemoveChild( wxWindowBase *child ); 368 virtual void InheritAttributes(); 369 virtual bool ShouldInheritColours() const; 370 virtual void OnInternalIdle(); 371 virtual wxWindow *GetMainWindowOfCompositeControl(); 372 virtual bool InformFirstDirection(int direction, int size, int availableOtherDir); 373 virtual void SetCanFocus(bool canFocus); 374 virtual bool Destroy(); 375 virtual void SetValidator( const wxValidator &validator ); 376 virtual wxValidator* GetValidator(); 377 378 379 protected: 380 virtual bool ProcessEvent(wxEvent & event); 381 virtual void DoEnable(bool enable); 382 virtual void DoGetPosition(int *x, int *y) const; 383 virtual void DoGetSize(int *width, int *height) const; 384 virtual void DoGetClientSize(int *width, int *height) const; 385 virtual wxSize DoGetBestSize() const; 386 virtual wxSize DoGetBestClientSize() const; 387 virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags); 388 virtual void DoSetClientSize(int width, int height); 389 virtual void DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH ); 390 virtual wxSize DoGetBorderSize() const; 391 virtual void DoMoveWindow(int x, int y, int width, int height); 392 virtual void DoSetWindowVariant( wxWindowVariant variant); 393 virtual wxBorder GetDefaultBorder() const; 394 virtual wxBorder GetDefaultBorderForControl() const; 395 virtual void DoFreeze(); 396 virtual void DoThaw(); 397 virtual bool HasTransparentBackground(); 398 virtual bool TryBefore(wxEvent& event); 399 virtual bool TryAfter(wxEvent& event); 400 401 402 public: 403 404 405 static 406 wxVisualAttributes GetClassDefaultAttributes( 407 wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL 408 ); 409 %Docstring 410 GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes 411 %End 412 %PreMethodCode 413 if (!wxPyCheckForApp()) return NULL; 414 %End 415 416}; // end of class wxPreviewFrame 417 418 419class wxPrintPreview : wxObject 420{ 421 %Docstring 422 PrintPreview(printout, printoutForPrinting=None, data=None) 423 PrintPreview(printout, printoutForPrinting, data) 424 425 Objects of this class manage the print preview process. 426 %End 427 %TypeHeaderCode 428 #include <wx/print.h> 429 %End 430 431public: 432 wxPrintPreview( 433 wxPrintout * printout /Transfer/, 434 wxPrintout * printoutForPrinting /Transfer/ = NULL, 435 wxPrintDialogData * data = NULL 436 ); 437 %PreMethodCode 438 if (!wxPyCheckForApp()) return NULL; 439 %End 440 441 wxPrintPreview( 442 wxPrintout * printout /Transfer/, 443 wxPrintout * printoutForPrinting /Transfer/, 444 wxPrintData * data 445 ); 446 %PreMethodCode 447 if (!wxPyCheckForApp()) return NULL; 448 %End 449 450 ~wxPrintPreview(); 451 452 virtual 453 wxPreviewCanvas * GetCanvas() const; 454 %Docstring 455 GetCanvas() -> PreviewCanvas 456 457 Gets the preview window used for displaying the print preview image. 458 %End 459 460 virtual 461 int GetCurrentPage() const; 462 %Docstring 463 GetCurrentPage() -> int 464 465 Gets the page currently being previewed. 466 %End 467 468 virtual 469 wxFrame * GetFrame() const; 470 %Docstring 471 GetFrame() -> Frame 472 473 Gets the frame used for displaying the print preview canvas and 474 control bar. 475 %End 476 477 virtual 478 int GetMaxPage() const; 479 %Docstring 480 GetMaxPage() -> int 481 482 Returns the maximum page number. 483 %End 484 485 virtual 486 int GetMinPage() const; 487 %Docstring 488 GetMinPage() -> int 489 490 Returns the minimum page number. 491 %End 492 493 virtual 494 wxPrintout * GetPrintout() const; 495 %Docstring 496 GetPrintout() -> Printout 497 498 Gets the preview printout object associated with the wxPrintPreview 499 object. 500 %End 501 502 virtual 503 wxPrintout * GetPrintoutForPrinting() const; 504 %Docstring 505 GetPrintoutForPrinting() -> Printout 506 507 Gets the printout object to be used for printing from within the 508 preview interface, or NULL if none exists. 509 %End 510 511 virtual 512 bool IsOk() const; 513 %Docstring 514 IsOk() -> bool 515 516 Returns true if the wxPrintPreview is valid, false otherwise. 517 %End 518 519 virtual 520 bool PaintPage( 521 wxPreviewCanvas * canvas, 522 wxDC & dc 523 ); 524 %Docstring 525 PaintPage(canvas, dc) -> bool 526 527 This refreshes the preview window with the preview image. 528 %End 529 530 virtual 531 bool Print( 532 bool prompt 533 ); 534 %Docstring 535 Print(prompt) -> bool 536 537 Invokes the print process using the second wxPrintout object supplied 538 in the wxPrintPreview constructor. 539 %End 540 541 virtual 542 bool RenderPage( 543 int pageNum 544 ); 545 %Docstring 546 RenderPage(pageNum) -> bool 547 548 Renders a page into a wxMemoryDC. 549 %End 550 551 virtual 552 void SetCanvas( 553 wxPreviewCanvas * window 554 ); 555 %Docstring 556 SetCanvas(window) 557 558 Sets the window to be used for displaying the print preview image. 559 %End 560 561 virtual 562 bool SetCurrentPage( 563 int pageNum 564 ); 565 %Docstring 566 SetCurrentPage(pageNum) -> bool 567 568 Sets the current page to be previewed. 569 %End 570 571 virtual 572 void SetFrame( 573 wxFrame * frame 574 ); 575 %Docstring 576 SetFrame(frame) 577 578 Sets the frame to be used for displaying the print preview canvas and 579 control bar. 580 %End 581 582 virtual 583 void SetPrintout( 584 wxPrintout * printout 585 ); 586 %Docstring 587 SetPrintout(printout) 588 589 Associates a printout object with the wxPrintPreview object. 590 %End 591 592 virtual 593 void SetZoom( 594 int percent 595 ); 596 %Docstring 597 SetZoom(percent) 598 599 Sets the percentage preview zoom, and refreshes the preview canvas 600 accordingly. 601 %End 602 603 private: 604 wxPrintPreview(const wxPrintPreview&); 605 606 607 int __nonzero__(); 608 %Docstring 609 __nonzero__() -> int 610 %End 611 %MethodCode 612 PyErr_Clear(); 613 Py_BEGIN_ALLOW_THREADS 614 sipRes = _wxPrintPreview___nonzero__(sipCpp); 615 Py_END_ALLOW_THREADS 616 if (PyErr_Occurred()) sipIsErr = 1; 617 %End 618 %TypeCode 619 int _wxPrintPreview___nonzero__(wxPrintPreview* self) 620 { 621 return self->IsOk(); 622 } 623 %End 624 625 int __bool__(); 626 %Docstring 627 __bool__() -> int 628 %End 629 %MethodCode 630 PyErr_Clear(); 631 Py_BEGIN_ALLOW_THREADS 632 sipRes = _wxPrintPreview___bool__(sipCpp); 633 Py_END_ALLOW_THREADS 634 if (PyErr_Occurred()) sipIsErr = 1; 635 %End 636 %TypeCode 637 int _wxPrintPreview___bool__(wxPrintPreview* self) 638 { 639 return self->IsOk(); 640 } 641 %End 642 643 public: 644 645 646 %Property(name=Canvas, get=GetCanvas, set=SetCanvas) 647 %Property(name=CurrentPage, get=GetCurrentPage, set=SetCurrentPage) 648 %Property(name=Frame, get=GetFrame, set=SetFrame) 649 %Property(name=MaxPage, get=GetMaxPage) 650 %Property(name=MinPage, get=GetMinPage) 651 %Property(name=Printout, get=GetPrintout, set=SetPrintout) 652 %Property(name=PrintoutForPrinting, get=GetPrintoutForPrinting) 653}; // end of class wxPrintPreview 654 655 656%Extract(id=pycode_core) 657PrintPreview.Ok = wx.deprecated(PrintPreview.IsOk, 'Use IsOk instead.') 658 659%End 660 661class wxPrinter : wxObject 662{ 663 %Docstring 664 Printer(data=None) 665 666 This class represents the Windows or PostScript printer, and is the 667 vehicle through which printing may be launched by an application. 668 %End 669 %TypeHeaderCode 670 #include <wx/print.h> 671 %End 672 673public: 674 wxPrinter( 675 wxPrintDialogData * data = NULL 676 ); 677 %PreMethodCode 678 if (!wxPyCheckForApp()) return NULL; 679 %End 680 681 virtual 682 wxPrintAbortDialog * CreateAbortWindow( 683 wxWindow * parent, 684 wxPrintout * printout 685 ); 686 %Docstring 687 CreateAbortWindow(parent, printout) -> PrintAbortDialog 688 689 Creates the default printing abort window, with a cancel button. 690 %End 691 692 bool GetAbort() const; 693 %Docstring 694 GetAbort() -> bool 695 696 Returns true if the user has aborted the print job. 697 %End 698 699 virtual 700 wxPrintDialogData & GetPrintDialogData() const; 701 %Docstring 702 GetPrintDialogData() -> PrintDialogData 703 704 Returns the print data associated with the printer object. 705 %End 706 707 virtual 708 bool Print( 709 wxWindow * parent, 710 wxPrintout * printout, 711 bool prompt = true 712 ); 713 %Docstring 714 Print(parent, printout, prompt=True) -> bool 715 716 Starts the printing process. 717 %End 718 719 virtual 720 wxDC * PrintDialog( 721 wxWindow * parent 722 ); 723 %Docstring 724 PrintDialog(parent) -> DC 725 726 Invokes the print dialog. 727 %End 728 729 virtual 730 void ReportError( 731 wxWindow * parent, 732 wxPrintout * printout, 733 const wxString & message 734 ); 735 %Docstring 736 ReportError(parent, printout, message) 737 738 Default error-reporting function. 739 %End 740 741 virtual 742 bool Setup( 743 wxWindow * parent 744 ); 745 %Docstring 746 Setup(parent) -> bool 747 748 Invokes the print setup dialog. 749 %End 750 751 static 752 wxPrinterError GetLastError(); 753 %Docstring 754 GetLastError() -> PrinterError 755 756 Return last error. 757 %End 758 759 private: 760 wxPrinter(const wxPrinter&); 761 762 763 public: 764 765 766 %Property(name=Abort, get=GetAbort) 767 %Property(name=PrintDialogData, get=GetPrintDialogData) 768}; // end of class wxPrinter 769 770 771class wxPrintout : wxObject 772{ 773 %Docstring 774 Printout(title="Printout") 775 776 This class encapsulates the functionality of printing out an 777 application document. 778 %End 779 %TypeHeaderCode 780 #include <wx/print.h> 781 %End 782 783public: 784 wxPrintout( 785 const wxString & title = "Printout" 786 ); 787 %PreMethodCode 788 if (!wxPyCheckForApp()) return NULL; 789 %End 790 791 virtual 792 ~wxPrintout(); 793 794 void FitThisSizeToPage( 795 const wxSize & imageSize 796 ); 797 %Docstring 798 FitThisSizeToPage(imageSize) 799 800 Set the user scale and device origin of the wxDC associated with this 801 wxPrintout so that the given image size fits entirely within the page 802 rectangle and the origin is at the top left corner of the page 803 rectangle. 804 %End 805 806 void FitThisSizeToPageMargins( 807 const wxSize & imageSize, 808 const wxPageSetupDialogData & pageSetupData 809 ); 810 %Docstring 811 FitThisSizeToPageMargins(imageSize, pageSetupData) 812 813 Set the user scale and device origin of the wxDC associated with this 814 wxPrintout so that the given image size fits entirely within the page 815 margins set in the given wxPageSetupDialogData object. 816 %End 817 818 void FitThisSizeToPaper( 819 const wxSize & imageSize 820 ); 821 %Docstring 822 FitThisSizeToPaper(imageSize) 823 824 Set the user scale and device origin of the wxDC associated with this 825 wxPrintout so that the given image size fits entirely within the paper 826 and the origin is at the top left corner of the paper. 827 %End 828 829 wxDC * GetDC() const; 830 %Docstring 831 GetDC() -> DC 832 833 Returns the device context associated with the printout (given to the 834 printout at start of printing or previewing). 835 %End 836 837 wxRect GetLogicalPageMarginsRect( 838 const wxPageSetupDialogData & pageSetupData 839 ) const; 840 %Docstring 841 GetLogicalPageMarginsRect(pageSetupData) -> Rect 842 843 Return the rectangle corresponding to the page margins specified by 844 the given wxPageSetupDialogData object in the associated wxDC's 845 logical coordinates for the current user scale and device origin. 846 %End 847 848 wxRect GetLogicalPageRect() const; 849 %Docstring 850 GetLogicalPageRect() -> Rect 851 852 Return the rectangle corresponding to the page in the associated wxDC 853 's logical coordinates for the current user scale and device origin. 854 %End 855 856 wxRect GetLogicalPaperRect() const; 857 %Docstring 858 GetLogicalPaperRect() -> Rect 859 860 Return the rectangle corresponding to the paper in the associated wxDC 861 's logical coordinates for the current user scale and device origin. 862 %End 863 864 void GetPPIPrinter( 865 int * w /Out/, 866 int * h /Out/ 867 ) const; 868 %Docstring 869 GetPPIPrinter() -> (w, h) 870 871 Returns the number of pixels per logical inch of the printer device 872 context. 873 %End 874 875 void GetPPIScreen( 876 int * w /Out/, 877 int * h /Out/ 878 ) const; 879 %Docstring 880 GetPPIScreen() -> (w, h) 881 882 Returns the number of pixels per logical inch of the screen device 883 context. 884 %End 885 886 virtual 887 void GetPageInfo( 888 int * minPage /Out/, 889 int * maxPage /Out/, 890 int * pageFrom /Out/, 891 int * pageTo /Out/ 892 ); 893 %Docstring 894 GetPageInfo() -> (minPage, maxPage, pageFrom, pageTo) 895 896 Called by the framework to obtain information from the application 897 about minimum and maximum page values that the user can select, and 898 the required page range to be printed. 899 %End 900 901 void GetPageSizeMM( 902 int * w /Out/, 903 int * h /Out/ 904 ) const; 905 %Docstring 906 GetPageSizeMM() -> (w, h) 907 908 Returns the size of the printer page in millimetres. 909 %End 910 911 void GetPageSizePixels( 912 int * w /Out/, 913 int * h /Out/ 914 ) const; 915 %Docstring 916 GetPageSizePixels() -> (w, h) 917 918 Returns the size of the printer page in pixels, called the page 919 rectangle. 920 %End 921 922 wxRect GetPaperRectPixels() const; 923 %Docstring 924 GetPaperRectPixels() -> Rect 925 926 Returns the rectangle that corresponds to the entire paper in pixels, 927 called the paper rectangle. 928 %End 929 930 virtual 931 wxString GetTitle() const; 932 %Docstring 933 GetTitle() -> String 934 935 Returns the title of the printout. 936 %End 937 938 virtual 939 bool HasPage( 940 int pageNum 941 ); 942 %Docstring 943 HasPage(pageNum) -> bool 944 945 Should be overridden to return true if the document has this page, or 946 false if not. 947 %End 948 949 virtual 950 bool IsPreview() const; 951 %Docstring 952 IsPreview() -> bool 953 954 Returns true if the printout is currently being used for previewing. 955 %End 956 957 wxPrintPreview * GetPreview() const; 958 %Docstring 959 GetPreview() -> PrintPreview 960 961 Returns the associated preview object if any. 962 %End 963 964 void MapScreenSizeToDevice(); 965 %Docstring 966 MapScreenSizeToDevice() 967 968 Set the user scale and device origin of the wxDC associated with this 969 wxPrintout so that one screen pixel maps to one device pixel on the 970 DC. 971 %End 972 973 void MapScreenSizeToPage(); 974 %Docstring 975 MapScreenSizeToPage() 976 977 This sets the user scale of the wxDC associated with this wxPrintout 978 to the same scale as MapScreenSizeToPaper() but sets the logical 979 origin to the top left corner of the page rectangle. 980 %End 981 982 void MapScreenSizeToPageMargins( 983 const wxPageSetupDialogData & pageSetupData 984 ); 985 %Docstring 986 MapScreenSizeToPageMargins(pageSetupData) 987 988 This sets the user scale of the wxDC associated with this wxPrintout 989 to the same scale as MapScreenSizeToPageMargins() but sets the logical 990 origin to the top left corner of the page margins specified by the 991 given wxPageSetupDialogData object. 992 %End 993 994 void MapScreenSizeToPaper(); 995 %Docstring 996 MapScreenSizeToPaper() 997 998 Set the user scale and device origin of the wxDC associated with this 999 wxPrintout so that the printed page matches the screen size as closely 1000 as possible and the logical origin is in the top left corner of the 1001 paper rectangle. 1002 %End 1003 1004 void OffsetLogicalOrigin( 1005 wxCoord xoff, 1006 wxCoord yoff 1007 ); 1008 %Docstring 1009 OffsetLogicalOrigin(xoff, yoff) 1010 1011 Shift the device origin by an amount specified in logical coordinates. 1012 %End 1013 1014 virtual 1015 bool OnBeginDocument( 1016 int startPage, 1017 int endPage 1018 ); 1019 %Docstring 1020 OnBeginDocument(startPage, endPage) -> bool 1021 1022 Called by the framework at the start of document printing. 1023 %End 1024 1025 virtual 1026 void OnBeginPrinting(); 1027 %Docstring 1028 OnBeginPrinting() 1029 1030 Called by the framework at the start of printing. 1031 %End 1032 1033 virtual 1034 void OnEndDocument(); 1035 %Docstring 1036 OnEndDocument() 1037 1038 Called by the framework at the end of document printing. 1039 %End 1040 1041 virtual 1042 void OnEndPrinting(); 1043 %Docstring 1044 OnEndPrinting() 1045 1046 Called by the framework at the end of printing. 1047 %End 1048 1049 virtual 1050 void OnPreparePrinting(); 1051 %Docstring 1052 OnPreparePrinting() 1053 1054 Called once by the framework before any other demands are made of the 1055 wxPrintout object. 1056 %End 1057 1058 virtual 1059 bool OnPrintPage( 1060 int pageNum 1061 ) = 0; 1062 %Docstring 1063 OnPrintPage(pageNum) -> bool 1064 1065 Called by the framework when a page should be printed. 1066 %End 1067 1068 void SetLogicalOrigin( 1069 wxCoord x, 1070 wxCoord y 1071 ); 1072 %Docstring 1073 SetLogicalOrigin(x, y) 1074 1075 Set the device origin of the associated wxDC so that the current 1076 logical point becomes the new logical origin. 1077 %End 1078 1079 private: 1080 wxPrintout(const wxPrintout&); 1081 1082 1083 public: 1084 1085 1086 %Property(name=DC, get=GetDC) 1087 %Property(name=LogicalPageRect, get=GetLogicalPageRect) 1088 %Property(name=LogicalPaperRect, get=GetLogicalPaperRect) 1089 %Property(name=PaperRectPixels, get=GetPaperRectPixels) 1090 %Property(name=Preview, get=GetPreview) 1091 %Property(name=Title, get=GetTitle) 1092}; // end of class wxPrintout 1093 1094 1095class wxPrintAbortDialog : wxDialog 1096{ 1097 %Docstring 1098 PrintAbortDialog(parent, documentTitle, pos=DefaultPosition, size=DefaultSize, style=DEFAULT_DIALOG_STYLE, name="dialog") 1099 1100 The dialog created by default by the print framework that enables 1101 aborting the printing process. 1102 %End 1103 %TypeHeaderCode 1104 #include <wx/print.h> 1105 %End 1106 1107public: 1108 wxPrintAbortDialog( 1109 wxWindow * parent, 1110 const wxString & documentTitle, 1111 const wxPoint & pos = wxDefaultPosition, 1112 const wxSize & size = wxDefaultSize, 1113 long style = wxDEFAULT_DIALOG_STYLE, 1114 const wxString & name = "dialog" 1115 ) /Transfer/; 1116 %PreMethodCode 1117 if (!wxPyCheckForApp()) return NULL; 1118 %End 1119 1120 void SetProgress( 1121 int currentPage, 1122 int totalPages, 1123 int currentCopy, 1124 int totalCopies 1125 ); 1126 %Docstring 1127 SetProgress(currentPage, totalPages, currentCopy, totalCopies) 1128 %End 1129 1130 public: 1131 virtual wxPoint GetClientAreaOrigin() const; 1132 virtual bool Validate(); 1133 virtual bool TransferDataToWindow(); 1134 virtual bool TransferDataFromWindow(); 1135 virtual void InitDialog(); 1136 virtual bool AcceptsFocus() const; 1137 virtual bool AcceptsFocusRecursively() const; 1138 virtual bool AcceptsFocusFromKeyboard() const; 1139 virtual void AddChild( wxWindowBase *child ); 1140 virtual void RemoveChild( wxWindowBase *child ); 1141 virtual void InheritAttributes(); 1142 virtual bool ShouldInheritColours() const; 1143 virtual void OnInternalIdle(); 1144 virtual wxWindow *GetMainWindowOfCompositeControl(); 1145 virtual bool InformFirstDirection(int direction, int size, int availableOtherDir); 1146 virtual void SetCanFocus(bool canFocus); 1147 virtual bool Destroy(); 1148 virtual void SetValidator( const wxValidator &validator ); 1149 virtual wxValidator* GetValidator(); 1150 1151 1152 protected: 1153 virtual bool ProcessEvent(wxEvent & event); 1154 virtual void DoEnable(bool enable); 1155 virtual void DoGetPosition(int *x, int *y) const; 1156 virtual void DoGetSize(int *width, int *height) const; 1157 virtual void DoGetClientSize(int *width, int *height) const; 1158 virtual wxSize DoGetBestSize() const; 1159 virtual wxSize DoGetBestClientSize() const; 1160 virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags); 1161 virtual void DoSetClientSize(int width, int height); 1162 virtual void DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH ); 1163 virtual wxSize DoGetBorderSize() const; 1164 virtual void DoMoveWindow(int x, int y, int width, int height); 1165 virtual void DoSetWindowVariant( wxWindowVariant variant); 1166 virtual wxBorder GetDefaultBorder() const; 1167 virtual wxBorder GetDefaultBorderForControl() const; 1168 virtual void DoFreeze(); 1169 virtual void DoThaw(); 1170 virtual bool HasTransparentBackground(); 1171 virtual bool TryBefore(wxEvent& event); 1172 virtual bool TryAfter(wxEvent& event); 1173 1174 1175 public: 1176 1177 1178 static 1179 wxVisualAttributes GetClassDefaultAttributes( 1180 wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL 1181 ); 1182 %Docstring 1183 GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes 1184 %End 1185 %PreMethodCode 1186 if (!wxPyCheckForApp()) return NULL; 1187 %End 1188 1189}; // end of class wxPrintAbortDialog 1190 1191 1192%Extract(id=pycode_core) 1193PyPrintPreview = wx.deprecated(PrintPreview, 'Use PrintPreview instead.') 1194 1195%End 1196 1197%Extract(id=pycode_core) 1198PyPreviewFrame = wx.deprecated(PreviewFrame, 'Use PreviewFrame instead.') 1199 1200%End 1201 1202%Extract(id=pycode_core) 1203PyPreviewControlBar = wx.deprecated(PreviewControlBar, 'Use PreviewControlBar instead.') 1204 1205%End 1206 1207%Extract(id=pycode_core) 1208PyPrintout = wx.deprecated(Printout, 'Use Printout instead.') 1209 1210%End 1211 1212 1213//--------------------------------------------------------------------------- 1214 1215