]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/dcbuffer.h
include stdlib.h to get malloc/free decl
[wxWidgets.git] / include / wx / dcbuffer.h
index 37988bef0404d9b66afbe7c765ffd38724a03654..8385aa6d2b043a5cab8d42ab5831e6b37083727f 100644 (file)
@@ -30,7 +30,7 @@ enum
 
 
     // flags used by default
-    wxBUFFER_DC_DEFAULT = wxBUFFER_DC_PRESERVE_BG
+    wxBUFFER_DC_DEFAULT = wxBUFFER_DC_OVERWRITE_BG
 };
 
 // ----------------------------------------------------------------------------
@@ -89,11 +89,15 @@ private:
         }
     }
 
-    // Without the existence of a wxNullDC, this must be
-    // a pointer, else it could probably be a reference.
-    wxDC       *m_dc;
+    // the underlying DC to which we copy everything drawn on this one in
+    // UnMask()
+    //
+    // NB: Without the existence of a wxNullDC, this must be a pointer, else it
+    //     could probably be a reference.
+    wxDC *m_dc;
 
-    wxBitmap    m_buffer;
+    // the buffer (selected in this DC)
+    wxBitmap m_buffer;
 
     DECLARE_NO_COPY_CLASS(wxBufferedDC)
 };
@@ -110,16 +114,19 @@ class WXDLLIMPEXP_ADV wxBufferedPaintDC : public wxBufferedDC
 public:
     // this ctor creates a bitmap of the size of the window for buffering
     wxBufferedPaintDC(wxWindow *window, int flags = wxBUFFER_DC_DEFAULT)
-        : wxBufferedDC(&m_paintdc, window->GetClientSize(), flags),
-          m_paintdc(window)
+        : m_paintdc(window)
     {
+        Init(&m_paintdc, window->GetClientSize(), flags);
+
         Prepare(window);
     }
 
     // the bitmap must be valid here
     wxBufferedPaintDC(wxWindow *window, const wxBitmap& buffer)
-        : wxBufferedDC(&m_paintdc, buffer)
+        : m_paintdc(window)
     {
+        Init(&m_paintdc, buffer);
+
         Prepare(window);
     }