Button widget.
More...
#include <button.h>
|
| Button () |
| Default constructor.
|
|
| Button (const std::string &caption, const std::string &actionEventId, gcn::ActionListener *listener) |
| Constructor, sets the caption of the button to the given string and adds the given action listener.
|
|
| ~Button () override |
|
void | draw (gcn::Graphics *graphics) override |
| Draws the button.
|
|
void | adjustSize () |
|
void | setCaption (const std::string &caption) |
|
bool | setButtonIcon (const std::string &iconFile) |
| Set the icons available next to the text.
|
|
void | setButtonPopupText (const std::string &text) |
| Set the button popup text when hovering it for a few seconds.
|
|
void | mouseMoved (gcn::MouseEvent &event) override |
|
void | mouseExited (gcn::MouseEvent &event) override |
|
Button widget.
Same as the Guichan button but with custom look.
Definition at line 37 of file button.h.
◆ Button() [1/2]
Default constructor.
Definition at line 45 of file button.cpp.
◆ Button() [2/2]
Button::Button |
( |
const std::string & |
caption, |
|
|
const std::string & |
actionEventId, |
|
|
gcn::ActionListener * |
listener |
|
) |
| |
Constructor, sets the caption of the button to the given string and adds the given action listener.
Definition at line 51 of file button.cpp.
◆ ~Button()
◆ adjustSize()
void Button::adjustSize |
( |
| ) |
|
◆ draw()
void Button::draw |
( |
gcn::Graphics * |
graphics | ) |
|
|
override |
◆ init()
◆ mouseExited()
void Button::mouseExited |
( |
gcn::MouseEvent & |
event | ) |
|
|
override |
◆ mouseMoved()
void Button::mouseMoved |
( |
gcn::MouseEvent & |
event | ) |
|
|
override |
◆ removeButtonIcon()
void Button::removeButtonIcon |
( |
| ) |
|
|
private |
◆ setButtonIcon()
bool Button::setButtonIcon |
( |
const std::string & |
iconFile | ) |
|
Set the icons available next to the text.
- Note
- : The image given must be formatted to give horizontally frames of the given width and height for the following states: Standard, Highlighted, Pressed, and Disabled. If the image is too short, the missing states won't be loaded.
Definition at line 66 of file button.cpp.
◆ setButtonPopupText()
void Button::setButtonPopupText |
( |
const std::string & |
text | ) |
|
|
inline |
Set the button popup text when hovering it for a few seconds.
- Note
- : An empty text will disable the popup.
Definition at line 78 of file button.h.
◆ setCaption()
void Button::setCaption |
( |
const std::string & |
caption | ) |
|
◆ mButtonIcon
std::vector<std::unique_ptr<Image> > Button::mButtonIcon |
|
private |
◆ mPopupText
std::string Button::mPopupText |
|
private |
the current button text
Definition at line 96 of file button.h.
◆ mTextPopup
The buttons popup.
- Note
- : This is a global object. One for all the buttons.
Definition at line 95 of file button.h.
The documentation for this class was generated from the following files: