From 26eeb40541659a42507fcb444904f15dc19d54db Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Wed, 23 May 2012 19:31:01 +0100 Subject: [PATCH] Extra callback for just mouse hover --- src/interface/Button.cpp | 5 ++++- src/interface/Button.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/interface/Button.cpp b/src/interface/Button.cpp index 32d8ef6ae..a7aa38722 100644 --- a/src/interface/Button.cpp +++ b/src/interface/Button.cpp @@ -136,7 +136,10 @@ void Button::OnMouseClick(int x, int y, unsigned int button) void Button::OnMouseEnter(int x, int y) { - isMouseInside = true; + if(!Enabled) + return; + if(actionCallback) + actionCallback->MouseEnterCallback(this); } void Button::OnMouseLeave(int x, int y) diff --git a/src/interface/Button.h b/src/interface/Button.h index 61430ad4d..19f7fe7e3 100644 --- a/src/interface/Button.h +++ b/src/interface/Button.h @@ -20,6 +20,7 @@ class ButtonAction { public: virtual void ActionCallback(ui::Button * sender) {} + virtual void MouseEnterCallback(ui::Button * sender) {} virtual ~ButtonAction() {} };