X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/da32eb53cbe7947f3f4599d7b6b5caa21a68d27f..2cc3f6a0fc1f8b79150a715f145e73e185adae10:/wxPython/src/_dnd.i diff --git a/wxPython/src/_dnd.i b/wxPython/src/_dnd.i index cf7c3c84b9..bfe497b58e 100644 --- a/wxPython/src/_dnd.i +++ b/wxPython/src/_dnd.i @@ -55,8 +55,10 @@ IMP_PYCALLBACK_BOOL_DR(wxPyDropSource, wxDropSource, GiveFeedback); %} -%name(DropSource) class wxPyDropSource { +%rename(DropSource) wxPyDropSource; +class wxPyDropSource { public: + %pythonAppend wxPyDropSource "self._setCallbackInfo(self, DropSource, 0)" #ifndef __WXGTK__ wxPyDropSource(wxWindow *win, const wxCursor © = wxNullCursor, @@ -70,14 +72,13 @@ public: #endif void _setCallbackInfo(PyObject* self, PyObject* _class, int incref); - %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxDropSource, 0)" ~wxPyDropSource(); // set the data which is transfered by drag and drop void SetData(wxDataObject& data); - + wxDataObject *GetDataObject(); - + // set the icon corresponding to given drag result void SetCursor(wxDragResult res, const wxCursor& cursor); @@ -115,7 +116,8 @@ IMP_PYCALLBACK_BOOL_INTINT(wxPyDropTarget, wxDropTarget, OnDrop); %} -%name(DropTarget) class wxPyDropTarget // : public wxDropTarget +%rename(DropTarget) wxPyDropTarget; +class wxPyDropTarget // : public wxDropTarget { public: %pythonAppend wxPyDropTarget @@ -142,6 +144,15 @@ public: // with the data from the drop source if it returns True bool GetData(); + // sets the default action for drag and drop: + // use wxDragMove or wxDragCopy to set deafult action to move or copy + // and use wxDragNone (default) to set default action specified by + // initialization of draging (see wxDropSourceBase::DoDragDrop()) + void SetDefaultAction(wxDragResult action); + + // returns default action for drag and drop or + // wxDragNone if this not specified + wxDragResult GetDefaultAction(); }; @@ -178,7 +189,8 @@ IMP_PYCALLBACK_BOOL_INTINT(wxPyTextDropTarget, wxTextDropTarget, OnDrop); %} -%name(TextDropTarget) class wxPyTextDropTarget : public wxPyDropTarget { +%rename(TextDropTarget) wxPyTextDropTarget; +class wxPyTextDropTarget : public wxPyDropTarget { public: %pythonAppend wxPyTextDropTarget "self._setCallbackInfo(self, TextDropTarget)" @@ -216,8 +228,8 @@ public: bool wxPyFileDropTarget::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames) { - bool rval = False; - bool blocked = wxPyBeginBlockThreads(); + bool rval = false; + wxPyBlock_t blocked = wxPyBeginBlockThreads(); if (wxPyCBH_findCallback(m_myInst, "OnDropFiles")) { PyObject* list = wxArrayString2PyList_helper(filenames); rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iiO)",x,y,list)); @@ -238,7 +250,8 @@ IMP_PYCALLBACK_BOOL_INTINT(wxPyFileDropTarget, wxFileDropTarget, OnDrop); %} -%name(FileDropTarget) class wxPyFileDropTarget : public wxPyDropTarget +%rename(FileDropTarget) wxPyFileDropTarget; +class wxPyFileDropTarget : public wxPyDropTarget { public: %pythonAppend wxPyFileDropTarget "self._setCallbackInfo(self, FileDropTarget)"