1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG interface defs for wxDC and releated classes
7 // Created: 7-July-1997
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
17 //---------------------------------------------------------------------------
20 #include "wx/wxPython/pydrawxxx.h"
23 // TODO: 1. wrappers for wxDrawObject and wxDC::DrawObject
26 //---------------------------------------------------------------------------
28 %typemap(in) (int points, wxPoint* points_array ) {
29 $2 = wxPoint_LIST_helper($input, &$1);
30 if ($2 == NULL) SWIG_fail;
32 %typemap(freearg) (int points, wxPoint* points_array ) {
37 //---------------------------------------------------------------------------
41 // wxDC is the device context - object on which any drawing is done
42 class wxDC : public wxObject {
44 // wxDC(); **** abstract base class, can't instantiate.
48 virtual void BeginDrawing();
49 virtual void EndDrawing();
52 // virtual void DrawObject(wxDrawObject* drawobject);
56 #if defined(wxUSE_DC_OLD_METHODS)
58 bool FloodFill(wxCoord x, wxCoord y, const wxColour& col, int style = wxFLOOD_SURFACE);
59 //bool GetPixel(wxCoord x, wxCoord y, wxColour *col) const;
61 wxColour GetPixel(wxCoord x, wxCoord y) {
63 self->GetPixel(x, y, &col);
67 void DrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
68 void CrossHair(wxCoord x, wxCoord y);
69 void DrawArc(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2, wxCoord xc, wxCoord yc);
70 void DrawCheckMark(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
71 void DrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h, double sa, double ea);
72 void DrawPoint(wxCoord x, wxCoord y);
73 void DrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
74 %name(DrawRectangleRect)void DrawRectangle(const wxRect& rect);
75 void DrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius);
76 void DrawCircle(wxCoord x, wxCoord y, wxCoord radius);
77 void DrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
78 void DrawIcon(const wxIcon& icon, wxCoord x, wxCoord y);
79 void DrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask = False);
80 void DrawText(const wxString& text, wxCoord x, wxCoord y);
81 void DrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle);
82 bool Blit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
83 wxDC *source, wxCoord xsrc, wxCoord ysrc,
84 int rop = wxCOPY, bool useMask = False,
85 wxCoord xsrcMask = -1, wxCoord ysrcMask = -1);
91 %name(FloodFillXY) bool FloodFill(wxCoord x, wxCoord y, const wxColour& col, int style = wxFLOOD_SURFACE);
92 bool FloodFill(const wxPoint& pt, const wxColour& col, int style = wxFLOOD_SURFACE);
94 //%name(GetPixelXY) bool GetPixel(wxCoord x, wxCoord y, wxColour *col) const;
95 //bool GetPixel(const wxPoint& pt, wxColour *col) const;
97 wxColour GetPixelXY(wxCoord x, wxCoord y) {
99 self->GetPixel(x, y, &col);
102 wxColour GetPixel(const wxPoint& pt) {
104 self->GetPixel(pt, &col);
108 %name(DrawLineXY) void DrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
109 void DrawLine(const wxPoint& pt1, const wxPoint& pt2);
111 %name(CrossHairXY) void CrossHair(wxCoord x, wxCoord y);
112 void CrossHair(const wxPoint& pt);
114 %name(DrawArcXY) void DrawArc(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2, wxCoord xc, wxCoord yc);
115 void DrawArc(const wxPoint& pt1, const wxPoint& pt2, const wxPoint& centre);
117 %name(DrawCheckMarkXY) void DrawCheckMark(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
118 void DrawCheckMark(const wxRect& rect);
120 %name(DrawEllipticArcXY) void DrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h, double sa, double ea);
121 void DrawEllipticArc(const wxPoint& pt, const wxSize& sz, double sa, double ea);
123 %name(DrawPointXY) void DrawPoint(wxCoord x, wxCoord y);
124 void DrawPoint(const wxPoint& pt);
126 %name(DrawRectangleXY) void DrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
127 void DrawRectangle(const wxPoint& pt, const wxSize& sz);
128 %name(DrawRectangleRect) void DrawRectangle(const wxRect& rect);
130 %name(DrawRoundedRectangleXY) void DrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius);
131 void DrawRoundedRectangle(const wxPoint& pt, const wxSize& sz, double radius);
132 %name(DrawRoundedRectangleRect) void DrawRoundedRectangle(const wxRect& r, double radius);
134 %name(DrawCircleXY) void DrawCircle(wxCoord x, wxCoord y, wxCoord radius);
135 void DrawCircle(const wxPoint& pt, wxCoord radius);
137 %name(DrawEllipseXY) void DrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
138 void DrawEllipse(const wxPoint& pt, const wxSize& sz);
139 %name(DrawEllipseRect) void DrawEllipse(const wxRect& rect);
141 %name(DrawIconXY) void DrawIcon(const wxIcon& icon, wxCoord x, wxCoord y);
142 void DrawIcon(const wxIcon& icon, const wxPoint& pt);
144 %name(DrawBitmapXY) void DrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask = False);
145 void DrawBitmap(const wxBitmap &bmp, const wxPoint& pt, bool useMask = False);
147 %name(DrawTextXY) void DrawText(const wxString& text, wxCoord x, wxCoord y);
148 void DrawText(const wxString& text, const wxPoint& pt);
150 %name(DrawRotatedTextXY) void DrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle);
151 void DrawRotatedText(const wxString& text, const wxPoint& pt, double angle);
154 %name(BlitXY) bool Blit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
155 wxDC *source, wxCoord xsrc, wxCoord ysrc,
156 int rop = wxCOPY, bool useMask = False,
157 wxCoord xsrcMask = -1, wxCoord ysrcMask = -1);
158 bool Blit(const wxPoint& destPt, const wxSize& sz,
159 wxDC *source, const wxPoint& srcPt,
160 int rop = wxCOPY, bool useMask = False,
161 const wxPoint& srcPtMask = wxDefaultPosition);
165 void DrawLines(int points, wxPoint* points_array, wxCoord xoffset = 0, wxCoord yoffset = 0);
167 void DrawPolygon(int points, wxPoint* points_array,
168 wxCoord xoffset = 0, wxCoord yoffset = 0,
169 int fillStyle = wxODDEVEN_RULE);
171 // TODO: Figure out a good typemap for this...
172 // Convert the first 3 args from a sequence of sequences?
173 // void DrawPolyPolygon(int n, int count[], wxPoint points[],
174 // wxCoord xoffset = 0, wxCoord yoffset = 0,
175 // int fillStyle = wxODDEVEN_RULE);
178 // this version puts both optional bitmap and the text into the given
179 // rectangle and aligns is as specified by alignment parameter; it also
180 // will emphasize the character with the given index if it is != -1 and
181 // return the bounding rectangle if required
182 void DrawLabel(const wxString& text, const wxRect& rect,
183 int alignment = wxALIGN_LEFT | wxALIGN_TOP,
184 int indexAccel = -1);
186 wxRect DrawImageLabel(const wxString& text,
187 const wxBitmap& image,
189 int alignment = wxALIGN_LEFT | wxALIGN_TOP,
190 int indexAccel = -1) {
192 self->DrawLabel(text, image, rect, alignment, indexAccel, &rv);
199 void DrawSpline(int points, wxPoint* points_array);
203 // global DC operations
204 // --------------------
206 virtual void Clear();
208 virtual bool StartDoc(const wxString& message);
209 virtual void EndDoc();
211 virtual void StartPage();
212 virtual void EndPage();
215 // set objects to use for drawing
216 // ------------------------------
218 virtual void SetFont(const wxFont& font);
219 virtual void SetPen(const wxPen& pen);
220 virtual void SetBrush(const wxBrush& brush);
221 virtual void SetBackground(const wxBrush& brush);
222 virtual void SetBackgroundMode(int mode);
223 virtual void SetPalette(const wxPalette& palette);
229 %name(SetClippingRegionXY)void SetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
230 void SetClippingRegion(const wxPoint& pt, const wxSize& sz);
231 %name(SetClippingRect) void SetClippingRegion(const wxRect& rect);
232 %name(SetClippingRegionAsRegion) void SetClippingRegion(const wxRegion& region);
234 virtual void DestroyClippingRegion();
237 void, GetClippingBox(wxCoord *OUTPUT, wxCoord *OUTPUT, wxCoord *OUTPUT, wxCoord *OUTPUT) const,
238 "GetClippingBox() -> (x, y, width, height)");
241 wxRect GetClippingRect() {
243 self->GetClippingBox(rect);
253 virtual wxCoord GetCharHeight() const;
254 virtual wxCoord GetCharWidth() const;
258 void, GetTextExtent(const wxString& string, wxCoord *OUTPUT, wxCoord *OUTPUT),
259 "GetTextExtent(wxString string) -> (width, height)",
260 "Get the width and height of the text using the current font.\n"
261 "Only works for single line strings.");
263 void, GetTextExtent(const wxString& string,
264 wxCoord *OUTPUT, wxCoord *OUTPUT, wxCoord *OUTPUT, wxCoord* OUTPUT,
265 wxFont* font = NULL),
266 "GetFullTextExtent(wxString string, Font font=None) ->\n (width, height, descent, externalLeading)",
267 "Get the width, height, decent and leading of the text using the current or specified font.\n"
268 "Only works for single line strings.",
272 // works for single as well as multi-line strings
274 void, GetMultiLineTextExtent(const wxString& text,
275 wxCoord *OUTPUT, wxCoord *OUTPUT, wxCoord *OUTPUT,
276 wxFont *font = NULL),
277 "GetMultiLineTextExtent(wxString string, Font font=None) ->\n (width, height, descent, externalLeading)",
278 "Get the width, height, decent and leading of the text using the current or specified font.\n"
279 "Works for single as well as multi-line strings.");
283 wxArrayInt GetPartialTextExtents(const wxString& text) {
285 self->GetPartialTextExtents(text, widths);
291 // size and resolution
292 // -------------------
294 DocStr(GetSize, "Get the DC size in device units.");
297 void, GetSize( int *OUTPUT, int *OUTPUT ),
298 "GetSizeTuple() -> (width, height)",
302 DocStr(GetSizeMM, "Get the DC size in milimeters.");
303 wxSize GetSizeMM() const;
305 void, GetSizeMM( int *OUTPUT, int *OUTPUT ) const,
306 "GetSizeMMTuple() -> (width, height)",
311 // coordinates conversions
312 // -----------------------
314 // This group of functions does actual conversion of the input, as you'd
316 wxCoord DeviceToLogicalX(wxCoord x) const;
317 wxCoord DeviceToLogicalY(wxCoord y) const;
318 wxCoord DeviceToLogicalXRel(wxCoord x) const;
319 wxCoord DeviceToLogicalYRel(wxCoord y) const;
320 wxCoord LogicalToDeviceX(wxCoord x) const;
321 wxCoord LogicalToDeviceY(wxCoord y) const;
322 wxCoord LogicalToDeviceXRel(wxCoord x) const;
323 wxCoord LogicalToDeviceYRel(wxCoord y) const;
325 // query DC capabilities
326 // ---------------------
328 virtual bool CanDrawBitmap() const;
329 virtual bool CanGetTextExtent() const;
332 virtual int GetDepth() const;
334 // Resolution in Pixels per inch
335 virtual wxSize GetPPI() const;
337 virtual bool Ok() const;
341 int GetBackgroundMode() const;
342 const wxBrush& GetBackground() const;
343 const wxBrush& GetBrush() const;
344 const wxFont& GetFont() const;
345 const wxPen& GetPen() const;
346 const wxColour& GetTextBackground() const;
347 const wxColour& GetTextForeground() const;
349 virtual void SetTextForeground(const wxColour& colour);
350 virtual void SetTextBackground(const wxColour& colour);
352 int GetMapMode() const;
353 virtual void SetMapMode(int mode);
357 virtual void, GetUserScale(double *OUTPUT, double *OUTPUT) const,
358 "GetUserScale() -> (xScale, yScale)");
360 virtual void SetUserScale(double x, double y);
364 virtual void, GetLogicalScale(double *OUTPUT, double *OUTPUT),
365 "GetLogicalScale() -> (xScale, yScale)");
367 virtual void SetLogicalScale(double x, double y);
370 wxPoint GetLogicalOrigin() const;
372 void, GetLogicalOrigin(wxCoord *OUTPUT, wxCoord *OUTPUT) const,
373 "GetLogicalOriginTuple() -> (x,y)",
374 GetLogicalOriginTuple);
376 virtual void SetLogicalOrigin(wxCoord x, wxCoord y);
379 wxPoint GetDeviceOrigin() const;
381 void, GetDeviceOrigin(wxCoord *OUTPUT, wxCoord *OUTPUT) const,
382 "GetDeviceOriginTuple() -> (x,y)",
383 GetDeviceOriginTuple);
385 virtual void SetDeviceOrigin(wxCoord x, wxCoord y);
387 virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp);
389 int GetLogicalFunction() const;
390 virtual void SetLogicalFunction(int function);
392 virtual void SetOptimization(bool opt);
393 virtual bool GetOptimization();
399 virtual void CalcBoundingBox(wxCoord x, wxCoord y);
400 void ResetBoundingBox();
402 // Get the final bounding box of the PostScript or Metafile picture.
403 wxCoord MinX() const;
404 wxCoord MaxX() const;
405 wxCoord MinY() const;
406 wxCoord MaxY() const;
410 "GetBoundingBox() -> (x1,y1, x2,y2)");
412 void GetBoundingBox(int* OUTPUT, int* OUTPUT, int* OUTPUT, int* OUTPUT);
413 // See below for implementation
415 %pythoncode { def __nonzero__(self): return self.Ok() };
419 %extend { // See drawlist.cpp for impplementaion of these...
420 PyObject* _DrawPointList(PyObject* pyCoords, PyObject* pyPens, PyObject* pyBrushes)
422 return wxPyDrawXXXList(*self, wxPyDrawXXXPoint, pyCoords, pyPens, pyBrushes);
425 PyObject* _DrawLineList(PyObject* pyCoords, PyObject* pyPens, PyObject* pyBrushes)
427 return wxPyDrawXXXList(*self, wxPyDrawXXXLine, pyCoords, pyPens, pyBrushes);
430 PyObject* _DrawRectangleList(PyObject* pyCoords, PyObject* pyPens, PyObject* pyBrushes)
432 return wxPyDrawXXXList(*self, wxPyDrawXXXRectangle, pyCoords, pyPens, pyBrushes);
435 PyObject* _DrawEllipseList(PyObject* pyCoords, PyObject* pyPens, PyObject* pyBrushes)
437 return wxPyDrawXXXList(*self, wxPyDrawXXXEllipse, pyCoords, pyPens, pyBrushes);
440 PyObject* _DrawPolygonList(PyObject* pyCoords, PyObject* pyPens, PyObject* pyBrushes)
442 return wxPyDrawXXXList(*self, wxPyDrawXXXPolygon, pyCoords, pyPens, pyBrushes);
445 PyObject* _DrawTextList(PyObject* textList, PyObject* pyPoints,
446 PyObject* foregroundList, PyObject* backgroundList) {
447 return wxPyDrawTextList(*self, textList, pyPoints, foregroundList, backgroundList);
452 def DrawPointList(self, points, pens=None):
455 elif isinstance(pens, wx.Pen):
457 elif len(pens) != len(points):
458 raise ValueError('points and pens must have same length')
459 return self._DrawPointList(points, pens, [])
462 def DrawLineList(self, lines, pens=None):
465 elif isinstance(pens, wx.Pen):
467 elif len(pens) != len(lines):
468 raise ValueError('lines and pens must have same length')
469 return self._DrawLineList(lines, pens, [])
472 def DrawRectangleList(self, rectangles, pens=None, brushes=None):
475 elif isinstance(pens, wx.Pen):
477 elif len(pens) != len(rectangles):
478 raise ValueError('rectangles and pens must have same length')
481 elif isinstance(brushes, wx.Brush):
483 elif len(brushes) != len(rectangles):
484 raise ValueError('rectangles and brushes must have same length')
485 return self._DrawRectangleList(rectangles, pens, brushes)
488 def DrawEllipseList(self, ellipses, pens=None, brushes=None):
491 elif isinstance(pens, wx.Pen):
493 elif len(pens) != len(ellipses):
494 raise ValueError('ellipses and pens must have same length')
497 elif isinstance(brushes, wx.Brush):
499 elif len(brushes) != len(ellipses):
500 raise ValueError('ellipses and brushes must have same length')
501 return self._DrawEllipseList(ellipses, pens, brushes)
504 def DrawPolygonList(self, polygons, pens=None, brushes=None):
505 %## Note: This does not currently support fill style or offset
506 %## you can always use the non-List version if need be.
509 elif isinstance(pens, wx.Pen):
511 elif len(pens) != len(polygons):
512 raise ValueError('polygons and pens must have same length')
515 elif isinstance(brushes, wx.Brush):
517 elif len(brushes) != len(polygons):
518 raise ValueError('polygons and brushes must have same length')
519 return self._DrawPolygonList(polygons, pens, brushes)
522 def DrawTextList(self, textList, coords, foregrounds = None, backgrounds = None, fonts = None):
523 %## NOTE: this does not currently support changing the font
524 %## Make sure you set Background mode to wxSolid (DC.SetBackgroundMode)
525 %## If you want backgounds to do anything.
526 if type(textList) == type(''):
527 textList = [textList]
528 elif len(textList) != len(coords):
529 raise ValueError('textlist and coords must have same length')
530 if foregrounds is None:
532 elif isinstance(foregrounds, wx.Colour):
533 foregrounds = [foregrounds]
534 elif len(foregrounds) != len(coords):
535 raise ValueError('foregrounds and coords must have same length')
536 if backgrounds is None:
538 elif isinstance(backgrounds, wx.Colour):
539 backgrounds = [backgrounds]
540 elif len(backgrounds) != len(coords):
541 raise ValueError('backgrounds and coords must have same length')
542 return self._DrawTextList(textList, coords, foregrounds, backgrounds)
550 static void wxDC_GetBoundingBox(wxDC* dc, int* x1, int* y1, int* x2, int* y2) {
559 //---------------------------------------------------------------------------
562 class wxMemoryDC : public wxDC {
565 %name(MemoryDCFromDC) wxMemoryDC(wxDC* oldDC);
567 void SelectObject(const wxBitmap& bitmap);
570 //---------------------------------------------------------------------------
575 #include <wx/dcbuffer.h>
579 class wxBufferedDC : public wxMemoryDC
582 %pythonAppend wxBufferedDC
583 "self._dc = args[0] # save a ref so the other dc will not be deleted before self";
585 %nokwargs wxBufferedDC;
587 // Construct a wxBufferedDC using a user supplied buffer.
588 wxBufferedDC( wxDC *dc, const wxBitmap &buffer );
590 // Construct a wxBufferedDC with an internal buffer of 'area'
591 // (where area is usually something like the size of the window
593 wxBufferedDC( wxDC *dc, const wxSize &area );
596 // TODO: Keep this one too?
597 %pythonAppend wxBufferedDC( wxDC *dc, const wxSize &area )
598 "val._dc = args[0] # save a ref so the other dc will not be deleted before self";
599 %name(BufferedDCInternalBuffer) wxBufferedDC( wxDC *dc, const wxSize &area );
602 // The buffer is blit to the real DC when the BufferedDC is destroyed.
606 // Blits the buffer to the dc, and detaches the dc from
607 // the buffer. Usually called in the dtor or by the dtor
608 // of derived classes if the BufferedDC must blit before
609 // the derived class (which may own the dc it's blitting
617 // Creates a double buffered wxPaintDC, optionally allowing the
618 // user to specify their own buffer to use.
619 class wxBufferedPaintDC : public wxBufferedDC
623 // If no bitmap is supplied by the user, a temporary one will be created.
624 wxBufferedPaintDC( wxWindow *window, const wxBitmap &buffer = wxNullBitmap );
629 //---------------------------------------------------------------------------
632 class wxScreenDC : public wxDC {
636 %name(StartDrawingOnTopWin) bool StartDrawingOnTop(wxWindow* window);
637 bool StartDrawingOnTop(wxRect* rect = NULL);
638 bool EndDrawingOnTop();
641 //---------------------------------------------------------------------------
644 class wxClientDC : public wxDC {
646 wxClientDC(wxWindow* win);
649 //---------------------------------------------------------------------------
652 class wxPaintDC : public wxDC {
654 wxPaintDC(wxWindow* win);
657 //---------------------------------------------------------------------------
660 class wxWindowDC : public wxDC {
662 wxWindowDC(wxWindow* win);
665 //---------------------------------------------------------------------------
668 class wxMirrorDC : public wxDC
671 // constructs a mirror DC associated with the given real DC
673 // if mirror parameter is True, all vertical and horizontal coordinates are
674 // exchanged, otherwise this class behaves in exactly the same way as a
677 wxMirrorDC(wxDC& dc, bool mirror);
680 //---------------------------------------------------------------------------
687 class wxPostScriptDC : public wxDC {
689 wxPostScriptDC(const wxPrintData& printData);
690 // %name(PostScriptDC2)wxPostScriptDC(const wxString& output,
691 // bool interactive = True,
692 // wxWindow* parent = NULL);
694 wxPrintData& GetPrintData();
695 void SetPrintData(const wxPrintData& data);
697 static void SetResolution(int ppi);
698 static int GetResolution();
701 //---------------------------------------------------------------------------
705 #if defined(__WXMSW__) || defined(__WXMAC__)
708 #include <wx/metafile.h>
711 class wxMetaFile : public wxObject {
713 wxMetaFile(const wxString& filename = wxPyEmptyString);
717 bool SetClipboard(int width = 0, int height = 0);
724 const wxString& GetFileName() const;
727 %pythoncode { def __nonzero__(self): return self.Ok() }
730 // bool wxMakeMetaFilePlaceable(const wxString& filename,
731 // int minX, int minY, int maxX, int maxY, float scale=1.0);
734 class wxMetaFileDC : public wxDC {
736 wxMetaFileDC(const wxString& filename = wxPyEmptyString,
737 int width = 0, int height = 0,
738 const wxString& description = wxPyEmptyString);
744 #else // Make some dummies for the other platforms
747 class wxMetaFile : public wxObject {
749 wxMetaFile(const wxString&)
750 { wxPyRaiseNotImplemented(); }
753 class wxMetaFileDC : public wxClientDC {
755 wxMetaFileDC(const wxString&, int, int, const wxString&)
756 { wxPyRaiseNotImplemented(); }
761 class wxMetaFile : public wxObject {
763 wxMetaFile(const wxString& filename = wxPyEmptyString);
766 class wxMetaFileDC : public wxDC {
768 wxMetaFileDC(const wxString& filename = wxPyEmptyString,
769 int width = 0, int height = 0,
770 const wxString& description = wxPyEmptyString);
777 //---------------------------------------------------------------------------
779 #if defined(__WXMSW__) || defined(__WXMAC__)
781 class wxPrinterDC : public wxDC {
783 wxPrinterDC(const wxPrintData& printData);
784 // %name(PrinterDC2) wxPrinterDC(const wxString& driver,
785 // const wxString& device,
786 // const wxString& output,
787 // bool interactive = True,
788 // int orientation = wxPORTRAIT);
793 class wxPrinterDC : public wxClientDC {
795 wxPrinterDC(const wxPrintData&)
796 { wxPyRaiseNotImplemented(); }
798 // wxPrinterDC(const wxString&, const wxString&, const wxString&, bool, int)
799 // { wxPyRaiseNotImplemented(); }
803 class wxPrinterDC : public wxDC {
805 wxPrinterDC(const wxPrintData& printData);
806 // %name(PrinterDC2) wxPrinterDC(const wxString& driver,
807 // const wxString& device,
808 // const wxString& output,
809 // bool interactive = True,
810 // int orientation = wxPORTRAIT);
814 //---------------------------------------------------------------------------
815 //---------------------------------------------------------------------------
817 // Now define some Python classes that rename the Draw methods to be
818 // compatible with the DC Draw methods in 2.4. See also wxPython/_wx.py.
821 %define MAKE_OLD_DC_CLASS(classname)
823 class classname##_old(classname):
824 """DC class that has methods with 2.4 compatible parameters."""
825 FloodFill = classname.FloodFillXY
826 GetPixel = classname.GetPixelXY
827 DrawLine = classname.DrawLineXY
828 CrossHair = classname.CrossHairXY
829 DrawArc = classname.DrawArcXY
830 DrawCheckMark = classname.DrawCheckMarkXY
831 DrawEllipticArc = classname.DrawEllipticArcXY
832 DrawPoint = classname.DrawPointXY
833 DrawRectangle = classname.DrawRectangleXY
834 DrawRoundedRectangle = classname.DrawRoundedRectangleXY
835 DrawCircle = classname.DrawCircleXY
836 DrawEllipse = classname.DrawEllipseXY
837 DrawIcon = classname.DrawIconXY
838 DrawBitmap = classname.DrawBitmapXY
839 DrawText = classname.DrawTextXY
840 DrawRotatedText = classname.DrawRotatedTextXY
841 Blit = classname.BlitXY
845 MAKE_OLD_DC_CLASS(DC);
846 MAKE_OLD_DC_CLASS(MemoryDC);
847 MAKE_OLD_DC_CLASS(BufferedDC);
848 MAKE_OLD_DC_CLASS(BufferedPaintDC);
849 MAKE_OLD_DC_CLASS(ScreenDC);
850 MAKE_OLD_DC_CLASS(ClientDC);
851 MAKE_OLD_DC_CLASS(PaintDC);
852 MAKE_OLD_DC_CLASS(WindowDC);
853 MAKE_OLD_DC_CLASS(MirrorDC);
854 MAKE_OLD_DC_CLASS(PostScriptDC);
855 MAKE_OLD_DC_CLASS(MetaFileDC);
856 MAKE_OLD_DC_CLASS(PrinterDC);
859 //---------------------------------------------------------------------------