ResultBox Class Reference

Inheritance diagram for ResultBox:

Inheritance graph
[legend]
Collaboration diagram for ResultBox:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ResultBox (const Rectanglei &rect, bool _visible, const char *type_name, Font &font, const Point2i &type_size, const Point2i &name_size, const Point2i &score_size)
void SetResult (const std::string &name, int score)

Private Attributes

Boxtype_box
Boxname_box
Labelname_lbl
Boxscore_box
Labelscore_lbl

Detailed Description

Definition at line 39 of file results_menu.cpp.


Constructor & Destructor Documentation

ResultBox::ResultBox ( const Rectanglei rect,
bool  _visible,
const char *  type_name,
Font font,
const Point2i type_size,
const Point2i name_size,
const Point2i score_size 
)

Definition at line 59 of file results_menu.cpp.

00064   : HBox(rect, _visible)
00065 {
00066   Point2i pos(0, 0);
00067   Point2i posZero(0,0);
00068 
00069   margin = DEF_MARGIN;
00070   border.SetValues(DEF_BORDER, DEF_BORDER);
00071 
00072   type_box = new HBox( Rectanglei(pos, type_size), true);
00073   type_box->AddWidget(new Label(type_name, Rectanglei(pos, type_size), font));
00074   AddWidget(type_box);
00075 
00076   pos.SetValues(pos.GetX()+type_size.GetX(), pos.GetY());
00077   name_box = new HBox( Rectanglei(pos, name_size), true);
00078   name_lbl = new Label("", Rectanglei(pos, name_size), font);
00079   name_box->AddWidget(name_lbl);
00080   AddWidget(name_box);
00081 
00082   pos.SetValues(pos.GetX()+name_size.GetX(), pos.GetY());
00083   score_box = new HBox( Rectanglei(pos, score_size), true);
00084   score_lbl = new Label("", Rectanglei(pos, score_size), font);
00085   score_box->AddWidget(score_lbl);
00086   AddWidget(score_box);
00087 }

Here is the call graph for this function:


Member Function Documentation

void ResultBox::SetResult ( const std::string &  name,
int  score 
)

Definition at line 89 of file results_menu.cpp.

00090 {
00091   char buffer[16];
00092   std::string copy_name(name);
00093 
00094   snprintf(buffer, 16, "%i", score);
00095 
00096   std::string score_str(buffer);
00097 
00098   name_lbl->SetText(copy_name);
00099   score_lbl->SetText(score_str);
00100 
00101   ForceRedraw();
00102 }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Box* ResultBox::name_box [private]

Definition at line 43 of file results_menu.cpp.

Label* ResultBox::name_lbl [private]

Definition at line 44 of file results_menu.cpp.

Box* ResultBox::score_box [private]

Definition at line 45 of file results_menu.cpp.

Label* ResultBox::score_lbl [private]

Definition at line 46 of file results_menu.cpp.

Box* ResultBox::type_box [private]

Definition at line 42 of file results_menu.cpp.


The documentation for this class was generated from the following file:
Generated on Mon Jan 1 14:14:26 2007 for Wormux by  doxygen 1.4.7