summaryrefslogtreecommitdiff
path: root/src/interface/Button.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-07-18 19:34:58 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-07-18 19:34:58 (GMT)
commitdd0e6e7f4ddc5a1a9c25111275187b767d51bdb4 (patch)
tree79213c37eab4ad4715a00d53029fd6d6c865bc73 /src/interface/Button.cpp
parent26dbd547d3a3662c62e7b3ecadae5609f1726df4 (diff)
downloadpowder-dd0e6e7f4ddc5a1a9c25111275187b767d51bdb4.zip
powder-dd0e6e7f4ddc5a1a9c25111275187b767d51bdb4.tar.gz
Add descriptions to toolbuttons, add Tooltips to Button, ToolTip event for Windows
Diffstat (limited to 'src/interface/Button.cpp')
-rw-r--r--src/interface/Button.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/interface/Button.cpp b/src/interface/Button.cpp
index ac1f87e..b70d41e 100644
--- a/src/interface/Button.cpp
+++ b/src/interface/Button.cpp
@@ -13,7 +13,7 @@
namespace ui {
-Button::Button(Point position, Point size, std::string buttonText):
+Button::Button(Point position, Point size, std::string buttonText, std::string toolTip):
Component(position, size),
ButtonText(buttonText),
isMouseInside(false),
@@ -21,7 +21,8 @@ Button::Button(Point position, Point size, std::string buttonText):
isTogglable(false),
toggle(false),
actionCallback(NULL),
- Enabled(true)
+ Enabled(true),
+ toolTip(toolTip)
{
TextPosition();
}
@@ -141,6 +142,10 @@ void Button::OnMouseEnter(int x, int y)
return;
if(actionCallback)
actionCallback->MouseEnterCallback(this);
+ if(toolTip.length()>0 && GetParentWindow())
+ {
+ GetParentWindow()->ToolTip(this, ui::Point(x, y), toolTip);
+ }
}