]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/msw/clip_dnd.cpp
Font updates
[wxWidgets.git] / wxPython / src / msw / clip_dnd.cpp
index 5b0ccdc5ad7dc2bb06e0ce7b990182a6cdf54504..321a322c0fffef3b3bed6f96e52b92a3c57fbfbb 100644 (file)
@@ -191,8 +191,9 @@ wxBitmap wxPyBitmapDataObject::GetBitmap() {
 void wxPyBitmapDataObject::SetBitmap(const wxBitmap& bitmap) {
     wxPyBeginBlockThreads();
     if (m_myInst.findCallback("SetBitmap")) {
-        m_myInst.callCallback(Py_BuildValue("(O)",
-                              wxPyConstructObject((void*)&bitmap, "wxBitmap")));
+        PyObject* bo = wxPyConstructObject((void*)&bitmap, "wxBitmap");
+        m_myInst.callCallback(Py_BuildValue("(O)", bo));
+        Py_DECREF(bo);
     }
     wxPyEndBlockThreads();
 }
@@ -293,10 +294,11 @@ bool wxPyFileDropTarget::OnDropFiles(wxCoord x, wxCoord y,
                                      const wxArrayString& filenames) {
     bool rval = FALSE;
     wxPyBeginBlockThreads();
-    PyObject* list = wxArrayString2PyList_helper(filenames);
-    if (m_myInst.findCallback("OnDropFiles"))
+    if (m_myInst.findCallback("OnDropFiles")) {
+        PyObject* list = wxArrayString2PyList_helper(filenames);
         rval = m_myInst.callCallback(Py_BuildValue("(iiO)",x,y,list));
-    Py_DECREF(list);
+        Py_DECREF(list);
+    }
     wxPyEndBlockThreads();
     return rval;
 }
@@ -2750,9 +2752,9 @@ static PyObject *_wrap_wxDropSource_DoDragDrop(PyObject *self, PyObject *args, P
     PyObject * _resultobj;
     wxDragResult  _result;
     wxPyDropSource * _arg0;
-    int  _arg1 = (int ) FALSE;
+    int  _arg1 = (int ) (wxDrag_CopyOnly);
     PyObject * _argo0 = 0;
-    char *_kwnames[] = { "self","bAllowMove", NULL };
+    char *_kwnames[] = { "self","flags", NULL };
 
     self = self;
     if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|i:wxDropSource_DoDragDrop",_kwnames,&_argo0,&_arg1)) 
@@ -3851,6 +3853,9 @@ SWIGEXPORT(void) initclip_dndc() {
         PyDict_SetItemString(d,"cvar", SWIG_globals);
         SWIG_addvarlink(SWIG_globals,"wxFormatInvalid",_wrap_wxPyFormatInvalid_get, _wrap_wxPyFormatInvalid_set);
         SWIG_addvarlink(SWIG_globals,"wxTheClipboard",_wrap_wxPyTheClipboard_get, _wrap_wxPyTheClipboard_set);
+        PyDict_SetItemString(d,"wxDrag_CopyOnly", PyInt_FromLong((long) wxDrag_CopyOnly));
+        PyDict_SetItemString(d,"wxDrag_AllowMove", PyInt_FromLong((long) wxDrag_AllowMove));
+        PyDict_SetItemString(d,"wxDrag_DefaultMove", PyInt_FromLong((long) wxDrag_DefaultMove));
         PyDict_SetItemString(d,"wxDragError", PyInt_FromLong((long) wxDragError));
         PyDict_SetItemString(d,"wxDragNone", PyInt_FromLong((long) wxDragNone));
         PyDict_SetItemString(d,"wxDragCopy", PyInt_FromLong((long) wxDragCopy));