#include <uimanager.h>
Public Member Functions | |
| Button (const ustring &text, const Point &p, Callback slot, const ustring &sfx=STR_NULL) | |
| Constructor. | |
| ustring | getText () const |
| Get the text in the button. | |
| ustring | getSFX () const |
| Get the sound effect associated with this button. | |
| Point | getPoint () const |
| Get the top-left corner where this button is drawn. | |
| Callback | getSlot () const |
| Get the function callback for this button. | |
Private Attributes | |
| ustring | m_Text |
| ustring | m_SFX |
| Point | m_Point |
| Callback | m_Slot |
For simplicity, each GUI button has to be allocated by providing this class with the proper values. The UI::Manager then handles converting the values to correctly assign the Animation struct members.
| UI::Button::Button | ( | const ustring & | text, | |
| const Point & | p, | |||
| Callback | slot, | |||
| const ustring & | sfx = STR_NULL | |||
| ) | [inline] |
Constructor.
| text | The text of the button | |
| p | The top-left corner where this button should be drawn | |
| slot | The function to call when clicked, or NULL to take no action | |
| sfx | Optional sound effect to play on click |
| ustring UI::Button::getText | ( | ) | const [inline] |
Get the text in the button.
| ustring UI::Button::getSFX | ( | ) | const [inline] |
Get the sound effect associated with this button.
| Point UI::Button::getPoint | ( | ) | const [inline] |
Get the top-left corner where this button is drawn.
| Callback UI::Button::getSlot | ( | ) | const [inline] |
Get the function callback for this button.
1.5.3