From 976dbff5e6c24629b712fe574489e2b63c50f0b2 Mon Sep 17 00:00:00 2001
From: Robin Dunn <robin@alldunn.com>
Date: Tue, 17 May 2005 01:11:22 +0000
Subject: [PATCH] reSWIGged

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34089 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 wxPython/src/gtk/_controls.py       |   4 +
 wxPython/src/gtk/_controls_wrap.cpp |  43 ++++++++++
 wxPython/src/gtk/_misc.py           |  12 +++
 wxPython/src/gtk/_windows.py        |  12 +++
 wxPython/src/gtk/_windows_wrap.cpp  | 127 ++++++++++++++++++++++++++++
 wxPython/src/mac/_controls.py       |   4 +
 wxPython/src/mac/_controls_wrap.cpp |  43 ++++++++++
 wxPython/src/mac/_misc.py           |  12 +++
 wxPython/src/mac/_windows.py        |  12 +++
 wxPython/src/mac/_windows_wrap.cpp  | 127 ++++++++++++++++++++++++++++
 10 files changed, 396 insertions(+)

diff --git a/wxPython/src/gtk/_controls.py b/wxPython/src/gtk/_controls.py
index 34824e5875..91bb65ae79 100644
--- a/wxPython/src/gtk/_controls.py
+++ b/wxPython/src/gtk/_controls.py
@@ -5817,6 +5817,10 @@ class PyControl(_core.Control):
         """SetBestSize(self, Size size)"""
         return _controls_.PyControl_SetBestSize(*args, **kwargs)
 
+    def DoEraseBackground(*args, **kwargs):
+        """DoEraseBackground(self, DC dc) -> bool"""
+        return _controls_.PyControl_DoEraseBackground(*args, **kwargs)
+
     def base_DoMoveWindow(*args, **kwargs):
         """base_DoMoveWindow(self, int x, int y, int width, int height)"""
         return _controls_.PyControl_base_DoMoveWindow(*args, **kwargs)
diff --git a/wxPython/src/gtk/_controls_wrap.cpp b/wxPython/src/gtk/_controls_wrap.cpp
index d1e73ae786..29cc52c30c 100644
--- a/wxPython/src/gtk/_controls_wrap.cpp
+++ b/wxPython/src/gtk/_controls_wrap.cpp
@@ -2168,6 +2168,16 @@ public:
 
     void SetBestSize(const wxSize& size) { wxControl::SetBestSize(size); }
 
+    bool DoEraseBackground(wxDC* dc) {
+#ifdef __WXMSW__
+        return wxWindow::DoEraseBackground(dc->GetHDC());
+#else
+        dc->SetBackground(wxBrush(GetBackgroundColour()));
+        dc->Clear();
+        return true;
+#endif
+    }
+
     DEC_PYCALLBACK_VOID_INT4(DoMoveWindow);
     DEC_PYCALLBACK_VOID_INT5(DoSetSize);
     DEC_PYCALLBACK_VOID_INTINT(DoSetClientSize);
@@ -32258,6 +32268,38 @@ static PyObject *_wrap_PyControl_SetBestSize(PyObject *, PyObject *args, PyObjec
 }
 
 
