Box Class Reference

#include <box.h>

Inheritance diagram for Box:

Inheritance graph
[legend]
Collaboration diagram for Box:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Box (const Rectanglei &rect, bool _visible=true)
virtual ~Box ()
void Update (const Point2i &mousePosition, const Point2i &lastMousePosition, Surface &surf)
void Draw (const Point2i &mousePosition, Surface &surf) const
void Redraw (const Rectanglei &rect, Surface &surf)
WidgetClic (const Point2i &mousePosition, uint button)
void SetMargin (uint _margin)
void SetBorder (const Point2i &newBorder)
virtual void AddWidget (Widget *a_widget)=0

Protected Attributes

bool visible
uint margin
Point2i border

Detailed Description

Definition at line 29 of file box.h.


Constructor & Destructor Documentation

Box::Box ( const Rectanglei rect,
bool  _visible = true 
)

Definition at line 27 of file box.cpp.

00027                                               : WidgetList( rect )
00028 {
00029   visible = _visible;
00030   margin = 5;
00031   border.SetValues(5, 5);
00032 }

Here is the call graph for this function:

Box::~Box (  )  [virtual]

Definition at line 34 of file box.cpp.

00035 {
00036 }


Member Function Documentation

virtual void Box::AddWidget ( Widget a_widget  )  [pure virtual]

Reimplemented from WidgetList.

Implemented in VBox, and HBox.

Here is the caller graph for this function:

Widget * Box::Clic ( const Point2i mousePosition,
uint  button 
) [virtual]

Reimplemented from WidgetList.

Reimplemented in MapSelectionBox, NetworkTeamsSelectionBox, TeamBox, and TeamsSelectionBox.

Definition at line 73 of file box.cpp.

00074 {
00075   return WidgetList::Clic(mousePosition, button);
00076 }

Here is the call graph for this function:

void Box::Draw ( const Point2i mousePosition,
Surface surf 
) const [virtual]

Reimplemented from WidgetList.

Definition at line 62 of file box.cpp.

00064 {
00065   Rectanglei rect(position, size);
00066         
00067   if( visible ){
00068     surf.BoxColor(rect, defaultOptionColorBox);
00069     surf.RectangleColor(rect, defaultOptionColorRect,2);
00070   }
00071 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Box::Redraw ( const Rectanglei rect,
Surface surf 
) [virtual]

Reimplemented from WidgetList.

Definition at line 38 of file box.cpp.

00040 {
00041   // Redraw bottom layer container
00042   WidgetList::Redraw(rect, surf);
00043 
00044   if ( visible ) {
00045     // Redraw
00046     surf.BoxColor(rect, defaultOptionColorBox);
00047   }
00048 }

Here is the call graph for this function:

Here is the caller graph for this function:

void Box::SetBorder ( const Point2i newBorder  ) 

Definition at line 83 of file box.cpp.

00084 {
00085   border = newBorder;
00086 }

Here is the caller graph for this function:

void Box::SetMargin ( uint  _margin  ) 

Definition at line 78 of file box.cpp.

00079 {
00080   margin = _margin;
00081 }

Here is the caller graph for this function:

void Box::Update ( const Point2i mousePosition,
const Point2i lastMousePosition,
Surface surf 
) [virtual]

Reimplemented from Widget.

Reimplemented in TeamBox.

Definition at line 50 of file box.cpp.

00053 {
00054   if (need_redrawing) {
00055     Draw(mousePosition, surf);
00056   }
00057 
00058   WidgetList::Update(mousePosition, surf);
00059   need_redrawing = false;
00060 }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Point2i Box::border [protected]

Definition at line 34 of file box.h.

uint Box::margin [protected]

Definition at line 33 of file box.h.

bool Box::visible [protected]

Definition at line 32 of file box.h.


The documentation for this class was generated from the following files:
Generated on Mon Jan 1 13:37:41 2007 for Wormux by  doxygen 1.4.7