Inheritance diagram for DragAndDropTarget:

To create a component that can receive things drag-and-dropped by a DragAndDropContainer, derive your component from this class, and make sure that it is somewhere inside a DragAndDropContainer component.
Note: If all that you need to do is to respond to files being drag-and-dropped from the operating system onto your component, you don't need any of these classes: instead see the FileDragAndDropTarget class.
Public Member Functions | |
| virtual | ~DragAndDropTarget () |
| Destructor. | |
| virtual bool | isInterestedInDragSource (const String &sourceDescription, Component *sourceComponent)=0 |
| Callback to check whether this target is interested in the type of object being dragged. | |
| virtual void | itemDragEnter (const String &sourceDescription, Component *sourceComponent, int x, int y) |
| Callback to indicate that something is being dragged over this component. | |
| virtual void | itemDragMove (const String &sourceDescription, Component *sourceComponent, int x, int y) |
| Callback to indicate that the user is dragging something over this component. | |
| virtual void | itemDragExit (const String &sourceDescription, Component *sourceComponent) |
| Callback to indicate that something has been dragged off the edge of this component. | |
| virtual void | itemDropped (const String &sourceDescription, Component *sourceComponent, int x, int y)=0 |
| Callback to indicate that the user has dropped something onto this component. | |
| virtual bool | shouldDrawDragImageWhenOver () |
| Overriding this allows the target to tell the drag container whether to draw the drag image while the cursor is over it. | |
|
|
Destructor.
|
|
||||||||||||
|
Callback to check whether this target is interested in the type of object being dragged.
Implemented in Toolbar. |
|
||||||||||||||||||||
|
Callback to indicate that something is being dragged over this component. This gets called when the user moves the mouse into this component while dragging something. Use this callback as a trigger to make your component repaint itself to give the user feedback about whether the item can be dropped here or not.
|
|
||||||||||||||||||||
|
Callback to indicate that the user is dragging something over this component. This gets called when the user moves the mouse over this component while dragging something. Normally overriding itemDragEnter() and itemDragExit() are enough, but this lets you know what happens in-between.
Reimplemented in Toolbar. |
|
||||||||||||
|
Callback to indicate that something has been dragged off the edge of this component. This gets called when the user moves the mouse out of this component while dragging something. If you've used itemDragEnter() to repaint your component and give feedback, use this as a signal to repaint it in its normal state.
Reimplemented in Toolbar. |
|
||||||||||||||||||||
|
Callback to indicate that the user has dropped something onto this component. When the user drops an item this get called, and you can use the description to work out whether your object wants to deal with it or not. Note that after this is called, the itemDragExit method may not be called, so you should clean up in here if there's anything you need to do when the drag finishes.
Implemented in Toolbar. |
|
|
Overriding this allows the target to tell the drag container whether to draw the drag image while the cursor is over it. By default it returns true, but if you return false, then the normal drag image will not be shown when the cursor is over this target. |