Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages | Examples

PG_WidgetDnD Class Reference

Inheritance diagram for PG_WidgetDnD:

Inheritance graph
[legend]
Collaboration diagram for PG_WidgetDnD:

Collaboration graph
[legend]
List of all members.

Detailed Description

Drag and drop handler.

Author:
Alexander Pipelka

All classes that would ever require drag and drop functionality (esentially all widgets) derive from this (eventually). Handles both the sending and receiving of all DnD events.


Public Member Functions

 PG_WidgetDnD (PG_Widget *parent, int dndID, const PG_Rect &r)
 PG_WidgetDnD (PG_Widget *parent, int dndID, const PG_Rect &r, bool bCreateSurface)
 ~PG_WidgetDnD ()
bool GetDrop ()
bool GetDrag ()
void RemoveObjectDnD (PG_WidgetDnD *obj)
void SetDrop (bool drop)
void SetDrag (bool drag)
void updateDragArea (PG_Point pt, SDL_Surface *image)
void drawDragArea (PG_Point pt, SDL_Surface *image)

Protected Member Functions

PG_WidgetDnDFindDropTarget (PG_Point pt)
bool eventMouseButtonDown (const SDL_MouseButtonEvent *button)
 Overridable Eventhandler for a SDL_MouseButtonEvent message.

bool eventMouseMotion (const SDL_MouseMotionEvent *motion)
 Overridable Eventhandler for a SDL_MouseMotionEvent message.

bool eventMouseButtonUp (const SDL_MouseButtonEvent *button)
 Overridable Eventhandler for a SDL_MouseButtonEvent message.

virtual bool AcceptDrop (PG_WidgetDnD *source, int dndID)
virtual bool eventDragStart ()
virtual bool eventDragDrop (PG_WidgetDnD *source, int dndID)
virtual bool eventDragCancel ()
virtual SDL_Surface * eventQueryDragImage ()
virtual SDL_Surface * eventQueryDropImage (SDL_Surface *dragimage=NULL)

Protected Attributes

PG_WidgetDnDdnd_next

Static Protected Attributes

PG_WidgetDnDdnd_objectlist


Constructor & Destructor Documentation

PG_WidgetDnD::PG_WidgetDnD PG_Widget parent,
int  dndID,
const PG_Rect r
 

PG_WidgetDnD::PG_WidgetDnD PG_Widget parent,
int  dndID,
const PG_Rect r,
bool  bCreateSurface
 

PG_WidgetDnD::~PG_WidgetDnD  ) 
 


Member Function Documentation

virtual bool PG_WidgetDnD::AcceptDrop PG_WidgetDnD source,
int  dndID
[protected, virtual]
 

void PG_WidgetDnD::drawDragArea PG_Point  pt,
SDL_Surface *  image
 

virtual bool PG_WidgetDnD::eventDragCancel  )  [protected, virtual]
 

virtual bool PG_WidgetDnD::eventDragDrop PG_WidgetDnD source,
int  dndID
[protected, virtual]
 

virtual bool PG_WidgetDnD::eventDragStart  )  [protected, virtual]
 

bool PG_WidgetDnD::eventMouseButtonDown const SDL_MouseButtonEvent *  button  )  [protected, virtual]
 

Overridable Eventhandler for a SDL_MouseButtonEvent message.

This handler is called when a mouse button is pressed. The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
button SDL_MouseButtonEvent message
Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

Reimplemented from PG_MessageObject.

bool PG_WidgetDnD::eventMouseButtonUp const SDL_MouseButtonEvent *  button  )  [protected, virtual]
 

Overridable Eventhandler for a SDL_MouseButtonEvent message.

This handler is called when a mouse button is released. The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
button SDL_MouseButtonEvent message
Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

Reimplemented from PG_MessageObject.

bool PG_WidgetDnD::eventMouseMotion const SDL_MouseMotionEvent *  motion  )  [protected, virtual]
 

Overridable Eventhandler for a SDL_MouseMotionEvent message.

This handler is called when mouse movement is detected. The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
motion SDL_MouseMotionEvent message
Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

Reimplemented from PG_MessageObject.

virtual SDL_Surface* PG_WidgetDnD::eventQueryDragImage  )  [protected, virtual]
 

virtual SDL_Surface* PG_WidgetDnD::eventQueryDropImage SDL_Surface *  dragimage = NULL  )  [protected, virtual]
 

PG_WidgetDnD* PG_WidgetDnD::FindDropTarget PG_Point  pt  )  [protected]
 

bool PG_WidgetDnD::GetDrag  ) 
 

bool PG_WidgetDnD::GetDrop  ) 
 

void PG_WidgetDnD::RemoveObjectDnD PG_WidgetDnD obj  ) 
 

void PG_WidgetDnD::SetDrag bool  drag  ) 
 

void PG_WidgetDnD::SetDrop bool  drop  ) 
 

void PG_WidgetDnD::updateDragArea PG_Point  pt,
SDL_Surface *  image
 


Member Data Documentation

PG_WidgetDnD* PG_WidgetDnD::dnd_next [protected]
 

PG_WidgetDnD* PG_WidgetDnD::dnd_objectlist [static, protected]
 



The ParaGUI Project - Alexander Pipelka