Public Member Functions | |
DropTarget (IntPtr wxObject) | |
DropTarget (DataObject dataObject) | |
DropTarget () | |
virtual bool | GetData () |
abstract DragResult | OnData (int x, int y, DragResult def) |
virtual DragResult | OnDragOver (int x, int y, DragResult def) |
virtual bool | OnDrop (int x, int y) |
virtual DragResult | OnEnter (int x, int y, DragResult def) |
virtual void | OnLeave () |
void | RunErrorHandler (Exception exc) |
Public Attributes | |
event ErrorEventHandler | OnError |
Protected Member Functions | |
override void | CallDTor () |
Protected Attributes | |
DataObject | m_dataObject = null |
Properties | |
DataObject | DataObject [get, set] |
YOU HAVE TO SET A DATA OBJECT (PREFERABLY IN THE CTOR) BEFORE USING THIS INSTANCE. Otherwise, access violations may result.
There are various virtual handler functions defined in this class which may be overridden to give visual feedback or react in a more fine-tuned way, e.g. by not accepting data on the whole window area, but only a small portion of it. The normal sequence of calls is OnEnter(), possibly many times OnDragOver(), OnDrop() and finally OnData().
wx.DropTarget.DropTarget | ( | ) |
wx.DropTarget.DropTarget | ( | DataObject | dataObject | ) |
wx.DropTarget.DropTarget | ( | IntPtr | wxObject | ) |
override void wx.DropTarget.CallDTor | ( | ) | [protected, virtual] |
virtual bool wx.DropTarget.GetData | ( | ) | [virtual] |
This method may only be called from within OnData
. By default, this method copies the data from the drop source to the wxDataObject associated with this drop target, calling its wx.DataObject.SetData method.
Reimplemented in wx.TextDropTarget, and wx.FileDropTarget.
abstract DragResult wx.DropTarget.OnData | ( | int | x, | |
int | y, | |||
DragResult | def | |||
) | [pure virtual] |
Called after OnDrop() returns true. By default this will usually GetData() and will return the suggested default value def.
x | The x coordinate of the mouse. | |
y | The y coordinate of the mouse. | |
def | Suggested default for return value. Determined by SHIFT or CONTROL key states. |
Implemented in wx.TextDropTarget, and wx.FileDropTarget.
virtual DragResult wx.DropTarget.OnDragOver | ( | int | x, | |
int | y, | |||
DragResult | def | |||
) | [virtual] |
Called when the mouse is being dragged over the drop target. By default, this calls functions return the suggested return value "def".
x | The x coordinate of the mouse. | |
y | The y coordinate of the mouse. | |
def | Suggested default for return value. Determined by SHIFT or CONTROL key states. |
virtual bool wx.DropTarget.OnDrop | ( | int | x, | |
int | y | |||
) | [virtual] |
Called when the user drops a data object on the target. Return false to veto the operation.
x | The x coordinate of the mouse. | |
y | The y coordinate of the mouse. |
Reimplemented in wx.TextDropTarget, and wx.FileDropTarget.
virtual DragResult wx.DropTarget.OnEnter | ( | int | x, | |
int | y, | |||
DragResult | def | |||
) | [virtual] |
Called when the mouse enters the drop target. By default, this calls OnDragOver().
x | The x coordinate of the mouse. | |
y | The y coordinate of the mouse. | |
def | Suggested default for return value. Determined by SHIFT or CONTROL key states. |
virtual void wx.DropTarget.OnLeave | ( | ) | [virtual] |
Called when the mouse leaves the drop target.
void wx.DropTarget.RunErrorHandler | ( | Exception | exc | ) |
Runs the defined error handlers to display the error as given by the argument. This will run the default error handler if not skipped by one of the handlers of the error event.
exc | The error to be displayed. |
DataObject wx.DropTarget.m_dataObject = null [protected] |
event ErrorEventHandler wx.DropTarget.OnError |
This event will be raised on exceptions.
DataObject wx.DropTarget.DataObject [get, set] |
Getter: Return the data object that is associated with this drop process. Available after OnDrop() for instance OnData().
Setter: Sets the data wxDataObject associated with the drop target and deletes any previously associated data object. Please note, that you must set a data object before this target can be activated.