diff options
author | Reid <reidyaro@gmail.com> | 2012-03-01 22:03:01 +0100 |
---|---|---|
committer | Reid <reidyaro@gmail.com> | 2012-03-01 22:03:01 +0100 |
commit | 490862919d79369112c75955a9c36ff8a081efd3 (patch) | |
tree | 6fe89466b9c53ba811f298174e6d787bbae71e09 /src/gui/widgets/button.h | |
parent | dff814619d63496acd3c4e8730b828b5d4d931fb (diff) | |
parent | d873da3e8e57480016596f714845c1bc7e712e68 (diff) | |
download | mv-490862919d79369112c75955a9c36ff8a081efd3.tar.gz mv-490862919d79369112c75955a9c36ff8a081efd3.tar.bz2 mv-490862919d79369112c75955a9c36ff8a081efd3.tar.xz mv-490862919d79369112c75955a9c36ff8a081efd3.zip |
Merge branch 'master' of gitorious.org:manaplus/manaplus
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 |