#include <widget.h>
Inheritance diagram for Widget:
Public Member Functions | |
Widget () | |
Widget (const Rectanglei &rect) | |
virtual | ~Widget () |
virtual void | Update (const Point2i &mousePosition, const Point2i &lastMousePosition, Surface &surf) |
virtual void | Draw (const Point2i &mousePosition, Surface &surf) const =0 |
virtual void | ForceRedraw () |
virtual void | SendKey (SDL_keysym key) |
virtual Widget * | Clic (const Point2i &mousePosition, uint button) |
void | SetContainer (Container *_ct) |
virtual void | SetSizePosition (const Rectanglei &rect)=0 |
void | SetXY (int _x, int _y) |
Public Attributes | |
bool | have_focus |
Protected Member Functions | |
void | StdSetSizePosition (const Rectanglei &rect) |
Protected Attributes | |
Container * | ct |
bool | need_redrawing |
Definition at line 32 of file widget.h.
Widget::Widget | ( | ) |
Definition at line 25 of file widget.cpp.
00026 { 00027 have_focus = false; 00028 ct = NULL; 00029 00030 need_redrawing = true; 00031 }
Widget::Widget | ( | const Rectanglei & | rect | ) |
Definition at line 33 of file widget.cpp.
00034 { 00035 position = rect.GetPosition(); 00036 size = rect.GetSize(); 00037 have_focus = false; 00038 ct = NULL; 00039 00040 need_redrawing = true; 00041 }
Here is the call graph for this function:
Widget::~Widget | ( | ) | [virtual] |
Reimplemented in Box, CheckBox, ListBox, SpinButton, SpinButtonBig, SpinButtonWithPicture, WidgetList, MapSelectionBox, NetworkTeamsSelectionBox, TeamBox, and TeamsSelectionBox.
Definition at line 51 of file widget.cpp.
00052 { 00053 need_redrawing = true; 00054 00055 return this; 00056 }
Here is the caller graph for this function:
Implemented in Box, Button, ButtonText, CheckBox, Label, ListBox, ListBoxWithLabel, MsgBox, NullWidget, PictureTextCBox, PictureWidget, SpinButton, SpinButtonBig, SpinButtonWithPicture, TextBox, and WidgetList.
Here is the caller graph for this function:
void Widget::ForceRedraw | ( | ) | [virtual] |
Reimplemented in WidgetList.
Definition at line 86 of file widget.cpp.
00087 { 00088 need_redrawing = true; 00089 }
Here is the caller graph for this function:
void Widget::SendKey | ( | SDL_keysym | key | ) | [virtual] |
void Widget::SetContainer | ( | Container * | _ct | ) |
Definition at line 64 of file widget.cpp.
00065 { 00066 ct = _ct; 00067 }
Here is the caller graph for this function:
virtual void Widget::SetSizePosition | ( | const Rectanglei & | rect | ) | [pure virtual] |
Implemented in VBox, HBox, Button, CheckBox, Label, ListBox, ListBoxWithLabel, MsgBox, NullWidget, PictureTextCBox, PictureWidget, SpinButton, SpinButtonBig, SpinButtonWithPicture, and WidgetList.
Here is the caller graph for this function:
void Widget::SetXY | ( | int | _x, | |
int | _y | |||
) | [inline] |
Definition at line 59 of file widget.h.
00059 { 00060 SetSizePosition( Rectanglei(Point2i(_x, _y), size) ); 00061 };
Here is the call graph for this function:
Here is the caller graph for this function:
void Widget::StdSetSizePosition | ( | const Rectanglei & | rect | ) | [protected] |
Definition at line 58 of file widget.cpp.
00059 { 00060 position = rect.GetPosition(); 00061 size = rect.GetSize(); 00062 }
Here is the call graph for this function:
Here is the caller graph for this function:
void Widget::Update | ( | const Point2i & | mousePosition, | |
const Point2i & | lastMousePosition, | |||
Surface & | surf | |||
) | [virtual] |
Reimplemented in Box, and TeamBox.
Definition at line 69 of file widget.cpp.
00072 { 00073 if ( 00074 need_redrawing 00075 || (Contains(mousePosition) && mousePosition != lastMousePosition) 00076 || (Contains(lastMousePosition) && !Contains(mousePosition)) 00077 ) 00078 { 00079 if (ct != NULL) ct->Redraw(*this, surf); 00080 00081 Draw(mousePosition, surf); 00082 } 00083 need_redrawing = false; 00084 }
Here is the call graph for this function:
Container* Widget::ct [protected] |
bool Widget::have_focus |
bool Widget::need_redrawing [protected] |