summaryrefslogtreecommitdiff
path: root/src/gui/widgets/button.h
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-07-05 00:23:22 +0200
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-09-28 18:30:50 +0200
commitb3858a91e0f6b2c4706ea7b4418a26d4ef14baa7 (patch)
treea4840d65aba93f280db51415d155a4fb60f33eb9 /src/gui/widgets/button.h
parentd6449162225eeeed3f68fb443dcecfdaa235f3be (diff)
downloadmana-client-b3858a91e0f6b2c4706ea7b4418a26d4ef14baa7.tar.gz
mana-client-b3858a91e0f6b2c4706ea7b4418a26d4ef14baa7.tar.bz2
mana-client-b3858a91e0f6b2c4706ea7b4418a26d4ef14baa7.tar.xz
mana-client-b3858a91e0f6b2c4706ea7b4418a26d4ef14baa7.zip
Added textpopup on mouse hovering support to buttons.
I added a use of it to the menu buttons.
Diffstat (limited to 'src/gui/widgets/button.h')
-rw-r--r--src/gui/widgets/button.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gui/widgets/button.h b/src/gui/widgets/button.h
index 6d8f773c..cfc5043e 100644
--- a/src/gui/widgets/button.h
+++ b/src/gui/widgets/button.h
@@ -26,6 +26,7 @@
class ImageRect;
class Image;
+class TextPopup;
/**
* Button widget. Same as the Guichan button but with custom look.
@@ -74,6 +75,17 @@ class Button : public gcn::Button
void setButtonIcon(const std::string& iconFile = std::string(),
int frameHeight = 0, int frameWidth = 0);
+ /**
+ * Set the button popup text when hovering it for a few seconds.
+ *
+ * @note: An empty text will disable the popup.
+ */
+ void setButtonPopupText(const std::string& text = "");
+
+ void logic();
+ void mouseMoved(gcn::MouseEvent &event);
+ void mouseExited(gcn::MouseEvent &event);
+
private:
void init();
@@ -84,6 +96,9 @@ class Button : public gcn::Button
static float mAlpha;
Image** mButtonIcon; /**< Button Icons graphics */
+
+ static TextPopup* mTextPopup; /**< The buttons popup */
+ std::string mPopupText; /**< the current button text */
};
#endif