Applied DnD patch, adding a field for setting a default action.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32689 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2005-03-08 22:50:46 +00:00
parent c376d80f40
commit 917ae499da
4 changed files with 62 additions and 13 deletions

View File

@@ -141,7 +141,7 @@ public:
// by wxDropTarget and deleted by it automatically. If you don't give it
// here, you can use SetDataObject() later.
wxDropTargetBase(wxDataObject *dataObject = (wxDataObject*)NULL)
{ m_dataObject = dataObject; }
{ m_dataObject = dataObject; m_defaultAction = wxDragNone; }
// dtor deletes our data object
virtual ~wxDropTargetBase()
{ delete m_dataObject; }
@@ -192,8 +192,21 @@ public:
// with the data from the drop source if it returns true
virtual bool GetData() = 0;
// 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)
{ m_defaultAction = action; }
// returns default action for drag and drop or
// wxDragNone if this not specified
wxDragResult GetDefaultAction()
{ return m_defaultAction; }
protected:
wxDataObject *m_dataObject;
wxDragResult m_defaultAction;
DECLARE_NO_COPY_CLASS(wxDropTargetBase)
};