X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d14a1e28567de23c586bc80017073d0c39f8d18f..c8431295224c1efb2f2cd22df468a9f1950a2e16:/wxPython/src/_dc.i?ds=sidebyside diff --git a/wxPython/src/_dc.i b/wxPython/src/_dc.i index 5c5e193d64..d394706e8b 100644 --- a/wxPython/src/_dc.i +++ b/wxPython/src/_dc.i @@ -75,12 +75,12 @@ public: void DrawCircle(wxCoord x, wxCoord y, wxCoord radius); void DrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height); void DrawIcon(const wxIcon& icon, wxCoord x, wxCoord y); - void DrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask = FALSE); + void DrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask = False); void DrawText(const wxString& text, wxCoord x, wxCoord y); void DrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle); bool Blit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, - int rop = wxCOPY, bool useMask = FALSE, + int rop = wxCOPY, bool useMask = False, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1); @@ -140,8 +140,8 @@ public: %name(DrawIconXY) void DrawIcon(const wxIcon& icon, wxCoord x, wxCoord y); void DrawIcon(const wxIcon& icon, const wxPoint& pt); - %name(DrawBitmapXY) void DrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask = FALSE); - void DrawBitmap(const wxBitmap &bmp, const wxPoint& pt, bool useMask = FALSE); + %name(DrawBitmapXY) void DrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask = False); + void DrawBitmap(const wxBitmap &bmp, const wxPoint& pt, bool useMask = False); %name(DrawTextXY) void DrawText(const wxString& text, wxCoord x, wxCoord y); void DrawText(const wxString& text, const wxPoint& pt); @@ -152,11 +152,11 @@ public: %name(BlitXY) bool Blit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, - int rop = wxCOPY, bool useMask = FALSE, + int rop = wxCOPY, bool useMask = False, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1); bool Blit(const wxPoint& destPt, const wxSize& sz, wxDC *source, const wxPoint& srcPt, - int rop = wxCOPY, bool useMask = FALSE, + int rop = wxCOPY, bool useMask = False, const wxPoint& srcPtMask = wxDefaultPosition); #endif @@ -219,14 +219,17 @@ public: // clipping region // --------------- - void SetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height); - //void SetClippingRegion(const wxPoint& pt, const wxSize& sz) + %name(SetClippingRegionXY)void SetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height); + void SetClippingRegion(const wxPoint& pt, const wxSize& sz); %name(SetClippingRect) void SetClippingRegion(const wxRect& rect); %name(SetClippingRegionAsRegion) void SetClippingRegion(const wxRegion& region); virtual void DestroyClippingRegion(); - void GetClippingBox(wxCoord *OUTPUT, wxCoord *OUTPUT, wxCoord *OUTPUT, wxCoord *OUTPUT) const; + DocDeclA( + void, GetClippingBox(wxCoord *OUTPUT, wxCoord *OUTPUT, wxCoord *OUTPUT, wxCoord *OUTPUT) const, + "GetClippingBox() -> (x, y, width, height)"); + %extend { wxRect GetClippingRect() { wxRect rect; @@ -243,27 +246,50 @@ public: virtual wxCoord GetCharHeight() const; virtual wxCoord GetCharWidth() const; - // only works for single line strings - void GetTextExtent(const wxString& string, wxCoord *OUTPUT, wxCoord *OUTPUT); - %name(GetFullTextExtent)void GetTextExtent(const wxString& string, - wxCoord *OUTPUT, wxCoord *OUTPUT, wxCoord *OUTPUT, wxCoord* OUTPUT, - wxFont* font = NULL); - // works for single as well as multi-line strings - void GetMultiLineTextExtent(const wxString& text, wxCoord *OUTPUT, wxCoord *OUTPUT, wxCoord *OUTPUT, - wxFont *font = NULL); + DocDeclAStr( + void, GetTextExtent(const wxString& string, wxCoord *OUTPUT, wxCoord *OUTPUT), + "GetTextExtent(wxString string) -> (width, height)", + "Get the width and height of the text using the current font.\n" + "Only works for single line strings."); + DocDeclAStrName( + void, GetTextExtent(const wxString& string, + wxCoord *OUTPUT, wxCoord *OUTPUT, wxCoord *OUTPUT, wxCoord* OUTPUT, + wxFont* font = NULL), + "GetFullTextExtent(wxString string, Font font=None) ->\n (width, height, descent, externalLeading)", + "Get the width, height, decent and leading of the text using the current or specified font.\n" + "Only works for single line strings.", + GetFullTextExtent); + + // works for single as well as multi-line strings + DocDeclAStr( + void, GetMultiLineTextExtent(const wxString& text, + wxCoord *OUTPUT, wxCoord *OUTPUT, wxCoord *OUTPUT, + wxFont *font = NULL), + "GetMultiLineTextExtent(wxString string, Font font=None) ->\n (width, height, descent, externalLeading)", + "Get the width, height, decent and leading of the text using the current or specified font.\n" + "Works for single as well as multi-line strings."); + // size and resolution // ------------------- - // in device units - %name(GetSizeTuple)void GetSize(int* OUTPUT, int* OUTPUT); + DocStr(GetSize, "Get the DC size in device units."); wxSize GetSize(); + DocDeclAName( + void, GetSize( int *OUTPUT, int *OUTPUT ), + "GetSizeTuple() -> (width, height)", + GetSizeTuple); + - // in mm - %name(GetSizeMMWH)void GetSizeMM(int* OUTPUT, int* OUTPUT) const; + DocStr(GetSizeMM, "Get the DC size in milimeters."); wxSize GetSizeMM() const; + DocDeclAName( + void, GetSizeMM( int *OUTPUT, int *OUTPUT ) const, + "GetSizeMMTuple() -> (width, height)", + GetSizeMMTuple); + // coordinates conversions @@ -310,19 +336,36 @@ public: int GetMapMode() const; virtual void SetMapMode(int mode); - virtual void GetUserScale(double *OUTPUT, double *OUTPUT) const; + + DocDeclA( + virtual void, GetUserScale(double *OUTPUT, double *OUTPUT) const, + "GetUserScale() -> (xScale, yScale)"); + virtual void SetUserScale(double x, double y); - virtual void GetLogicalScale(double *OUTPUT, double *OUTPUT); + + DocDeclA( + virtual void, GetLogicalScale(double *OUTPUT, double *OUTPUT), + "GetLogicalScale() -> (xScale, yScale)"); + virtual void SetLogicalScale(double x, double y); - %name(GetLogicalOriginTuple) void GetLogicalOrigin(wxCoord *OUTPUT, wxCoord *OUTPUT) const; + wxPoint GetLogicalOrigin() const; + DocDeclAName( + void, GetLogicalOrigin(wxCoord *OUTPUT, wxCoord *OUTPUT) const, + "GetLogicalOriginTuple() -> (x,y)", + GetLogicalOriginTuple); + virtual void SetLogicalOrigin(wxCoord x, wxCoord y); - %name(GetDeviceOriginTuple) void GetDeviceOrigin(wxCoord *OUTPUT, wxCoord *OUTPUT) const; wxPoint GetDeviceOrigin() const; + DocDeclAName( + void, GetDeviceOrigin(wxCoord *OUTPUT, wxCoord *OUTPUT) const, + "GetDeviceOriginTuple() -> (x,y)", + GetDeviceOriginTuple); + virtual void SetDeviceOrigin(wxCoord x, wxCoord y); virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp); @@ -347,6 +390,8 @@ public: wxCoord MaxY() const; + DocA(GetBoundingBox, + "GetBoundingBox() -> (x1,y1, x2,y2)"); %extend { void GetBoundingBox(int* OUTPUT, int* OUTPUT, int* OUTPUT, int* OUTPUT); // See below for implementation @@ -468,13 +513,13 @@ public: raise ValueError('textlist and coords must have same length') if foregrounds is None: foregrounds = [] - elif isinstance(foregrounds, wxColour): + elif isinstance(foregrounds, wx.Colour): foregrounds = [foregrounds] elif len(foregrounds) != len(coords): raise ValueError('foregrounds and coords must have same length') if backgrounds is None: backgrounds = [] - elif isinstance(backgrounds, wxColour): + elif isinstance(backgrounds, wx.Colour): backgrounds = [backgrounds] elif len(backgrounds) != len(coords): raise ValueError('backgrounds and coords must have same length') @@ -585,7 +630,7 @@ class wxMirrorDC : public wxDC public: // constructs a mirror DC associated with the given real DC // - // if mirror parameter is true, all vertical and horizontal coordinates are + // if mirror parameter is True, all vertical and horizontal coordinates are // exchanged, otherwise this class behaves in exactly the same way as a // plain DC // @@ -603,7 +648,7 @@ class wxPostScriptDC : public wxDC { public: wxPostScriptDC(const wxPrintData& printData); // %name(PostScriptDC2)wxPostScriptDC(const wxString& output, -// bool interactive = TRUE, +// bool interactive = True, // wxWindow* parent = NULL); wxPrintData& GetPrintData(); @@ -660,13 +705,13 @@ public: class wxMetaFile : public wxObject { public: wxMetaFile(const wxString&) - { PyErr_SetNone(PyExc_NotImplementedError); } + { wxPyRaiseNotImplemented(); } }; class wxMetaFileDC : public wxClientDC { public: wxMetaFileDC(const wxString&, int, int, const wxString&) - { PyErr_SetNone(PyExc_NotImplementedError); } + { wxPyRaiseNotImplemented(); } }; %} @@ -697,7 +742,7 @@ public: // %name(PrinterDC2) wxPrinterDC(const wxString& driver, // const wxString& device, // const wxString& output, -// bool interactive = TRUE, +// bool interactive = True, // int orientation = wxPORTRAIT); }; @@ -706,10 +751,10 @@ public: class wxPrinterDC : public wxClientDC { public: wxPrinterDC(const wxPrintData&) - { PyErr_SetNone(PyExc_NotImplementedError); } + { wxPyRaiseNotImplemented(); } // wxPrinterDC(const wxString&, const wxString&, const wxString&, bool, int) -// { PyErr_SetNone(PyExc_NotImplementedError); } +// { wxPyRaiseNotImplemented(); } }; %} @@ -719,7 +764,7 @@ public: // %name(PrinterDC2) wxPrinterDC(const wxString& driver, // const wxString& device, // const wxString& output, -// bool interactive = TRUE, +// bool interactive = True, // int orientation = wxPORTRAIT); }; #endif