]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/erase/erase.cpp
Improved layout, in particular passed a container size in order to allow relative...
[wxWidgets.git] / samples / erase / erase.cpp
index 138b3fa2bc328cd8dfa58259d61763aa20ee35a1..bb452f239aa9fc97ca00b195472f2c9455f0a942 100644 (file)
@@ -30,6 +30,7 @@
     #include "wx/wx.h"
 #endif
 
+#include "wx/custombgwin.h"
 #include "wx/dcbuffer.h"
 
 // ----------------------------------------------------------------------------
@@ -52,7 +53,7 @@ public:
 };
 
 
-class MyCanvas : public wxScrolledWindow
+class MyCanvas : public wxCustomBackgroundWindow<wxScrolledWindow>
 {
 public:
     MyCanvas(wxFrame *parent);
@@ -310,8 +311,9 @@ BEGIN_EVENT_TABLE(MyCanvas, wxScrolledWindow)
 END_EVENT_TABLE()
 
 MyCanvas::MyCanvas(wxFrame *parent)
-        : wxScrolledWindow(parent, wxID_ANY)
 {
+    Create(parent, wxID_ANY);
+
     m_useBuffer = false;
     m_useBgBmp = false;
     m_eraseBgInPaint = false;