X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d14a1e28567de23c586bc80017073d0c39f8d18f..7cc2d290b49e147c4a8640babc67475698046d51:/wxPython/src/_dnd.i diff --git a/wxPython/src/_dnd.i b/wxPython/src/_dnd.i index 07b843d362..4e59285844 100644 --- a/wxPython/src/_dnd.i +++ b/wxPython/src/_dnd.i @@ -14,18 +14,14 @@ //--------------------------------------------------------------------------- +#ifndef __WXX11__ -%{ -#include -%} - -//--------------------------------------------------------------------------- %newgroup // flags for wxDropSource::DoDragDrop() // -// NB: wxDrag_CopyOnly must be 0 (== FALSE) and wxDrag_AllowMove must be 1 -// (== TRUE) for compatibility with the old DoDragDrop(bool) method! +// NB: wxDrag_CopyOnly must be 0 (== False) and wxDrag_AllowMove must be 1 +// (== True) for compatibility with the old DoDragDrop(bool) method! enum { wxDrag_CopyOnly = 0, // allow only copying @@ -55,41 +51,19 @@ bool wxIsDragResultOk(wxDragResult res); %{ -class wxPyDropSource : public wxDropSource { -public: -#ifndef __WXGTK__ - wxPyDropSource(wxWindow *win = NULL, - const wxCursor © = wxNullCursor, - const wxCursor &move = wxNullCursor, - const wxCursor &none = wxNullCursor) - : wxDropSource(win, copy, move, none) {} -#else - wxPyDropSource(wxWindow *win = NULL, - const wxIcon& copy = wxNullIcon, - const wxIcon& move = wxNullIcon, - const wxIcon& none = wxNullIcon) - : wxDropSource(win, copy, move, none) {} -#endif - ~wxPyDropSource() { } - - DEC_PYCALLBACK_BOOL_DR(GiveFeedback); - PYPRIVATE; -}; - IMP_PYCALLBACK_BOOL_DR(wxPyDropSource, wxDropSource, GiveFeedback); - %} %name(DropSource) class wxPyDropSource { public: #ifndef __WXGTK__ - wxPyDropSource(wxWindow *win = NULL, + wxPyDropSource(wxWindow *win, const wxCursor © = wxNullCursor, const wxCursor &move = wxNullCursor, const wxCursor &none = wxNullCursor); #else - wxPyDropSource(wxWindow *win = NULL, + wxPyDropSource(wxWindow *win, const wxIcon& copy = wxNullIcon, const wxIcon& move = wxNullIcon, const wxIcon& none = wxNullIcon); @@ -133,50 +107,20 @@ public: %{ -class wxPyDropTarget : public wxDropTarget { -public: - wxPyDropTarget(wxDataObject *dataObject = NULL) - : wxDropTarget(dataObject) {} - - // called when mouse leaves the window: might be used to remove the - // feedback which was given in OnEnter() - DEC_PYCALLBACK__(OnLeave); - - // called when the mouse enters the window (only once until OnLeave()) - DEC_PYCALLBACK_DR_2WXCDR(OnEnter); - - // called when the mouse moves in the window - shouldn't take long to - // execute or otherwise mouse movement would be too slow - DEC_PYCALLBACK_DR_2WXCDR(OnDragOver); - - // called after OnDrop() returns TRUE: you will usually just call - // GetData() from here and, probably, also refresh something to update the - // new data and, finally, return the code indicating how did the operation - // complete (returning default value in case of success and wxDragError on - // failure is usually ok) - DEC_PYCALLBACK_DR_2WXCDR_pure(OnData); - - // this function is called when data is dropped at position (x, y) - if it - // returns TRUE, OnData() will be called immediately afterwards which will - // allow to retrieve the data dropped. - DEC_PYCALLBACK_BOOL_INTINT(OnDrop); - - PYPRIVATE; -}; - IMP_PYCALLBACK__(wxPyDropTarget, wxDropTarget, OnLeave); IMP_PYCALLBACK_DR_2WXCDR(wxPyDropTarget, wxDropTarget, OnEnter); IMP_PYCALLBACK_DR_2WXCDR(wxPyDropTarget, wxDropTarget, OnDragOver); IMP_PYCALLBACK_DR_2WXCDR_pure(wxPyDropTarget, wxDropTarget, OnData); IMP_PYCALLBACK_BOOL_INTINT(wxPyDropTarget, wxDropTarget, OnDrop); - %} %name(DropTarget) class wxPyDropTarget // : public wxDropTarget { public: - %addtofunc wxPyDropTarget "if args: args[1].thisown = 0; self._setCallbackInfo(self, DropTarget)" + %addtofunc wxPyDropTarget + "if args: args[0].thisown = 0; + self._setCallbackInfo(self, DropTarget)" wxPyDropTarget(wxDataObject *dataObject = NULL); void _setCallbackInfo(PyObject* self, PyObject* _class); @@ -194,7 +138,7 @@ public: bool base_OnDrop(wxCoord x, wxCoord y); // may be called *only* from inside OnData() and will fill m_dataObject - // with the data from the drop source if it returns TRUE + // with the data from the drop source if it returns True bool GetData(); }; @@ -271,7 +215,7 @@ public: bool wxPyFileDropTarget::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames) { - bool rval = FALSE; + bool rval = False; wxPyBeginBlockThreads(); if (wxPyCBH_findCallback(m_myInst, "OnDropFiles")) { PyObject* list = wxArrayString2PyList_helper(filenames); @@ -318,3 +262,5 @@ public: wxPyPtrTypeMap_Add("wxFileDropTarget", "wxPyFileDropTarget"); %} //--------------------------------------------------------------------------- + +#endif