From 9a3dccf6d61c3a4b992518f810d148cee1476fb8 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 9 Oct 2006 18:56:41 +0000 Subject: [PATCH] double buffer changes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41826 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/_dc.i | 32 ++++++++++++++++++++++++++------ wxPython/src/_window.i | 7 +++++++ 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/wxPython/src/_dc.i b/wxPython/src/_dc.i index ab5bceb09d..3b764edbeb 100644 --- a/wxPython/src/_dc.i +++ b/wxPython/src/_dc.i @@ -1338,6 +1338,11 @@ public: wxBufferedDC( wxDC* dc, const wxSize& area, int style = wxBUFFER_CLIENT_AREA ); + wxBufferedDC(wxWindow* win, + wxDC *dc, + const wxSize &area, + int style = wxBUFFER_CLIENT_AREA); + DocCtorStr( ~wxBufferedDC(), @@ -1376,8 +1381,6 @@ automatically when it is destroyed. For example:: dc = wx.BufferedPaintDC(self, self.buffer) - - ", ""); class wxBufferedPaintDC : public wxBufferedDC @@ -1391,13 +1394,10 @@ public: "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 -window is automatically used). - -", ""); +window is automatically used).", ""); }; - //--------------------------------------------------------------------------- %newgroup @@ -1514,6 +1514,26 @@ public: "Constructor. Pass the window on which you wish to paint.", ""); }; + + +//--------------------------------------------------------------------------- +%newgroup + +%pythoncode { + if 'wxMac' in wx.PlatformInfo or 'gtk2' in wx.PlatformInfo: + _AutoBufferedPaintDCBase = PaintDC + else: + _AutoBufferedPaintDCBase = BufferedPaintDC + + class AutoBufferedPaintDC(_AutoBufferedPaintDCBase): + """ + If the current platform double buffers by default then this DC is the + same as a plain `wx.PaintDC`, otherwise it is a `wx.BufferedPaintDC`. + """ + def __init__(self, window): + _AutoBufferedPaintDCBase.__init__(self, window) +} + //--------------------------------------------------------------------------- %newgroup diff --git a/wxPython/src/_window.i b/wxPython/src/_window.i index b83769abc2..fd0e6c0db7 100644 --- a/wxPython/src/_window.i +++ b/wxPython/src/_window.i @@ -1324,6 +1324,13 @@ times that Freeze was before the window will be updated.", ""); "Call this function to prepare the device context for drawing a scrolled image. It sets the device origin according to the current scroll position.", ""); + + DocDeclStr( + virtual bool , IsDoubleBuffered() const, + "Returns ``True`` if the window contents is double-buffered by the +system, i.e. if any drawing done on the window is really done on a +temporary backing surface and transferred to the screen all at once +later.", ""); DocDeclStr( -- 2.45.2