X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/24f6c4e8658ae2884f136c15a0ae6ff72ede7e25..b3894f30e0142638170f3c1da2c4fcb1b60719ea:/wxPython/src/mac/_gdi.py diff --git a/wxPython/src/mac/_gdi.py b/wxPython/src/mac/_gdi.py index 4eeb91695d..6bdfc2d8c7 100644 --- a/wxPython/src/mac/_gdi.py +++ b/wxPython/src/mac/_gdi.py @@ -4589,16 +4589,26 @@ class BufferedDC(MemoryDC): This simple class provides a simple way to avoid flicker: when drawing on it, everything is in fact first drawn on an in-memory buffer (a `wx.Bitmap`) and then copied to the screen only once, when this object - is destroyed. + is destroyed. You can either provide a buffer bitmap yourself, and + reuse it the next time something needs painted, or you can let the + buffered DC create and provide a buffer bitmap itself. - It can be used in the same way as any other device context. + Buffered DCs can be used in the same way as any other device context. wx.BufferedDC itself typically replaces `wx.ClientDC`, if you want to use it in your EVT_PAINT handler, you should look at - `wx.BufferedPaintDC`. + `wx.BufferedPaintDC`. You can also use a wx.BufferedDC without + providing a target DC. In this case the operations done on the dc + will only be written to the buffer bitmap and *not* to any window, so + you will want to have provided the buffer bitmap and then reuse it + when it needs painted to the window. Please note that GTK+ 2.0 and OS X provide double buffering themselves - natively. wxBufferedDC is aware of this however, and will bypass the buffering - unless an explicit buffer bitmap is given. + natively. You may want to use `wx.Window.IsDoubleBuffered` to + determine whether you need to use buffering or not, or use + `wx.AutoBufferedPaintDC` to avoid needless double buffering on systems + that already do it automatically. + + """ thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') @@ -4948,13 +4958,21 @@ class GraphicsContext(object): __repr__ = _swig_repr __swig_destroy__ = _gdi_.delete_GraphicsContext __del__ = lambda self : None; - def Create(*args, **kwargs): - """Create(WindowDC dc) -> GraphicsContext""" - val = _gdi_.GraphicsContext_Create(*args, **kwargs) - val.__dc = args[0] # save a ref so the other dc will not be deleted before self + def Create(*args): + """ + Create(WindowDC dc) -> GraphicsContext + Create(Window window) -> GraphicsContext + """ + val = _gdi_.GraphicsContext_Create(*args) + val.__dc = args[0] # save a ref so the dc will not be deleted before self return val Create = staticmethod(Create) + def CreateFromNative(*args, **kwargs): + """CreateFromNative(void context) -> GraphicsContext""" + return _gdi_.GraphicsContext_CreateFromNative(*args, **kwargs) + + CreateFromNative = staticmethod(CreateFromNative) def CreatePath(*args, **kwargs): """CreatePath(self) -> GraphicsPath""" return _gdi_.GraphicsContext_CreatePath(*args, **kwargs) @@ -4967,10 +4985,22 @@ class GraphicsContext(object): """PopState(self)""" return _gdi_.GraphicsContext_PopState(*args, **kwargs) + def ClipRegion(*args, **kwargs): + """ClipRegion(self, Region region)""" + return _gdi_.GraphicsContext_ClipRegion(*args, **kwargs) + def Clip(*args, **kwargs): - """Clip(self, Region region)""" + """Clip(self, Double x, Double y, Double w, Double h)""" return _gdi_.GraphicsContext_Clip(*args, **kwargs) + def ResetClip(*args, **kwargs): + """ResetClip(self)""" + return _gdi_.GraphicsContext_ResetClip(*args, **kwargs) + + def GetNativeContext(*args, **kwargs): + """GetNativeContext(self) -> void""" + return _gdi_.GraphicsContext_GetNativeContext(*args, **kwargs) + def Translate(*args, **kwargs): """Translate(self, Double dx, Double dy)""" return _gdi_.GraphicsContext_Translate(*args, **kwargs) @@ -5001,7 +5031,7 @@ class GraphicsContext(object): def SetRadialGradientBrush(*args, **kwargs): """ SetRadialGradientBrush(self, Double xo, Double yo, Double xc, Double yc, Double radius, - Colour oColor, Colour cColor) + Colour oColour, Colour cColour) """ return _gdi_.GraphicsContext_SetRadialGradientBrush(*args, **kwargs) @@ -5009,9 +5039,9 @@ class GraphicsContext(object): """SetFont(self, Font font)""" return _gdi_.GraphicsContext_SetFont(*args, **kwargs) - def SetTextColor(*args, **kwargs): - """SetTextColor(self, Colour col)""" - return _gdi_.GraphicsContext_SetTextColor(*args, **kwargs) + def SetTextColour(*args, **kwargs): + """SetTextColour(self, Colour col)""" + return _gdi_.GraphicsContext_SetTextColour(*args, **kwargs) def StrokePath(*args, **kwargs): """StrokePath(self, GraphicsPath path)""" @@ -5033,8 +5063,12 @@ class GraphicsContext(object): """DrawRotatedText(self, String str, Double x, Double y, Double angle)""" return _gdi_.GraphicsContext_DrawRotatedText(*args, **kwargs) + def GetFullTextExtent(*args, **kwargs): + """GetFullTextExtent(self, text) --> (width, height, descent, externalLeading)""" + return _gdi_.GraphicsContext_GetFullTextExtent(*args, **kwargs) + def GetTextExtent(*args, **kwargs): - """GetTextExtend(self, text) --> (width, height, descent, externalLeading)""" + """GetTextExtent(self, text) --> (width, height)""" return _gdi_.GraphicsContext_GetTextExtent(*args, **kwargs) def GetPartialTextExtents(*args, **kwargs): @@ -5079,12 +5113,19 @@ class GraphicsContext(object): _gdi_.GraphicsContext_swigregister(GraphicsContext) -def GraphicsContext_Create(*args, **kwargs): - """GraphicsContext_Create(WindowDC dc) -> GraphicsContext""" - val = _gdi_.GraphicsContext_Create(*args, **kwargs) - val.__dc = args[0] # save a ref so the other dc will not be deleted before self +def GraphicsContext_Create(*args): + """ + Create(WindowDC dc) -> GraphicsContext + GraphicsContext_Create(Window window) -> GraphicsContext + """ + val = _gdi_.GraphicsContext_Create(*args) + val.__dc = args[0] # save a ref so the dc will not be deleted before self return val +def GraphicsContext_CreateFromNative(*args, **kwargs): + """GraphicsContext_CreateFromNative(void context) -> GraphicsContext""" + return _gdi_.GraphicsContext_CreateFromNative(*args, **kwargs) + class GCDC(DC): """Proxy of C++ GCDC class""" thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') @@ -5096,10 +5137,15 @@ class GCDC(DC): __swig_destroy__ = _gdi_.delete_GCDC __del__ = lambda self : None; - def GetGraphicContext(*args, **kwargs): - """GetGraphicContext(self) -> GraphicsContext""" - return _gdi_.GCDC_GetGraphicContext(*args, **kwargs) + def GetGraphicsContext(*args, **kwargs): + """GetGraphicsContext(self) -> GraphicsContext""" + return _gdi_.GCDC_GetGraphicsContext(*args, **kwargs) + + def SetGraphicsContext(*args, **kwargs): + """SetGraphicsContext(self, GraphicsContext ctx)""" + return _gdi_.GCDC_SetGraphicsContext(*args, **kwargs) + GraphicsContext = property(GetGraphicsContext,SetGraphicsContext) _gdi_.GCDC_swigregister(GCDC) class Overlay(object):