diff options
Diffstat (limited to 'src/gui/widgets/button.h')
-rw-r--r-- | src/gui/widgets/button.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/gui/widgets/button.h b/src/gui/widgets/button.h index 560e46377..6585d9850 100644 --- a/src/gui/widgets/button.h +++ b/src/gui/widgets/button.h @@ -28,8 +28,12 @@ #include <guichan/widgetlistener.hpp> class GraphicsVertexes; +class Image; +class ImageSet; class ImageRect; +const std::string BUTTON_PLAY = "buttonplay.png"; + /** * Button widget. Same as the Guichan button but with custom look. * @@ -51,6 +55,23 @@ class Button : public gcn::Button, public gcn::WidgetListener gcn::ActionListener *listener); /** + * Constructor, sets the caption of the button to the given string and + * adds the given action listener. + */ + Button(const std::string &caption, const std::string &imageName, + int imageWidth, int imageHeight, + 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(const std::string &imageName, int imageWidth, int imageHeight, + const std::string &actionEventId, + gcn::ActionListener *listener); + + /** * Destructor. */ ~Button(); @@ -86,6 +107,12 @@ class Button : public gcn::Button, public gcn::WidgetListener void widgetMoved(const gcn::Event &event); + void loadImage(const std::string &imageName); + + void adjustSize(); + + void setCaption(const std::string& caption); + private: void init(); @@ -103,6 +130,10 @@ class Button : public gcn::Button, public gcn::WidgetListener int mYOffset; gcn::Color mEnabledColor; gcn::Color mDisabledColor; + Image **mImages; + ImageSet *mImageSet; + int mImageWidth; + int mImageHeight; }; #endif |