Main Page | Class Hierarchy | Class List | File List | Class Members

Flu_DND Class Reference

This class augments the existing FLTK drag-n-drop feature, working with Flu_DND_Event to achieve new functionality. More...

#include <Flu_DND.h>

List of all members.

Public Member Functions

void dnd_callback (void(*cb)(const Flu_DND_Event *, void *), void *cbd=0)
 Set the function that is called when the dragged object is dropped. This is called in addition to the member function on_dnd_drop().


Protected Member Functions

 Flu_DND (const char *thisType)
 Default constructor.

virtual ~Flu_DND ()
 Default destructor.

bool dnd_event_is_text () const
 See Flu_DND_Event::event_is_text().

bool dnd_event_is_other () const
 See Flu_DND_Event::event_is_other().

bool dnd_is_dragging () const
 See Flu_DND_Event::event_is_valid().

bool dnd_is_data_type (const char *t) const
 See Flu_DND_Event::is_data_type().

void dnd_allow_text (bool b)
 Set whether standard FLTK text events can be dropped on this object.

bool dnd_allow_text () const
 Get whether standard FLTK text events can be dropped on this object.

void dnd_allow_dragging (bool b)
 Set whether this object can be dragged to another object.

bool dnd_allow_dragging () const
 Get whether this object can be dragged to another object.

void dnd_allow_dropping (bool b)
 Set whether this object can have other objects dropped on it.

bool dnd_allow_dropping () const
 Get whether this object can have other objects dropped on it.

void dnd_allow_type (const char *t)
 Add type t to the list of types that are allowed to be dropped on this object (up to a compiled maximum of FLU_DND_MAX_TYPES).

bool dnd_type_allowed (const char *t) const
 true if type t is allowed to be dropped on this object, false otherwise

void dnd_grab (void *data, const char *type)
 Descendents should call this when they detect themselves being grabbed for a drag-n-drop.

int dnd_handle (int event)
 Descendents should call this at the start of their handle() method to handle DND processing.

virtual void on_dnd_release ()
 Descendents can override this to respond to when the mouse is let go during a drag-n-drop (regardless of whether the item was dropped on you).

virtual void on_dnd_enter ()
 Descendents can override this to respond to when the mouse has entered you during a drag-n-drop.

virtual void on_dnd_leave ()
 Descendents can override this to respond to when the mouse has left you during a drag-n-drop.

virtual void on_dnd_drop (const Flu_DND_Event *e)
 Descendents should override this to respond to when the dragged object has been dropped on you.

virtual bool on_dnd_drag (int X, int Y)
 Descendents should override this to indicate whether the currently dragged item is allowed to be dropped on you (for example, if the item can only be dropped at certain locations).


Detailed Description

This class augments the existing FLTK drag-n-drop feature, working with Flu_DND_Event to achieve new functionality.

It adds the ability to create specific DND objects, allowing classes that handle DND to discriminate between which objects are "allowed" to be dropped on them.

Almost all functions are protected, since only a derived class should be in charge of what kinds of events to handle and what kinds of objects to support.


The documentation for this class was generated from the following file:
Generated on Fri Nov 5 12:41:32 2004 for FLTK Utility Library and Widget Collection (FLU) by doxygen 1.3.5