X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1b8c7ba607a15a2ff8a04448138df9ffff7df6c5..955e46d25d6ac0f9fa55ec9fe11f0c21da3a494d:/wxPython/src/_dc.i diff --git a/wxPython/src/_dc.i b/wxPython/src/_dc.i index c69ad80675..e69410a39c 100644 --- a/wxPython/src/_dc.i +++ b/wxPython/src/_dc.i @@ -59,22 +59,15 @@ public: ~wxDC(); - DocDeclStr( - virtual void , BeginDrawing(), - "Allows for optimization of drawing code on platforms that need it. On -other platforms this is just an empty function and is harmless. To -take advantage of this postential optimization simply enclose each -group of calls to the drawing primitives within calls to -`BeginDrawing` and `EndDrawing`.", ""); - - DocDeclStr( - virtual void , EndDrawing(), - "Ends the group of drawing primitives started with `BeginDrawing`, and -invokes whatever optimization is available for this DC type on the -current platform.", ""); + %pythoncode { + %# These have been deprecated in wxWidgets. Since they never + %# really did anything to begin with, just make them be NOPs. + def BeginDrawing(self): pass + def EndDrawing(self): pass + } - + // TODO virtual void DrawObject(wxDrawObject* drawobject); @@ -97,6 +90,35 @@ exactly. However the function will still return true.", ""); bool FloodFill(wxCoord x, wxCoord y, const wxColour& col, int style = wxFLOOD_SURFACE); %Rename(FloodFillPoint, bool, FloodFill(const wxPoint& pt, const wxColour& col, int style = wxFLOOD_SURFACE)); + // fill the area specified by rect with a radial gradient, starting from + // initialColour in the centre of the cercle and fading to destColour. + + DocDeclStr( + void , GradientFillConcentric(const wxRect& rect, + const wxColour& initialColour, + const wxColour& destColour, + const wxPoint& circleCenter), + "Fill the area specified by rect with a radial gradient, starting from +initialColour in the center of the circle and fading to destColour on +the outside of the circle. The circleCenter argument is the relative +coordinants of the center of the circle in the specified rect. + +Note: Currently this function is very slow, don't use it for real-time +drawing.", ""); + + + DocDeclStr( + void , GradientFillLinear(const wxRect& rect, + const wxColour& initialColour, + const wxColour& destColour, + wxDirection nDirection = wxEAST), + "Fill the area specified by rect with a linear gradient, starting from +initialColour and eventually fading to destColour. The nDirection +parameter specifies the direction of the colour change, default is to +use initialColour on the left part of the rectangle and destColour on +the right side.", ""); + + DocStr( GetPixel, @@ -577,7 +599,7 @@ pixels from the begining of text to the coresponding character of *text*. The generic version simply builds a running total of the widths of each character using GetTextExtent, however if the various platforms have a native API function that is faster or more accurate -than the generic implementaiton then it will be used instead.", ""); +than the generic implementation then it will be used instead.", ""); wxArrayInt GetPartialTextExtents(const wxString& text) { wxArrayInt widths; self->GetPartialTextExtents(text, widths); @@ -681,7 +703,7 @@ converting a height, for example.", ""); DocDeclStr( virtual wxSize , GetPPI() const, - "Resolution in Pixels per inch", ""); + "Resolution in pixels per inch", ""); DocDeclStr( @@ -1223,6 +1245,10 @@ destroyed safely.", ""); #include %} +enum { + wxBUFFER_VIRTUAL_AREA, + wxBUFFER_CLIENT_AREA +}; MustHaveApp(wxBufferedDC); @@ -1263,26 +1289,28 @@ public: as the bitmap doesn't have to be recreated each time but it also requires more memory as the bitmap is never freed. The bitmap should have appropriate size, anything drawn outside of - its bounds is clipped. -"); - wxBufferedDC( wxDC *dc, const wxBitmap &buffer ); - wxBufferedDC( wxDC *dc, const wxSize &area ); - + its bounds is clipped. If wx.NullBitmap is used then a new + buffer will be allocated that is the same size as the dc. - -// // TODO: Keep this one too? -// %pythonAppend wxBufferedDC( wxDC *dc, const wxSize &area ) -// "val.__dc = args[0] # save a ref so the other dc will not be deleted before self"; -// %RenameCtor(BufferedDCInternalBuffer, wxBufferedDC( wxDC *dc, const wxSize &area )); + :param style: The style parameter indicates whether the supplied buffer is + intended to cover the entire virtual size of a `wx.ScrolledWindow` or + if it only covers the client area. Acceptable values are + ``wx.BUFFER_VIRTUAL_AREA`` and ``wx.BUFFER_CLIENT_AREA``. + +"); + wxBufferedDC( wxDC* dc, + const wxBitmap& buffer=wxNullBitmap, + int style = wxBUFFER_CLIENT_AREA ); + wxBufferedDC( wxDC* dc, + const wxSize& area, + int style = wxBUFFER_CLIENT_AREA ); - - // The buffer is blit to the real DC when the BufferedDC is destroyed. DocCtorStr( ~wxBufferedDC(), "Copies everything drawn on the DC so far to the underlying DC associated with this object, if any.", ""); - + DocDeclStr( void , UnMask(), "Blits the buffer to the dc, and detaches the dc from the buffer (so it @@ -1314,6 +1342,8 @@ automatically when it is destroyed. For example:: dc = wx.BufferedPaintDC(self, self.buffer) + + ", ""); class wxBufferedPaintDC : public wxBufferedDC @@ -1321,7 +1351,9 @@ class wxBufferedPaintDC : public wxBufferedDC public: DocCtorStr( - wxBufferedPaintDC( wxWindow *window, const wxBitmap &buffer = wxNullBitmap ), + wxBufferedPaintDC( wxWindow *window, + const wxBitmap &buffer = wxNullBitmap, + int style = wxBUFFER_CLIENT_AREA), "Create a buffered paint DC. As with `wx.BufferedDC`, you may either provide the bitmap to be used for buffering or let this object create one internally (in the latter case, the size of the client part of the