A menu is a collection of Widget with a simple box color in background. More...
#include <Menu.hh>
Inheritance diagram for Menu:

Public Member Functions | |
| Menu (const uint x, const uint y, SDL_Surface *screen, const ushort width=MENU_WIDTH, const string title="") | |
| constructor | |
| Menu (const uint x, const uint y, SDL_Surface *screen, const ushort width, const ushort height, const string title="") | |
| constructor | |
| ~Menu () | |
| destructor | |
| void | draw () |
| Method to draw the menu. | |
| void | refresh () |
| Method to refresh the menu. | |
| void | erase () |
| Method to erase the menu. | |
| ushort | mousebuttondown (const uint mousex=0, const uint mousey=0) |
| Method to do an action when mouse button is down. | |
| void | mousemotion (const uint mousex, const uint mousey) |
| Method to do an action when the mouse is moved. | |
| void | addWidget (Widget *widget) |
| Method to add a widget in the menu. | |
| void | addWidget (Widget *widget, const uint x, const uint y) |
| Method to add a widget in the menu. | |
| void | deleteWidget (const ushort indice) |
| Method to delete a widget in the menu. | |
| void | setbgColor (SDL_Color bgColor) |
| Method to set the value of background color of the menu. | |
| SDL_Color | getbgColor () |
| Method to get the value of the background color of the menu. | |
| void | setfgColor (SDL_Color fgColor) |
| Method to set the value of foreground color of the menu. | |
| SDL_Color | getfgColor () |
| Method to get the value of the foreground color of the menu. | |
| ushort | getwidth () |
| ushort | getheight () |
| ushort | getnbwidget () |
| ushort | getpadx () |
| ushort | getpady () |
A menu is a collection of Widget with a simple box color in background.
| Menu::Menu | ( | const uint | x, | |
| const uint | y, | |||
| SDL_Surface * | screen, | |||
| const ushort | width = MENU_WIDTH, |
|||
| const string | title = "" | |||
| ) |
constructor
| x | is the x coordinate of the menu in the window | |
| y | is the y coordiante of the menu in the window | |
| screen | is the container father of the menu | |
| width | is the width of the menu box | |
| title | string if menu has title |
| Menu::Menu | ( | const uint | x, | |
| const uint | y, | |||
| SDL_Surface * | screen, | |||
| const ushort | width, | |||
| const ushort | height, | |||
| const string | title = "" | |||
| ) |
constructor
| x | is the x coordinate of the menu in the window | |
| y | is the y coordiante of the menu in the window | |
| screen | is the container father of the menu | |
| width | is the width of the menu box | |
| height | is the height of the menu box | |
| title | string if menu has title |
| void Menu::addWidget | ( | Widget * | widget, | |
| const uint | x, | |||
| const uint | y | |||
| ) |
Method to add a widget in the menu.
| widget | is a reference to the widget to add | |
| x | is the x coordinate of the widget (relative to menu box) | |
| y | is the y coordinate of the widget (relative to menu box) |
| void Menu::addWidget | ( | Widget * | widget | ) |
Method to add a widget in the menu.
| widget | is a reference to the widget to add |
| void Menu::deleteWidget | ( | const ushort | indice | ) |
Method to delete a widget in the menu.
| indice | is the index of the button to delete |
| void Menu::draw | ( | ) | [virtual] |
Method to draw the menu.
Implements Widget.
| SDL_Color Menu::getbgColor | ( | ) | [inline] |
Method to get the value of the background color of the menu.
| SDL_Color Menu::getfgColor | ( | ) | [inline] |
Method to get the value of the foreground color of the menu.
| ushort Menu::mousebuttondown | ( | const uint | mousex = 0, |
|
| const uint | mousey = 0 | |||
| ) | [virtual] |
Method to do an action when mouse button is down.
| mousex | is the coordinate x of the mouse pointer | |
| mousey | is the coordinate y of the mouse pointer |
Reimplemented from Widget.
| void Menu::mousemotion | ( | const uint | mousex, | |
| const uint | mousey | |||
| ) | [virtual] |
Method to do an action when the mouse is moved.
This method do mousemotion for each button of the menu
| mousex | is the coordinate x of the mouse pointer | |
| mousey | is the coordinate y of the mouse pointer |
Implements Widget.
| void Menu::refresh | ( | ) | [virtual] |
| void Menu::setbgColor | ( | SDL_Color | bgColor | ) |
Method to set the value of background color of the menu.
| bgColor | is the new background color of the menu |
| void Menu::setfgColor | ( | SDL_Color | fgColor | ) |
Method to set the value of foreground color of the menu.
| fgColor | is the new foreground color of the menu |
1.4.7