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

PG_RectList Class Reference

Collaboration diagram for PG_RectList:

Collaboration graph
[legend]
List of all members.

Detailed Description

A list derived from vector to handle overlapping and child-widgets.

Author:
Alexander Pipelka
Examples:

paratest.cpp.


Public Member Functions

 PG_RectList ()
 constructor of the list

virtual ~PG_RectList ()
 destructor

void Add (PG_Widget *rect, bool front=false)
 add a widget to the list

bool Remove (PG_Rect *rect)
 remove a widget from the list

PG_WidgetIsInside (const PG_Point &p)
 check if a given point is inside any rectangle in the list

PG_WidgetFind (int id)
PG_WidgetFind (const char *name)
void Blit ()
 blit all rectangles in the list to the screen

void Blit (const PG_Rect &rect)
 blit all rectangles from the list intersecting a reference rectangle to the screen

void Blit (const PG_Rect &rect, PG_Widget *first, PG_Widget *last=NULL)
bool BringToFront (PG_Widget *rect)
 reorder a widget (rectangle) - front

bool SendToBack (PG_Widget *rect)
 reorder a widget (rectangle) - back

PG_Widgetfirst ()
PG_Widgetlast ()
void clear ()
Uint32 size ()

Protected Attributes

PG_Widgetmy_first
PG_Widgetmy_last
Uint32 my_count


Constructor & Destructor Documentation

PG_RectList::PG_RectList  ) 
 

constructor of the list

virtual PG_RectList::~PG_RectList  )  [virtual]
 

destructor


Member Function Documentation

void PG_RectList::Add PG_Widget rect,
bool  front = false
 

add a widget to the list

Parameters:
rect pointer to the widget (rect)
front insert the rectangle at the head of the list if true This functions adds the widget to the back of the list.

void PG_RectList::Blit const PG_Rect rect,
PG_Widget first,
PG_Widget last = NULL
 

void PG_RectList::Blit const PG_Rect rect  ) 
 

blit all rectangles from the list intersecting a reference rectangle to the screen

Parameters:
rect reference rectangle
Performs an intersection of all visible rectangles in the list with the reference rectangle. The resulting list is clipped to the reference and blitted to the screen.

void PG_RectList::Blit  ) 
 

blit all rectangles in the list to the screen

This function blits all visible rectangles from the first to the last position to the screen.

bool PG_RectList::BringToFront PG_Widget rect  ) 
 

reorder a widget (rectangle) - front

Parameters:
rect widget to reorder
Returns:
true - the rectangle was found and reordered / false - the rectangle isn't in the list.
Bring the given widget (rectangle) to the front (will overlap all other widgets in the list).

void PG_RectList::clear  ) 
 

PG_Widget* PG_RectList::Find const char *  name  ) 
 

PG_Widget* PG_RectList::Find int  id  ) 
 

PG_Widget* PG_RectList::first  )  [inline]
 

Examples:
paratest.cpp.

PG_Widget* PG_RectList::IsInside const PG_Point p  ) 
 

check if a given point is inside any rectangle in the list

Parameters:
p point to check
Returns:
pointer to the first widget that contains the point / NULL if there is no match
Returns the first visible widget which contains the given point.

PG_Widget* PG_RectList::last  )  [inline]
 

bool PG_RectList::Remove PG_Rect rect  ) 
 

remove a widget from the list

Parameters:
rect pointer to the widget (rect)
Returns:
true - if the widget was remove successfully
This functions removes the given widget from the list

bool PG_RectList::SendToBack PG_Widget rect  ) 
 

reorder a widget (rectangle) - back

Parameters:
rect widget to reorder
Returns:
true - the rectangle was found and reordered / false - the rectangle isn't in the list.
Send the given widget (rectangle) to the back (will be overlapped by all other widgets in the list).

Uint32 PG_RectList::size  )  [inline]
 


Member Data Documentation

Uint32 PG_RectList::my_count [protected]
 

PG_Widget* PG_RectList::my_first [protected]
 

PG_Widget* PG_RectList::my_last [protected]
 



The ParaGUI Project - Alexander Pipelka