X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ae3c17b4013e80b99976c750c19fca47729517f6..3399af21d10d3f8ce4f39dfb29df5546ab265ef6:/interface/wx/dnd.h?ds=sidebyside diff --git a/interface/wx/dnd.h b/interface/wx/dnd.h index a6d5890f2d..34f9ba6fc7 100644 --- a/interface/wx/dnd.h +++ b/interface/wx/dnd.h @@ -3,12 +3,11 @@ // Purpose: interface of wxDropSource and wx*DropTarget // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** @class wxTextDropTarget - @wxheader{dnd.h} A predefined drop target for dealing with text data. @@ -29,7 +28,7 @@ public: See wxDropTarget::OnDrop(). This function is implemented appropriately for text, and calls OnDropText(). */ - virtual bool OnDrop(long x, long y, const void data, size_t size); + virtual bool OnDrop(wxCoord x, wxCoord y); /** Override this function to receive dropped text. @@ -43,7 +42,7 @@ public: Return @true to accept the data, or @false to veto the operation. */ - virtual bool OnDropText(wxCoord x, wxCoord y, const wxString& data); + virtual bool OnDropText(wxCoord x, wxCoord y, const wxString& data) = 0; }; @@ -63,7 +62,6 @@ enum wxDragResult /** @class wxDropTarget - @wxheader{dnd.h} This class represents a target for a drag and drop operation. A wxDataObject can be associated with it and by default, this object will be @@ -93,7 +91,7 @@ public: /** Destructor. Deletes the associated data object, if any. */ - ~wxDropTarget(); + virtual ~wxDropTarget(); /** This method may only be called from within OnData(). By default, this @@ -101,7 +99,7 @@ public: associated with this drop target, calling its wxDataObject::SetData() method. */ - virtual void GetData(); + virtual bool GetData(); /** Called after OnDrop() returns @true. By default this will usually @@ -174,7 +172,6 @@ public: /** @class wxDropSource - @wxheader{dnd.h} This class represents a source for a drag and drop operation. @@ -190,11 +187,13 @@ public: /** This constructor requires that you must call SetData() later. - Note that the exact type of @a iconCopy and subsequent parameters - differs between wxMSW and wxGTK: these are cursors under Windows but + Note that the type of @a iconCopy and subsequent parameters + differs between different ports: these are cursors under Windows but icons for GTK. You should use the macro wxDROP_ICON() in portable programs instead of directly using either of these types. + @onlyfor{wxmsw,wxosx} + @param win The window which initiates the drag and drop operation. @param iconCopy @@ -205,15 +204,22 @@ public: The icon or cursor used for feedback when operation can't be done. */ wxDropSource(wxWindow* win = NULL, - const wxIconOrCursor& iconCopy = wxNullIconOrCursor, - const wxIconOrCursor& iconMove = wxNullIconOrCursor, - const wxIconOrCursor& iconNone = wxNullIconOrCursor); + const wxIcon& iconCopy = wxNullIcon, + const wxIcon& iconMove = wxNullIcon, + const wxIcon& iconNone = wxNullIcon); + /** - Note that the exact type of @a iconCopy and subsequent parameters - differs between wxMSW and wxGTK: these are cursors under Windows but + The constructor for wxDataObject. + + Note that the type of @a iconCopy and subsequent parameters + differs between different ports: these are cursors under Windows but icons for GTK. You should use the macro wxDROP_ICON() in portable programs instead of directly using either of these types. + @onlyfor{wxmsw,wxosx} + + @param data + The data associated with the drop source. @param win The window which initiates the drag and drop operation. @param iconCopy @@ -224,14 +230,64 @@ public: The icon or cursor used for feedback when operation can't be done. */ wxDropSource(wxDataObject& data, wxWindow* win = NULL, - const wxIconOrCursor& iconCopy = wxNullIconOrCursor, - const wxIconOrCursor& iconMove = wxNullIconOrCursor, - const wxIconOrCursor& iconNone = wxNullIconOrCursor); + const wxIcon& iconCopy = wxNullIcon, + const wxIcon& iconMove = wxNullIcon, + const wxIcon& iconNone = wxNullIcon); + + /** + This constructor requires that you must call SetData() later. + + Note that the type of @a iconCopy and subsequent parameters + differs between different ports: these are cursors under Windows but + icons for GTK. You should use the macro wxDROP_ICON() in portable + programs instead of directly using either of these types. + + @onlyfor{wxgtk} + + @param win + The window which initiates the drag and drop operation. + @param iconCopy + The icon or cursor used for feedback for copy operation. + @param iconMove + The icon or cursor used for feedback for move operation. + @param iconNone + The icon or cursor used for feedback when operation can't be done. + */ + wxDropSource(wxWindow* win = NULL, + const wxCursor& iconCopy = wxNullCursor, + const wxCursor& iconMove = wxNullCursor, + const wxCursor& iconNone = wxNullCursor); + + /** + The constructor for wxDataObject. + + Note that the type of @a iconCopy and subsequent parameters + differs between different ports: these are cursors under Windows but + icons for GTK. You should use the macro wxDROP_ICON() in portable + programs instead of directly using either of these types. + + @onlyfor{wxgtk} + + @param data + The data associated with the drop source. + @param win + The window which initiates the drag and drop operation. + @param iconCopy + The icon or cursor used for feedback for copy operation. + @param iconMove + The icon or cursor used for feedback for move operation. + @param iconNone + The icon or cursor used for feedback when operation can't be done. + */ + wxDropSource(wxDataObject& data, wxWindow* win = NULL, + const wxCursor& iconCopy = wxNullCursor, + const wxCursor& iconMove = wxNullCursor, + const wxCursor& iconNone = wxNullCursor); /** Default constructor. */ - ~wxDropSource(); + virtual ~wxDropSource(); /** Starts the drag-and-drop operation which will terminate when the user @@ -263,11 +319,9 @@ public: @param effect The effect to implement. One of ::wxDragCopy, ::wxDragMove, ::wxDragLink and ::wxDragNone. - @param scrolling - @true if the window is scrolling. MSW only. @return @false if you want default feedback, or @true if you implement - your own feedback. The return values is ignored under GTK. + your own feedback. The return value is ignored under GTK. */ virtual bool GiveFeedback(wxDragResult effect); @@ -292,7 +346,6 @@ public: /** @class wxFileDropTarget - @wxheader{dnd.h} This is a drop target which accepts files (dragged from File Manager or Explorer). @@ -314,7 +367,7 @@ public: See wxDropTarget::OnDrop(). This function is implemented appropriately for files, and calls OnDropFiles(). */ - virtual bool OnDrop(long x, long y, const void data, size_t size); + virtual bool OnDrop(wxCoord x, wxCoord y); /** Override this function to receive dropped files. @@ -329,7 +382,7 @@ public: Return @true to accept the data, or @false to veto the operation. */ virtual bool OnDropFiles(wxCoord x, wxCoord y, - const wxArrayString& filenames); + const wxArrayString& filenames) = 0; }; @@ -338,7 +391,7 @@ public: // Global functions/macros // ============================================================================ -/** @ingroup group_funcmacro_gdi */ +/** @addtogroup group_funcmacro_gdi */ //@{ /**