+static PyObject *_wrap_PyControl_DoEraseBackground(PyObject *, PyObject *args, PyObject *kwargs) {
+    PyObject *resultobj;
+    wxPyControl *arg1 = (wxPyControl *) 0 ;
+    wxDC *arg2 = (wxDC *) 0 ;
+    bool result;
+    PyObject * obj0 = 0 ;
+    PyObject * obj1 = 0 ;
+    char *kwnames[] = {
+        (char *) "self",(char *) "dc", NULL 
+    };
+    
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:PyControl_DoEraseBackground",kwnames,&obj0,&obj1)) goto fail;
+    SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxPyControl, SWIG_POINTER_EXCEPTION | 0);
+    if (SWIG_arg_fail(1)) SWIG_fail;
+    SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_wxDC, SWIG_POINTER_EXCEPTION | 0);
+    if (SWIG_arg_fail(2)) SWIG_fail;
+    {
+        PyThreadState* __tstate = wxPyBeginAllowThreads();
+        result = (bool)(arg1)->DoEraseBackground(arg2);
+        
+        wxPyEndAllowThreads(__tstate);
+        if (PyErr_Occurred()) SWIG_fail;
+    }
+    {
+        resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
+    }
+    return resultobj;
+    fail:
+    return NULL;
+}
+
+
 static PyObject *_wrap_PyControl_base_DoMoveWindow(PyObject *, PyObject *args, PyObject *kwargs) {
     PyObject *resultobj;
     wxPyControl *arg1 = (wxPyControl *) 0 ;
@@ -35632,6 +35674,7 @@ static PyMethodDef SwigMethods[] = {
 	 { (char *)"new_PrePyControl", (PyCFunction) _wrap_new_PrePyControl, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyControl__setCallbackInfo", (PyCFunction) _wrap_PyControl__setCallbackInfo, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyControl_SetBestSize", (PyCFunction) _wrap_PyControl_SetBestSize, METH_VARARGS | METH_KEYWORDS, NULL},
+	 { (char *)"PyControl_DoEraseBackground", (PyCFunction) _wrap_PyControl_DoEraseBackground, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyControl_base_DoMoveWindow", (PyCFunction) _wrap_PyControl_base_DoMoveWindow, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyControl_base_DoSetSize", (PyCFunction) _wrap_PyControl_base_DoSetSize, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyControl_base_DoSetClientSize", (PyCFunction) _wrap_PyControl_base_DoSetClientSize, METH_VARARGS | METH_KEYWORDS, NULL},
diff --git a/wxPython/src/gtk/_misc.py b/wxPython/src/gtk/_misc.py
index ec2128941b..06eb5a5d7c 100644
--- a/wxPython/src/gtk/_misc.py
+++ b/wxPython/src/gtk/_misc.py
@@ -5262,6 +5262,18 @@ class DropSourcePtr(DropSource):
         self.__class__ = DropSource
 _misc_.DropSource_swigregister(DropSourcePtr)
 
+def DROP_ICON(filename):
+    """
+    Returns either a `wx.Cursor` or `wx.Icon` created from the image file
+    ``filename``.  This function is useful with the `wx.DropSource` class
+    which, depending on platform accepts either a icon or a cursor.
+    """
+    img = wx.Image(filename)
+    if wx.Platform == '__WXGTK__':
+        return wx.IconFromBitmap(wx.BitmapFromImage(img))
+    else:
+        return wx.CursorFromImage(img)
+
 class DropTarget(object):
     """Proxy of C++ DropTarget class"""
     def __repr__(self):
diff --git a/wxPython/src/gtk/_windows.py b/wxPython/src/gtk/_windows.py
index a748dbedd5..8c882b373e 100644
--- a/wxPython/src/gtk/_windows.py
+++ b/wxPython/src/gtk/_windows.py
@@ -3512,6 +3512,10 @@ class PyWindow(_core.Window):
         """SetBestSize(self, Size size)"""
         return _windows_.PyWindow_SetBestSize(*args, **kwargs)
 
+    def DoEraseBackground(*args, **kwargs):
+        """DoEraseBackground(self, DC dc) -> bool"""
+        return _windows_.PyWindow_DoEraseBackground(*args, **kwargs)
+
     def base_DoMoveWindow(*args, **kwargs):
         """base_DoMoveWindow(self, int x, int y, int width, int height)"""
         return _windows_.PyWindow_base_DoMoveWindow(*args, **kwargs)
@@ -3629,6 +3633,10 @@ class PyPanel(Panel):
         """SetBestSize(self, Size size)"""
         return _windows_.PyPanel_SetBestSize(*args, **kwargs)
 
+    def DoEraseBackground(*args, **kwargs):
+        """DoEraseBackground(self, DC dc) -> bool"""
+        return _windows_.PyPanel_DoEraseBackground(*args, **kwargs)
+
     def base_DoMoveWindow(*args, **kwargs):
         """base_DoMoveWindow(self, int x, int y, int width, int height)"""
         return _windows_.PyPanel_base_DoMoveWindow(*args, **kwargs)
@@ -3746,6 +3754,10 @@ class PyScrolledWindow(ScrolledWindow):
         """SetBestSize(self, Size size)"""
         return _windows_.PyScrolledWindow_SetBestSize(*args, **kwargs)
 
+    def DoEraseBackground(*args, **kwargs):
+        """DoEraseBackground(self, DC dc) -> bool"""
+        return _windows_.PyScrolledWindow_DoEraseBackground(*args, **kwargs)
+
     def base_DoMoveWindow(*args, **kwargs):
         """base_DoMoveWindow(self, int x, int y, int width, int height)"""
         return _windows_.PyScrolledWindow_base_DoMoveWindow(*args, **kwargs)
diff --git a/wxPython/src/gtk/_windows_wrap.cpp b/wxPython/src/gtk/_windows_wrap.cpp
index 7f8ebbfdf2..059729e8e5 100644
--- a/wxPython/src/gtk/_windows_wrap.cpp
+++ b/wxPython/src/gtk/_windows_wrap.cpp
@@ -2114,6 +2114,16 @@ public:
 
     void SetBestSize(const wxSize& size) { wxWindow::SetBestSize(size); }
 
+    bool DoEraseBackground(wxDC* dc) {
+#ifdef __WXMSW__
+        return wxWindow::DoEraseBackground(dc->GetHDC());
+#else
+        dc->SetBackground(wxBrush(GetBackgroundColour()));
+        dc->Clear();
+        return true;
+#endif
+    }
+    
     DEC_PYCALLBACK_VOID_INT4(DoMoveWindow);
     DEC_PYCALLBACK_VOID_INT5(DoSetSize);
     DEC_PYCALLBACK_VOID_INTINT(DoSetClientSize);
@@ -2191,6 +2201,15 @@ public:
         : wxPanel(parent, id, pos, size, style, name) {}
 
     void SetBestSize(const wxSize& size) { wxPanel::SetBestSize(size); }
+    bool DoEraseBackground(wxDC* dc) {
+#ifdef __WXMSW__
+        return wxWindow::DoEraseBackground(dc->GetHDC());
+#else
+        dc->SetBackground(wxBrush(GetBackgroundColour()));
+        dc->Clear();
+        return true;
+#endif
+    }
     
 
     DEC_PYCALLBACK_VOID_INT4(DoMoveWindow);
@@ -2270,6 +2289,15 @@ public:
         : wxScrolledWindow(parent, id, pos, size, style, name) {}
 
     void SetBestSize(const wxSize& size) { wxScrolledWindow::SetBestSize(size); }
+    bool DoEraseBackground(wxDC* dc) {
+#ifdef __WXMSW__
+        return wxWindow::DoEraseBackground(dc->GetHDC());
+#else
+        dc->SetBackground(wxBrush(GetBackgroundColour()));
+        dc->Clear();
+        return true;
+#endif
+    }
 
     DEC_PYCALLBACK_VOID_INT4(DoMoveWindow);
     DEC_PYCALLBACK_VOID_INT5(DoSetSize);
@@ -17847,6 +17875,38 @@ static PyObject *_wrap_PyWindow_SetBestSize(PyObject *, PyObject *args, PyObject
 }
 
 
+static PyObject *_wrap_PyWindow_DoEraseBackground(PyObject *, PyObject *args, PyObject *kwargs) {
+    PyObject *resultobj;
+    wxPyWindow *arg1 = (wxPyWindow *) 0 ;
+    wxDC *arg2 = (wxDC *) 0 ;
+    bool result;
+    PyObject * obj0 = 0 ;
+    PyObject * obj1 = 0 ;
+    char *kwnames[] = {
+        (char *) "self",(char *) "dc", NULL 
+    };
+    
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:PyWindow_DoEraseBackground",kwnames,&obj0,&obj1)) goto fail;
+    SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxPyWindow, SWIG_POINTER_EXCEPTION | 0);
+    if (SWIG_arg_fail(1)) SWIG_fail;
+    SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_wxDC, SWIG_POINTER_EXCEPTION | 0);
+    if (SWIG_arg_fail(2)) SWIG_fail;
+    {
+        PyThreadState* __tstate = wxPyBeginAllowThreads();
+        result = (bool)(arg1)->DoEraseBackground(arg2);
+        
+        wxPyEndAllowThreads(__tstate);
+        if (PyErr_Occurred()) SWIG_fail;
+    }
+    {
+        resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
+    }
+    return resultobj;
+    fail:
+    return NULL;
+}
+
+
 static PyObject *_wrap_PyWindow_base_DoMoveWindow(PyObject *, PyObject *args, PyObject *kwargs) {
     PyObject *resultobj;
     wxPyWindow *arg1 = (wxPyWindow *) 0 ;
@@ -18684,6 +18744,38 @@ static PyObject *_wrap_PyPanel_SetBestSize(PyObject *, PyObject *args, PyObject
 }
 
 
+static PyObject *_wrap_PyPanel_DoEraseBackground(PyObject *, PyObject *args, PyObject *kwargs) {
+    PyObject *resultobj;
+    wxPyPanel *arg1 = (wxPyPanel *) 0 ;
+    wxDC *arg2 = (wxDC *) 0 ;
+    bool result;
+    PyObject * obj0 = 0 ;
+    PyObject * obj1 = 0 ;
+    char *kwnames[] = {
+        (char *) "self",(char *) "dc", NULL 
+    };
+    
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:PyPanel_DoEraseBackground",kwnames,&obj0,&obj1)) goto fail;
+    SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxPyPanel, SWIG_POINTER_EXCEPTION | 0);
+    if (SWIG_arg_fail(1)) SWIG_fail;
+    SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_wxDC, SWIG_POINTER_EXCEPTION | 0);
+    if (SWIG_arg_fail(2)) SWIG_fail;
+    {
+        PyThreadState* __tstate = wxPyBeginAllowThreads();
+        result = (bool)(arg1)->DoEraseBackground(arg2);
+        
+        wxPyEndAllowThreads(__tstate);
+        if (PyErr_Occurred()) SWIG_fail;
+    }
+    {
+        resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
+    }
+    return resultobj;
+    fail:
+    return NULL;
+}
+
+
 static PyObject *_wrap_PyPanel_base_DoMoveWindow(PyObject *, PyObject *args, PyObject *kwargs) {
     PyObject *resultobj;
     wxPyPanel *arg1 = (wxPyPanel *) 0 ;
@@ -19521,6 +19613,38 @@ static PyObject *_wrap_PyScrolledWindow_SetBestSize(PyObject *, PyObject *args,
 }
 
 
+static PyObject *_wrap_PyScrolledWindow_DoEraseBackground(PyObject *, PyObject *args, PyObject *kwargs) {
+    PyObject *resultobj;
+    wxPyScrolledWindow *arg1 = (wxPyScrolledWindow *) 0 ;
+    wxDC *arg2 = (wxDC *) 0 ;
+    bool result;
+    PyObject * obj0 = 0 ;
+    PyObject * obj1 = 0 ;
+    char *kwnames[] = {
+        (char *) "self",(char *) "dc", NULL 
+    };
+    
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:PyScrolledWindow_DoEraseBackground",kwnames,&obj0,&obj1)) goto fail;
+    SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxPyScrolledWindow, SWIG_POINTER_EXCEPTION | 0);
+    if (SWIG_arg_fail(1)) SWIG_fail;
+    SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_wxDC, SWIG_POINTER_EXCEPTION | 0);
+    if (SWIG_arg_fail(2)) SWIG_fail;
+    {
+        PyThreadState* __tstate = wxPyBeginAllowThreads();
+        result = (bool)(arg1)->DoEraseBackground(arg2);
+        
+        wxPyEndAllowThreads(__tstate);
+        if (PyErr_Occurred()) SWIG_fail;
+    }
+    {
+        resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
+    }
+    return resultobj;
+    fail:
+    return NULL;
+}
+
+
 static PyObject *_wrap_PyScrolledWindow_base_DoMoveWindow(PyObject *, PyObject *args, PyObject *kwargs) {
     PyObject *resultobj;
     wxPyScrolledWindow *arg1 = (wxPyScrolledWindow *) 0 ;
@@ -28045,6 +28169,7 @@ static PyMethodDef SwigMethods[] = {
 	 { (char *)"new_PrePyWindow", (PyCFunction) _wrap_new_PrePyWindow, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyWindow__setCallbackInfo", (PyCFunction) _wrap_PyWindow__setCallbackInfo, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyWindow_SetBestSize", (PyCFunction) _wrap_PyWindow_SetBestSize, METH_VARARGS | METH_KEYWORDS, NULL},
+	 { (char *)"PyWindow_DoEraseBackground", (PyCFunction) _wrap_PyWindow_DoEraseBackground, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyWindow_base_DoMoveWindow", (PyCFunction) _wrap_PyWindow_base_DoMoveWindow, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyWindow_base_DoSetSize", (PyCFunction) _wrap_PyWindow_base_DoSetSize, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyWindow_base_DoSetClientSize", (PyCFunction) _wrap_PyWindow_base_DoSetClientSize, METH_VARARGS | METH_KEYWORDS, NULL},
@@ -28070,6 +28195,7 @@ static PyMethodDef SwigMethods[] = {
 	 { (char *)"new_PrePyPanel", (PyCFunction) _wrap_new_PrePyPanel, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyPanel__setCallbackInfo", (PyCFunction) _wrap_PyPanel__setCallbackInfo, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyPanel_SetBestSize", (PyCFunction) _wrap_PyPanel_SetBestSize, METH_VARARGS | METH_KEYWORDS, NULL},
+	 { (char *)"PyPanel_DoEraseBackground", (PyCFunction) _wrap_PyPanel_DoEraseBackground, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyPanel_base_DoMoveWindow", (PyCFunction) _wrap_PyPanel_base_DoMoveWindow, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyPanel_base_DoSetSize", (PyCFunction) _wrap_PyPanel_base_DoSetSize, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyPanel_base_DoSetClientSize", (PyCFunction) _wrap_PyPanel_base_DoSetClientSize, METH_VARARGS | METH_KEYWORDS, NULL},
@@ -28095,6 +28221,7 @@ static PyMethodDef SwigMethods[] = {
 	 { (char *)"new_PrePyScrolledWindow", (PyCFunction) _wrap_new_PrePyScrolledWindow, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyScrolledWindow__setCallbackInfo", (PyCFunction) _wrap_PyScrolledWindow__setCallbackInfo, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyScrolledWindow_SetBestSize", (PyCFunction) _wrap_PyScrolledWindow_SetBestSize, METH_VARARGS | METH_KEYWORDS, NULL},
+	 { (char *)"PyScrolledWindow_DoEraseBackground", (PyCFunction) _wrap_PyScrolledWindow_DoEraseBackground, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyScrolledWindow_base_DoMoveWindow", (PyCFunction) _wrap_PyScrolledWindow_base_DoMoveWindow, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyScrolledWindow_base_DoSetSize", (PyCFunction) _wrap_PyScrolledWindow_base_DoSetSize, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyScrolledWindow_base_DoSetClientSize", (PyCFunction) _wrap_PyScrolledWindow_base_DoSetClientSize, METH_VARARGS | METH_KEYWORDS, NULL},
diff --git a/wxPython/src/mac/_controls.py b/wxPython/src/mac/_controls.py
index 51b5b5f98d..d7847bedba 100644
--- a/wxPython/src/mac/_controls.py
+++ b/wxPython/src/mac/_controls.py
@@ -5804,6 +5804,10 @@ class PyControl(_core.Control):
         """SetBestSize(self, Size size)"""
         return _controls_.PyControl_SetBestSize(*args, **kwargs)
 
+    def DoEraseBackground(*args, **kwargs):
+        """DoEraseBackground(self, DC dc) -> bool"""
+        return _controls_.PyControl_DoEraseBackground(*args, **kwargs)
+
     def base_DoMoveWindow(*args, **kwargs):
         """base_DoMoveWindow(self, int x, int y, int width, int height)"""
         return _controls_.PyControl_base_DoMoveWindow(*args, **kwargs)
diff --git a/wxPython/src/mac/_controls_wrap.cpp b/wxPython/src/mac/_controls_wrap.cpp
index 4dac96622c..9e749403da 100644
--- a/wxPython/src/mac/_controls_wrap.cpp
+++ b/wxPython/src/mac/_controls_wrap.cpp
@@ -2165,6 +2165,16 @@ public:
 
     void SetBestSize(const wxSize& size) { wxControl::SetBestSize(size); }
 
+    bool DoEraseBackground(wxDC* dc) {
+#ifdef __WXMSW__
+        return wxWindow::DoEraseBackground(dc->GetHDC());
+#else
+        dc->SetBackground(wxBrush(GetBackgroundColour()));
+        dc->Clear();
+        return true;
+#endif
+    }
+
     DEC_PYCALLBACK_VOID_INT4(DoMoveWindow);
     DEC_PYCALLBACK_VOID_INT5(DoSetSize);
     DEC_PYCALLBACK_VOID_INTINT(DoSetClientSize);
@@ -32190,6 +32200,38 @@ static PyObject *_wrap_PyControl_SetBestSize(PyObject *, PyObject *args, PyObjec
 }
 
 
+static PyObject *_wrap_PyControl_DoEraseBackground(PyObject *, PyObject *args, PyObject *kwargs) {
+    PyObject *resultobj;
+    wxPyControl *arg1 = (wxPyControl *) 0 ;
+    wxDC *arg2 = (wxDC *) 0 ;
+    bool result;
+    PyObject * obj0 = 0 ;
+    PyObject * obj1 = 0 ;
+    char *kwnames[] = {
+        (char *) "self",(char *) "dc", NULL 
+    };
+    
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:PyControl_DoEraseBackground",kwnames,&obj0,&obj1)) goto fail;
+    SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxPyControl, SWIG_POINTER_EXCEPTION | 0);
+    if (SWIG_arg_fail(1)) SWIG_fail;
+    SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_wxDC, SWIG_POINTER_EXCEPTION | 0);
+    if (SWIG_arg_fail(2)) SWIG_fail;
+    {
+        PyThreadState* __tstate = wxPyBeginAllowThreads();
+        result = (bool)(arg1)->DoEraseBackground(arg2);
+        
+        wxPyEndAllowThreads(__tstate);
+        if (PyErr_Occurred()) SWIG_fail;
+    }
+    {
+        resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
+    }
+    return resultobj;
+    fail:
+    return NULL;
+}
+
+
 static PyObject *_wrap_PyControl_base_DoMoveWindow(PyObject *, PyObject *args, PyObject *kwargs) {
     PyObject *resultobj;
     wxPyControl *arg1 = (wxPyControl *) 0 ;
@@ -35562,6 +35604,7 @@ static PyMethodDef SwigMethods[] = {
 	 { (char *)"new_PrePyControl", (PyCFunction) _wrap_new_PrePyControl, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyControl__setCallbackInfo", (PyCFunction) _wrap_PyControl__setCallbackInfo, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyControl_SetBestSize", (PyCFunction) _wrap_PyControl_SetBestSize, METH_VARARGS | METH_KEYWORDS, NULL},
+	 { (char *)"PyControl_DoEraseBackground", (PyCFunction) _wrap_PyControl_DoEraseBackground, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyControl_base_DoMoveWindow", (PyCFunction) _wrap_PyControl_base_DoMoveWindow, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyControl_base_DoSetSize", (PyCFunction) _wrap_PyControl_base_DoSetSize, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyControl_base_DoSetClientSize", (PyCFunction) _wrap_PyControl_base_DoSetClientSize, METH_VARARGS | METH_KEYWORDS, NULL},
diff --git a/wxPython/src/mac/_misc.py b/wxPython/src/mac/_misc.py
index 8e67e39ace..a0bc8a30ba 100644
--- a/wxPython/src/mac/_misc.py
+++ b/wxPython/src/mac/_misc.py
@@ -5270,6 +5270,18 @@ class DropSourcePtr(DropSource):
         self.__class__ = DropSource
 _misc_.DropSource_swigregister(DropSourcePtr)
 
+def DROP_ICON(filename):
+    """
+    Returns either a `wx.Cursor` or `wx.Icon` created from the image file
+    ``filename``.  This function is useful with the `wx.DropSource` class
+    which, depending on platform accepts either a icon or a cursor.
+    """
+    img = wx.Image(filename)
+    if wx.Platform == '__WXGTK__':
+        return wx.IconFromBitmap(wx.BitmapFromImage(img))
+    else:
+        return wx.CursorFromImage(img)
+
 class DropTarget(object):
     """Proxy of C++ DropTarget class"""
     def __repr__(self):
diff --git a/wxPython/src/mac/_windows.py b/wxPython/src/mac/_windows.py
index a0af9ffa0a..4144cc5f1b 100644
--- a/wxPython/src/mac/_windows.py
+++ b/wxPython/src/mac/_windows.py
@@ -3492,6 +3492,10 @@ class PyWindow(_core.Window):
         """SetBestSize(self, Size size)"""
         return _windows_.PyWindow_SetBestSize(*args, **kwargs)
 
+    def DoEraseBackground(*args, **kwargs):
+        """DoEraseBackground(self, DC dc) -> bool"""
+        return _windows_.PyWindow_DoEraseBackground(*args, **kwargs)
+
     def base_DoMoveWindow(*args, **kwargs):
         """base_DoMoveWindow(self, int x, int y, int width, int height)"""
         return _windows_.PyWindow_base_DoMoveWindow(*args, **kwargs)
@@ -3609,6 +3613,10 @@ class PyPanel(Panel):
         """SetBestSize(self, Size size)"""
         return _windows_.PyPanel_SetBestSize(*args, **kwargs)
 
+    def DoEraseBackground(*args, **kwargs):
+        """DoEraseBackground(self, DC dc) -> bool"""
+        return _windows_.PyPanel_DoEraseBackground(*args, **kwargs)
+
     def base_DoMoveWindow(*args, **kwargs):
         """base_DoMoveWindow(self, int x, int y, int width, int height)"""
         return _windows_.PyPanel_base_DoMoveWindow(*args, **kwargs)
@@ -3726,6 +3734,10 @@ class PyScrolledWindow(ScrolledWindow):
         """SetBestSize(self, Size size)"""
         return _windows_.PyScrolledWindow_SetBestSize(*args, **kwargs)
 
+    def DoEraseBackground(*args, **kwargs):
+        """DoEraseBackground(self, DC dc) -> bool"""
+        return _windows_.PyScrolledWindow_DoEraseBackground(*args, **kwargs)
+
     def base_DoMoveWindow(*args, **kwargs):
         """base_DoMoveWindow(self, int x, int y, int width, int height)"""
         return _windows_.PyScrolledWindow_base_DoMoveWindow(*args, **kwargs)
diff --git a/wxPython/src/mac/_windows_wrap.cpp b/wxPython/src/mac/_windows_wrap.cpp
index 2a59c9cf32..e3893c03c7 100644
--- a/wxPython/src/mac/_windows_wrap.cpp
+++ b/wxPython/src/mac/_windows_wrap.cpp
@@ -2107,6 +2107,16 @@ public:
 
     void SetBestSize(const wxSize& size) { wxWindow::SetBestSize(size); }
 
+    bool DoEraseBackground(wxDC* dc) {
+#ifdef __WXMSW__
+        return wxWindow::DoEraseBackground(dc->GetHDC());
+#else
+        dc->SetBackground(wxBrush(GetBackgroundColour()));
+        dc->Clear();
+        return true;
+#endif
+    }
+    
     DEC_PYCALLBACK_VOID_INT4(DoMoveWindow);
     DEC_PYCALLBACK_VOID_INT5(DoSetSize);
     DEC_PYCALLBACK_VOID_INTINT(DoSetClientSize);
@@ -2184,6 +2194,15 @@ public:
         : wxPanel(parent, id, pos, size, style, name) {}
 
     void SetBestSize(const wxSize& size) { wxPanel::SetBestSize(size); }
+    bool DoEraseBackground(wxDC* dc) {
+#ifdef __WXMSW__
+        return wxWindow::DoEraseBackground(dc->GetHDC());
+#else
+        dc->SetBackground(wxBrush(GetBackgroundColour()));
+        dc->Clear();
+        return true;
+#endif
+    }
     
 
     DEC_PYCALLBACK_VOID_INT4(DoMoveWindow);
@@ -2263,6 +2282,15 @@ public:
         : wxScrolledWindow(parent, id, pos, size, style, name) {}
 
     void SetBestSize(const wxSize& size) { wxScrolledWindow::SetBestSize(size); }
+    bool DoEraseBackground(wxDC* dc) {
+#ifdef __WXMSW__
+        return wxWindow::DoEraseBackground(dc->GetHDC());
+#else
+        dc->SetBackground(wxBrush(GetBackgroundColour()));
+        dc->Clear();
+        return true;
+#endif
+    }
 
     DEC_PYCALLBACK_VOID_INT4(DoMoveWindow);
     DEC_PYCALLBACK_VOID_INT5(DoSetSize);
@@ -17732,6 +17760,38 @@ static PyObject *_wrap_PyWindow_SetBestSize(PyObject *, PyObject *args, PyObject
 }
 
 
+static PyObject *_wrap_PyWindow_DoEraseBackground(PyObject *, PyObject *args, PyObject *kwargs) {
+    PyObject *resultobj;
+    wxPyWindow *arg1 = (wxPyWindow *) 0 ;
+    wxDC *arg2 = (wxDC *) 0 ;
+    bool result;
+    PyObject * obj0 = 0 ;
+    PyObject * obj1 = 0 ;
+    char *kwnames[] = {
+        (char *) "self",(char *) "dc", NULL 
+    };
+    
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:PyWindow_DoEraseBackground",kwnames,&obj0,&obj1)) goto fail;
+    SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxPyWindow, SWIG_POINTER_EXCEPTION | 0);
+    if (SWIG_arg_fail(1)) SWIG_fail;
+    SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_wxDC, SWIG_POINTER_EXCEPTION | 0);
+    if (SWIG_arg_fail(2)) SWIG_fail;
+    {
+        PyThreadState* __tstate = wxPyBeginAllowThreads();
+        result = (bool)(arg1)->DoEraseBackground(arg2);
+        
+        wxPyEndAllowThreads(__tstate);
+        if (PyErr_Occurred()) SWIG_fail;
+    }
+    {
+        resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
+    }
+    return resultobj;
+    fail:
+    return NULL;
+}
+
+
 static PyObject *_wrap_PyWindow_base_DoMoveWindow(PyObject *, PyObject *args, PyObject *kwargs) {
     PyObject *resultobj;
     wxPyWindow *arg1 = (wxPyWindow *) 0 ;
@@ -18569,6 +18629,38 @@ static PyObject *_wrap_PyPanel_SetBestSize(PyObject *, PyObject *args, PyObject
 }
 
 
+static PyObject *_wrap_PyPanel_DoEraseBackground(PyObject *, PyObject *args, PyObject *kwargs) {
+    PyObject *resultobj;
+    wxPyPanel *arg1 = (wxPyPanel *) 0 ;
+    wxDC *arg2 = (wxDC *) 0 ;
+    bool result;
+    PyObject * obj0 = 0 ;
+    PyObject * obj1 = 0 ;
+    char *kwnames[] = {
+        (char *) "self",(char *) "dc", NULL 
+    };
+    
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:PyPanel_DoEraseBackground",kwnames,&obj0,&obj1)) goto fail;
+    SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxPyPanel, SWIG_POINTER_EXCEPTION | 0);
+    if (SWIG_arg_fail(1)) SWIG_fail;
+    SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_wxDC, SWIG_POINTER_EXCEPTION | 0);
+    if (SWIG_arg_fail(2)) SWIG_fail;
+    {
+        PyThreadState* __tstate = wxPyBeginAllowThreads();
+        result = (bool)(arg1)->DoEraseBackground(arg2);
+        
+        wxPyEndAllowThreads(__tstate);
+        if (PyErr_Occurred()) SWIG_fail;
+    }
+    {
+        resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
+    }
+    return resultobj;
+    fail:
+    return NULL;
+}
+
+
 static PyObject *_wrap_PyPanel_base_DoMoveWindow(PyObject *, PyObject *args, PyObject *kwargs) {
     PyObject *resultobj;
     wxPyPanel *arg1 = (wxPyPanel *) 0 ;
@@ -19406,6 +19498,38 @@ static PyObject *_wrap_PyScrolledWindow_SetBestSize(PyObject *, PyObject *args,
 }
 
 
+static PyObject *_wrap_PyScrolledWindow_DoEraseBackground(PyObject *, PyObject *args, PyObject *kwargs) {
+    PyObject *resultobj;
+    wxPyScrolledWindow *arg1 = (wxPyScrolledWindow *) 0 ;
+    wxDC *arg2 = (wxDC *) 0 ;
+    bool result;
+    PyObject * obj0 = 0 ;
+    PyObject * obj1 = 0 ;
+    char *kwnames[] = {
+        (char *) "self",(char *) "dc", NULL 
+    };
+    
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:PyScrolledWindow_DoEraseBackground",kwnames,&obj0,&obj1)) goto fail;
+    SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxPyScrolledWindow, SWIG_POINTER_EXCEPTION | 0);
+    if (SWIG_arg_fail(1)) SWIG_fail;
+    SWIG_Python_ConvertPtr(obj1, (void **)&arg2, SWIGTYPE_p_wxDC, SWIG_POINTER_EXCEPTION | 0);
+    if (SWIG_arg_fail(2)) SWIG_fail;
+    {
+        PyThreadState* __tstate = wxPyBeginAllowThreads();
+        result = (bool)(arg1)->DoEraseBackground(arg2);
+        
+        wxPyEndAllowThreads(__tstate);
+        if (PyErr_Occurred()) SWIG_fail;
+    }
+    {
+        resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
+    }
+    return resultobj;
+    fail:
+    return NULL;
+}
+
+
 static PyObject *_wrap_PyScrolledWindow_base_DoMoveWindow(PyObject *, PyObject *args, PyObject *kwargs) {
     PyObject *resultobj;
     wxPyScrolledWindow *arg1 = (wxPyScrolledWindow *) 0 ;
@@ -27927,6 +28051,7 @@ static PyMethodDef SwigMethods[] = {
 	 { (char *)"new_PrePyWindow", (PyCFunction) _wrap_new_PrePyWindow, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyWindow__setCallbackInfo", (PyCFunction) _wrap_PyWindow__setCallbackInfo, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyWindow_SetBestSize", (PyCFunction) _wrap_PyWindow_SetBestSize, METH_VARARGS | METH_KEYWORDS, NULL},
+	 { (char *)"PyWindow_DoEraseBackground", (PyCFunction) _wrap_PyWindow_DoEraseBackground, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyWindow_base_DoMoveWindow", (PyCFunction) _wrap_PyWindow_base_DoMoveWindow, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyWindow_base_DoSetSize", (PyCFunction) _wrap_PyWindow_base_DoSetSize, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyWindow_base_DoSetClientSize", (PyCFunction) _wrap_PyWindow_base_DoSetClientSize, METH_VARARGS | METH_KEYWORDS, NULL},
@@ -27952,6 +28077,7 @@ static PyMethodDef SwigMethods[] = {
 	 { (char *)"new_PrePyPanel", (PyCFunction) _wrap_new_PrePyPanel, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyPanel__setCallbackInfo", (PyCFunction) _wrap_PyPanel__setCallbackInfo, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyPanel_SetBestSize", (PyCFunction) _wrap_PyPanel_SetBestSize, METH_VARARGS | METH_KEYWORDS, NULL},
+	 { (char *)"PyPanel_DoEraseBackground", (PyCFunction) _wrap_PyPanel_DoEraseBackground, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyPanel_base_DoMoveWindow", (PyCFunction) _wrap_PyPanel_base_DoMoveWindow, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyPanel_base_DoSetSize", (PyCFunction) _wrap_PyPanel_base_DoSetSize, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyPanel_base_DoSetClientSize", (PyCFunction) _wrap_PyPanel_base_DoSetClientSize, METH_VARARGS | METH_KEYWORDS, NULL},
@@ -27977,6 +28103,7 @@ static PyMethodDef SwigMethods[] = {
 	 { (char *)"new_PrePyScrolledWindow", (PyCFunction) _wrap_new_PrePyScrolledWindow, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyScrolledWindow__setCallbackInfo", (PyCFunction) _wrap_PyScrolledWindow__setCallbackInfo, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyScrolledWindow_SetBestSize", (PyCFunction) _wrap_PyScrolledWindow_SetBestSize, METH_VARARGS | METH_KEYWORDS, NULL},
+	 { (char *)"PyScrolledWindow_DoEraseBackground", (PyCFunction) _wrap_PyScrolledWindow_DoEraseBackground, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyScrolledWindow_base_DoMoveWindow", (PyCFunction) _wrap_PyScrolledWindow_base_DoMoveWindow, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyScrolledWindow_base_DoSetSize", (PyCFunction) _wrap_PyScrolledWindow_base_DoSetSize, METH_VARARGS | METH_KEYWORDS, NULL},
 	 { (char *)"PyScrolledWindow_base_DoSetClientSize", (PyCFunction) _wrap_PyScrolledWindow_base_DoSetClientSize, METH_VARARGS | METH_KEYWORDS, NULL},
-- 
2.47.2