Commit 008b0365 authored by Davis King's avatar Davis King

Changed some of the events that are about the mouse leaving

a widget so that they still trigger even if the widget has been disabled
or hidden.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402610
parent 1ef2ae75
...@@ -374,7 +374,7 @@ namespace dlib ...@@ -374,7 +374,7 @@ namespace dlib
on_mouse_leave ( on_mouse_leave (
) )
{ {
if (enabled && !hidden && is_mouse_over_) if (is_mouse_over_)
{ {
is_mouse_over_ = false; is_mouse_over_ = false;
on_mouse_not_over(); on_mouse_not_over();
...@@ -390,9 +390,6 @@ namespace dlib ...@@ -390,9 +390,6 @@ namespace dlib
long y long y
) )
{ {
if (enabled == false || hidden == true)
return;
if (rect.contains(x,y) == false) if (rect.contains(x,y) == false)
{ {
if (is_mouse_over_) if (is_mouse_over_)
...@@ -404,7 +401,8 @@ namespace dlib ...@@ -404,7 +401,8 @@ namespace dlib
else if (is_mouse_over_ == false) else if (is_mouse_over_ == false)
{ {
is_mouse_over_ = true; is_mouse_over_ = true;
on_mouse_over(); if (enabled && !hidden)
on_mouse_over();
} }
} }
...@@ -415,7 +413,7 @@ namespace dlib ...@@ -415,7 +413,7 @@ namespace dlib
) const ) const
{ {
// check if the mouse is still really over this button // check if the mouse is still really over this button
if (enabled && !hidden && is_mouse_over_ && rect.contains(lastx,lasty) == false) if (is_mouse_over_ && rect.contains(lastx,lasty) == false)
{ {
// trigger a user event to call on_mouse_not_over() and repaint this object. // trigger a user event to call on_mouse_not_over() and repaint this object.
// we must do this in another event because someone might call is_mouse_over() // we must do this in another event because someone might call is_mouse_over()
......
...@@ -228,8 +228,6 @@ namespace dlib ...@@ -228,8 +228,6 @@ namespace dlib
requires requires
- enable_events() has been called - enable_events() has been called
- mutex drawable::m is locked - mutex drawable::m is locked
- is_enabled() == true
- is_hidden() == false
- is called whenever this object transitions from the state where - is called whenever this object transitions from the state where
is_mouse_over() == true to is_mouse_over() == false is_mouse_over() == true to is_mouse_over() == false
ensures ensures
...@@ -332,8 +330,6 @@ namespace dlib ...@@ -332,8 +330,6 @@ namespace dlib
requires requires
- enable_events() has been called - enable_events() has been called
- mutex drawable::m is locked - mutex drawable::m is locked
- is_enabled() == true
- is_hidden() == false
- the area in parent_window() defined by get_rect() has been invalidated. - the area in parent_window() defined by get_rect() has been invalidated.
(This means you don't have to call invalidate_rectangle()) (This means you don't have to call invalidate_rectangle())
- is called whenever this object transitions from the state where - is called whenever this object transitions from the state where
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment