diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-03-04 16:32:40 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-03-04 16:33:19 +0300 |
commit | 8fd450f698f8277eb8348da914d3dcbc11890ea6 (patch) | |
tree | ebaddac087d5e5b29f23a2aa01dd2758c3b8f68a /src/gui/widgets/button.h | |
parent | c6d7f7ed3d6d7827b820670faf6c48f0689fd5c2 (diff) | |
parent | f74202392745923f9ce372a6bdcd0a45db6bcd08 (diff) | |
download | mv-8fd450f698f8277eb8348da914d3dcbc11890ea6.tar.gz mv-8fd450f698f8277eb8348da914d3dcbc11890ea6.tar.bz2 mv-8fd450f698f8277eb8348da914d3dcbc11890ea6.tar.xz mv-8fd450f698f8277eb8348da914d3dcbc11890ea6.zip |
Merge branch 'master' into stripped
Conflicts:
configure.ac
data/Makefile.am
data/fonts/liberationsans-bold.ttf
data/fonts/liberationsans.ttf
data/fonts/liberationsansmono-bold.ttf
data/fonts/liberationsansmono.ttf
data/themes/redandblack/CMakeLists.txt
data/themes/redandblack/Makefile.am
po/cs.po
po/de.po
po/es.po
po/fi.po
po/fr.po
po/id.po
po/ja.po
po/manaplus.pot
po/nl_BE.po
po/pl.po
po/pt.po
po/pt_BR.po
po/ru.po
po/zh_CN.po
src/guichan/color.cpp
src/guichan/defaultfont.cpp
src/guichan/focushandler.cpp
src/guichan/include/guichan/actionlistener.hpp
src/guichan/include/guichan/deathlistener.hpp
src/guichan/include/guichan/focushandler.hpp
src/guichan/include/guichan/focuslistener.hpp
src/guichan/include/guichan/graphics.hpp
src/guichan/include/guichan/keylistener.hpp
src/guichan/include/guichan/listmodel.hpp
src/guichan/include/guichan/mouselistener.hpp
src/guichan/include/guichan/sdl/sdlpixel.hpp
src/guichan/include/guichan/widget.hpp
src/guichan/include/guichan/widgetlistener.hpp
src/guichan/include/guichan/widgets/listbox.hpp
src/guichan/include/guichan/widgets/slider.hpp
src/guichan/sdl/sdlgraphics.cpp
src/guichan/sdl/sdlimage.cpp
src/guichan/widgets/scrollarea.cpp
src/guichan/widgets/slider.cpp
src/guichan/widgets/tabbedarea.cpp
src/guichan/widgets/textbox.cpp
src/guichan/widgets/window.cpp
src/net/manaserv/attributes.cpp
src/net/manaserv/beinghandler.cpp
src/net/manaserv/charhandler.cpp
src/net/manaserv/gamehandler.h
src/net/manaserv/inventoryhandler.cpp
src/net/manaserv/inventoryhandler.h
src/net/manaserv/itemhandler.cpp
src/net/manaserv/loginhandler.cpp
src/net/manaserv/network.cpp
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 |