This class represents a target for a drag and drop operation.
Derived from
Include files
<wx/dnd.h>
See also
Drag and drop overview, wxDropSource, wxTextDropTarget, wxFileDropTarget
Members
wxDropTarget::wxDropTarget
wxDropTarget::~wxDropTarget
wxDropTarget::GetFormatCount
wxDropTarget::GetFormat
wxDropTarget::OnData
wxDropTarget::OnDrop
wxDropTarget::OnEnter
wxDropTarget::OnLeave
wxDropTarget()
Constructor.
~wxDropTarget()
Destructor.
virtual size_t GetFormatCount() const
Override this to indicate how many formats you support.
virtual wxDataFormat GetFormat(size_t n) const
Override this to indicate what kind of data you support.
virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def)
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).
virtual bool OnDrop(long x, long y, const void* data, size_t size)
Called when the user drops a data object on the target. Return FALSE to veto the operation.
Parameters
x
y
data
size
Return value
Return TRUE to accept the data, FALSE to veto the operation.
virtual void OnEnter()
Called when the mouse enters the drop target.
virtual void OnLeave()
Called when the mouse leaves the drop target.