This class is a virtual class. You need to use a class which inherit from it to do a widget. More...
#include <Widget.hh>
Inheritance diagram for Widget:

Public Member Functions | |
| Widget (SDL_Surface *screen, Widget *father=NULL) | |
| Widget (const uint w, const uint h, SDL_Surface *screen, Widget *father=NULL) | |
| Widget (const uint x, const uint y, const uint w, const uint h, SDL_Surface *screen, Widget *father=NULL) | |
| virtual | ~Widget () |
| virtual void | draw ()=0 |
| virtual method to draw the widget. | |
| virtual void | refresh ()=0 |
| virtual method to refresh the widget | |
| void | erase () |
| Method to erase the widget. | |
| virtual void | mousemotion (const uint mousex, const uint mousey)=0 |
| virtual method to do something when the mouse is moved | |
| ushort | inside (const uint mousex, const uint mousey) |
| method to test if the mouse pointer is inside the widget | |
| virtual ushort | mousebuttondown (const uint mousex, const uint mousey) |
| virtual method to do something when a button of the mouse is pressed | |
| virtual void | keydown (const SDL_keysym *keysym) |
| virtual method to do something when a key of the keyboard is pressed | |
| virtual void | gainfocus () |
| virtual method used when the widget gain the focus | |
| virtual void | losefocus () |
| virtual method used when the widget lose the focus | |
| virtual bool | hasfocus () |
| virtual method to test tha value of the focus variable | |
| uint | get_x () |
| Method to get the x coordinate of the widget in the father coordinate system. | |
| uint | get_wx () |
| Method to get the x coordinate of the widget in the window coordinate system. | |
| void | set_x (const uint x) |
| Method to set the x coordinate of the widget in the father coordinate system. | |
| uint | get_y () |
| Method to get the y coordinate of the widget in the father coordinate system. | |
| uint | get_wy () |
| Method to get the y coordinate of the widget in the window coordinate system. | |
| void | set_y (const uint y) |
| Method to set the y coordinate of the widget in the father coordinate system. | |
| uint | get_width () |
| Method to get the width of the widget. | |
| void | set_width (const uint width) |
| Method to set the width of the widget. | |
| uint | get_height () |
| Method to get the height of the widget. | |
| void | set_height (const uint height) |
| Method to set the heigth ot the widget. | |
Static Public Member Functions | |
| static Focus & | get_focus () |
| Method to return the globfocus. | |
Protected Attributes | |
| SDL_Surface * | screen |
| SDL_Surface * | old_screen |
| SDL_Surface * | widget |
| Widget * | father |
| uint | x |
| uint | y |
| uint | w |
| uint | h |
| bool | visible |
| bool | focus |
Static Protected Attributes | |
| static Focus | globfocus |
This class is a virtual class. You need to use a class which inherit from it to do a widget.
| Widget::Widget | ( | SDL_Surface * | screen, | |
| Widget * | father = NULL | |||
| ) |
Constructor
| screen | is the SDL_Surface in which the widget will be printed | |
| father | is the widget father |
| Widget::Widget | ( | const uint | w, | |
| const uint | h, | |||
| SDL_Surface * | screen, | |||
| Widget * | father = NULL | |||
| ) |
Constructor
| w | is the width of the widget | |
| h | is the height of the widget | |
| screen | is the SDL_Surface in which the widget will be printed | |
| father | is the widget father |
| Widget::Widget | ( | const uint | x, | |
| const uint | y, | |||
| const uint | w, | |||
| const uint | h, | |||
| SDL_Surface * | screen, | |||
| Widget * | father = NULL | |||
| ) |
Constructor
| x | is the x coordinate of the widget | |
| y | is the y coordinate of the widget | |
| w | is the width of the widget | |
| h | is the height of the widget | |
| screen | is the SDL_Surface in which the widget will be printed | |
| father | is the widget father |
| Widget::~Widget | ( | ) | [virtual] |
Destructor
| void Widget::erase | ( | ) |
| void Widget::gainfocus | ( | ) | [virtual] |
virtual method used when the widget gain the focus
The method set focus variable to true ..
| Focus & Widget::get_focus | ( | ) | [static] |
Method to return the globfocus.
globfocus is a static variable which stores the reference of the widget which has focus
| uint Widget::get_height | ( | ) |
Method to get the height of the widget.
| uint Widget::get_width | ( | ) |
Method to get the width of the widget.
| uint Widget::get_wx | ( | ) |
Method to get the x coordinate of the widget in the window coordinate system.
| uint Widget::get_wy | ( | ) |
Method to get the y coordinate of the widget in the window coordinate system.
| uint Widget::get_x | ( | ) |
Method to get the x coordinate of the widget in the father coordinate system.
| uint Widget::get_y | ( | ) |
Method to get the y coordinate of the widget in the father coordinate system.
| bool Widget::hasfocus | ( | ) | [virtual] |
virtual method to test tha value of the focus variable
| ushort Widget::inside | ( | const uint | mousex, | |
| const uint | mousey | |||
| ) |
method to test if the mouse pointer is inside the widget
| mousex | is the mouse pointer x coordinate | |
| mousey | is the mouse pointer y coordinate |
| virtual void Widget::keydown | ( | const SDL_keysym * | keysym | ) | [inline, virtual] |
virtual method to do something when a key of the keyboard is pressed
| keysym | is the key pressed in Keysym structure |
| void Widget::losefocus | ( | ) | [virtual] |
virtual method used when the widget lose the focus
The method set focus variable to false ..
| ushort Widget::mousebuttondown | ( | const uint | mousex, | |
| const uint | mousey | |||
| ) | [virtual] |
virtual method to do something when a button of the mouse is pressed
| mousex | is the mouse pointer x coordinate | |
| mousey | is the mouse pointer y coordinate |
Reimplemented in ImageButton, TextButton, DialogBox, DInfo, and Menu.
| virtual void Widget::mousemotion | ( | const uint | mousex, | |
| const uint | mousey | |||
| ) | [pure virtual] |
virtual method to do something when the mouse is moved
| mousex | is the mouse pointer x coordinate | |
| mousey | is the mouse pointer y coordinate |
Implemented in ImageButton, TextButton, DialogBox, and Menu.
| void Widget::set_height | ( | const uint | height | ) |
Method to set the heigth ot the widget.
| height | is the value to set |
| void Widget::set_width | ( | const uint | width | ) |
Method to set the width of the widget.
| width | is the value to set |
| void Widget::set_x | ( | const uint | x | ) |
Method to set the x coordinate of the widget in the father coordinate system.
| x | is the value to set |
| void Widget::set_y | ( | const uint | y | ) |
Method to set the y coordinate of the widget in the father coordinate system.
| y | is the value to set |
1.4.7