Sourceforge.net - The VCF's Project Host
   The VCF Website Home   |   Online Discussion Forums   |   Sourceforge.net Project Page   

VCF::DropTarget Class Reference

The DropTarget class represents a way to control and be notified when a something is "dropped" ( or just "dragged over" ) as a result of a drag-drop operation. More...

#include <DropTarget.h>

Inheritance diagram for VCF::DropTarget:

VCF::Component VCF::ObjectWithEvents VCF::Object List of all members.

Public Types

enum  { DRAGGING_OVER = CUSTOM_EVENT_TYPES + 303, DRAG_DROPPED, DRAG_LEFT, DRAG_ENTERED }

Public Member Functions

 DropTarget (Control *control)
 DropTarget ()
 DropTarget (Component *owner)
 DropTarget (const String &name, Component *owner)
 DropTarget (const String &name)
virtual ~DropTarget ()
virtual void handleEvent (Event *event)
 generic handler method for events.
DropTargetPeergetDropTargetPeer ()
ControlgetTarget ()
 gets the first control in the target collection.
Enumerator< Control * > * getTargets ()
 Returns all the control targets for this drop target.
void addTargetControl (Control *control)
 Adds a new target control to the drop target's collection and registers it.
void removeTargetControl (Control *control)

Public Attributes

VCF::Delegate DropTargetDraggingOver
VCF::Delegate DropTargetDropped
VCF::Delegate DropTargetLeft
VCF::Delegate DropTargetEntered

Protected Attributes

DropTargetPeerdropTargetPeer_
std::vector< Control * > targets_
EnumeratorContainer< std::vector<
Control * >, Control * > 
targetContainer_

Detailed Description

The DropTarget class represents a way to control and be notified when a something is "dropped" ( or just "dragged over" ) as a result of a drag-drop operation.

In this way, for example, the mouse cursor can be modified according to the control is over.

A drop target works by being registered with a control. This registration is accomplished by calling the addTargetControl() on the drop target and passing in a control instance. For example:

TextControl* textControl = ...//get the control from somewhere
Panel* somePanel = ...//get the panel from somewhere

DropTarget dropTarget;
dropTarget.addTargetControl( textControl );
dropTarget.addTargetControl( somePanel );

Event Delegates for this class:


Member Enumeration Documentation

anonymous enum
 

Enumerator:
DRAGGING_OVER 
DRAG_DROPPED 
DRAG_LEFT 
DRAG_ENTERED 


Constructor & Destructor Documentation

VCF::DropTarget::DropTarget Control control  ) 
 

VCF::DropTarget::DropTarget  ) 
 

VCF::DropTarget::DropTarget Component owner  ) 
 

VCF::DropTarget::DropTarget const String name,
Component owner
 

VCF::DropTarget::DropTarget const String name  ) 
 

virtual VCF::DropTarget::~DropTarget  )  [virtual]
 


Member Function Documentation

void VCF::DropTarget::addTargetControl Control control  ) 
 

Adds a new target control to the drop target's collection and registers it.

DropTargetPeer* VCF::DropTarget::getDropTargetPeer  ) 
 

Control* VCF::DropTarget::getTarget  ) 
 

gets the first control in the target collection.

Typically a DropTarget will just have a single control that it's associated with (though it may certainly have more than one).

Enumerator<Control*>* VCF::DropTarget::getTargets  ) 
 

Returns all the control targets for this drop target.

virtual void VCF::DropTarget::handleEvent Event event  )  [virtual]
 

generic handler method for events.

All UI events are sent here and then dispatched accordingly to a more specific event handler. If an Application class is present, then it is given a chance to "see" the event first before delegating it to the Component.

All events are dispatched by their type so it is important to correctly identify the event objects type if you would like it to be dispatched correctly. The method will call the appropriate component method, like afterCreate(), beforeDestroy(), etc.

Parameters:
Event based on the value returned by Event::getType(),

Reimplemented from VCF::Component.

void VCF::DropTarget::removeTargetControl Control control  ) 
 


Member Data Documentation

VCF::Delegate VCF::DropTarget::DropTargetDraggingOver
 

Event Delegate:
DropTargetDraggingOver is fired by the underlying windowing system when a dataobject is being dragged over a registered drop target.
event class: DropTargetEvent
event type: DropTarget::DRAGGING_OVER

VCF::Delegate VCF::DropTarget::DropTargetDropped
 

Event Delegate:
DropTargetDropped this is fired by the windowing system when something is "dropped" on a control registered with the drop target
event class: DropTargetEvent
event type:

VCF::Delegate VCF::DropTarget::DropTargetEntered
 

Event Delegate:
DropTargetEntered this is fired by the underlying windowing system when something that is being dragged first enters the control registered with this drop target.
event class: DropTargetEvent
event type: DropTarget::DRAG_ENTERED

VCF::Delegate VCF::DropTarget::DropTargetLeft
 

Event Delegate:
DropTargetLeft is fired by the underlying windowing system when the "something" being dragged has left the control registered with this drop target.
event class: DropTargetEvent
event type: DropTarget::DRAG_LEFT

DropTargetPeer* VCF::DropTarget::dropTargetPeer_ [protected]
 

EnumeratorContainer<std::vector<Control*>,Control*> VCF::DropTarget::targetContainer_ [protected]
 

std::vector<Control*> VCF::DropTarget::targets_ [protected]
 


The documentation for this class was generated from the following file:
   Comments or Suggestions?    License Information