This class create a button with a text. More...
#include <Button.hh>
Inheritance diagram for TextButton:

Public Member Functions | |
| TextButton (const uint x, const uint y, const uint w, const uint h, SDL_Surface *screen, Widget *father, const string txt, const ushort action=CLOSE) | |
| TextButton (const uint w, const uint h, SDL_Surface *screen, Widget *father, const string txt, const ushort action=CLOSE) | |
| TextButton (SDL_Surface *screen, Widget *father, const string txt, const ushort action=CLOSE) | |
| void | drawmotion (SDL_Color textColor, SDL_Color bgColor) |
| Method to draw the button when mouse pointer is inside. | |
| void | draw () |
| Method to draw the button. | |
| void | refresh () |
| virtual method to refresh the widget | |
| void | mousemotion (const uint mousex, const uint mousey) |
| Method to do an action when mouse is moved. | |
| ushort | mousebuttondown (const uint mousex=0, const uint mousey=0) |
| Public method to get the action. | |
This class create a button with a text.
| void TextButton::draw | ( | ) | [virtual] |
Method to draw the button.
Implements Widget.
| void TextButton::drawmotion | ( | SDL_Color | textColor, | |
| SDL_Color | bgColor | |||
| ) |
Method to draw the button when mouse pointer is inside.
| textColor | color of the text of the button in SDL_Color format | |
| bgColor | color of the background of the button in SDL_Color format |
| ushort TextButton::mousebuttondown | ( | const uint | mousex = 0, |
|
| const uint | mousey = 0 | |||
| ) | [virtual] |
Public method to get the action.
| mousex | is the coordinate x of the mouse pointer | |
| mousey | is the coordinate y of the mouse pointer |
Reimplemented from Widget.
| void TextButton::mousemotion | ( | const uint | mousex, | |
| const uint | mousey | |||
| ) | [virtual] |
Method to do an action when mouse is moved.
if the mouse pointer is inside the button if the button is visible -> invisible if the button is invisible -> visible
| mousex | is the coordinate x of the mouse pointer | |
| mousey | is the coordinate y of the mouse pointer |
Implements Widget.
1.4.7