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 | |
Box * | type_box |
Box * | name_box |
Label * | name_lbl |
Box * | score_box |
Label * | score_lbl |
Definition at line 39 of file results_menu.cpp.
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:
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:
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.