X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/98ccd5452290db2280d7b23698d66584c3e66732..d2ae3af890800b7844df1673e6c9ae0e63b3dd68:/interface/wx/dcbuffer.h diff --git a/interface/wx/dcbuffer.h b/interface/wx/dcbuffer.h index 55a130bba4..93492e4b5a 100644 --- a/interface/wx/dcbuffer.h +++ b/interface/wx/dcbuffer.h @@ -3,9 +3,22 @@ // Purpose: interface of wxBufferedDC // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +// Assumes the buffer bitmap covers the entire scrolled window, +// and prepares the window DC accordingly +#define wxBUFFER_VIRTUAL_AREA 0x01 + +// Assumes the buffer bitmap only covers the client area; +// does not prepare the window DC +#define wxBUFFER_CLIENT_AREA 0x02 + +// Set when not using specific buffer bitmap. Note that this +// is private style and not returned by GetStyle. +#define wxBUFFER_USES_SHARED_BUFFER 0x04 + + /** @class wxBufferedDC @@ -48,7 +61,6 @@ public: */ wxBufferedDC(); - //@{ /** Creates a buffer for the provided @a dc. Init() must not be called when using this constructor. @@ -87,9 +99,8 @@ public: window is buffered, or wxBUFFER_VIRTUAL_AREA to indicate that the buffer bitmap covers the virtual area. */ - wxBufferedDC(wxDC* dc, wxBitmap& buffer, + wxBufferedDC(wxDC* dc, wxBitmap& buffer = wxNullBitmap, int style = wxBUFFER_CLIENT_AREA); - //@} /** Copies everything drawn on the DC so far to the underlying DC @@ -104,7 +115,7 @@ public: */ void Init(wxDC* dc, const wxSize& area, int style = wxBUFFER_CLIENT_AREA); - void Init(wxDC* dc, wxBitmap& buffer, + void Init(wxDC* dc, wxBitmap& buffer = wxNullBitmap, int style = wxBUFFER_CLIENT_AREA); //@} }; @@ -117,12 +128,12 @@ public: This wxDC derivative can be used inside of an @c EVT_PAINT() event handler to achieve double-buffered drawing. Just use this class instead of wxPaintDC and make sure wxWindow::SetBackgroundStyle() is called with - wxBG_STYLE_CUSTOM somewhere in the class initialization code, and that's + wxBG_STYLE_PAINT somewhere in the class initialization code, and that's all you have to do to (mostly) avoid flicker. The difference between wxBufferedPaintDC and this class is that this class won't double-buffer on platforms which have native double-buffering - already, avoiding any unneccessary buffering to avoid flicker. + already, avoiding any unnecessary buffering to avoid flicker. wxAutoBufferedPaintDC is simply a typedef of wxPaintDC on platforms that have native double-buffering, otherwise, it is a typedef of @@ -150,7 +161,7 @@ public: This is a subclass of wxBufferedDC which can be used inside of an @c EVT_PAINT() event handler to achieve double-buffered drawing. Just use this class instead of wxPaintDC and make sure - wxWindow::SetBackgroundStyle() is called with wxBG_STYLE_CUSTOM somewhere + wxWindow::SetBackgroundStyle() is called with wxBG_STYLE_PAINT somewhere in the class initialization code, and that's all you have to do to (mostly) avoid flicker. The only thing to watch out for is that if you are using this class together with wxScrolled, you probably do @b not want to call