Contents Up Previous Next

wxDropTarget

Overview

This class represents a target for a drag and drop operation.

Derived from

wxObject

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::wxDropTarget

wxDropTarget()

Constructor.


wxDropTarget::~wxDropTarget

~wxDropTarget()

Destructor.


wxDropTarget::GetFormatCount

virtual size_t GetFormatCount() const

Override this to indicate how many formats you support.


wxDropTarget::GetFormat

virtual wxDataFormat GetFormat(size_t n) const

Override this to indicate what kind of data you support.


wxDropTarget::OnData

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).


wxDropTarget::OnDrop

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.


wxDropTarget::OnEnter

virtual void OnEnter()

Called when the mouse enters the drop target.


wxDropTarget::OnLeave

virtual void OnLeave()

Called when the mouse leaves the drop target.