aboutsummaryrefslogtreecommitdiff
path: root/CruUI/ui/window.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2018-09-13 22:47:22 +0800
committercrupest <crupest@outlook.com>2018-09-13 22:47:22 +0800
commit9f6803884704e277fe49ed046344ddaa44a7fd19 (patch)
tree4b7f2c2e6db2f71e44633c3b10128243be95d2a0 /CruUI/ui/window.cpp
parent5f35ba198582bb93e16d34c8d94ffdc8f453068d (diff)
downloadcru-9f6803884704e277fe49ed046344ddaa44a7fd19.tar.gz
cru-9f6803884704e277fe49ed046344ddaa44a7fd19.tar.bz2
cru-9f6803884704e277fe49ed046344ddaa44a7fd19.zip
...
Diffstat (limited to 'CruUI/ui/window.cpp')
-rw-r--r--CruUI/ui/window.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/CruUI/ui/window.cpp b/CruUI/ui/window.cpp
index 8430d09b..fe37fc46 100644
--- a/CruUI/ui/window.cpp
+++ b/CruUI/ui/window.cpp
@@ -337,6 +337,13 @@ namespace cru
OnResizeInternal(LOWORD(l_param), HIWORD(l_param));
result = 0;
return true;
+ case WM_ACTIVATE:
+ if (w_param == WA_ACTIVE || w_param == WA_CLICKACTIVE)
+ OnActivatedInternal();
+ else if (w_param == WA_INACTIVE)
+ OnDeactivatedInternal();
+ result = 0;
+ return true;
case WM_DESTROY:
OnDestroyInternal();
result = 0;
@@ -577,6 +584,18 @@ namespace cru
DispatchEvent(control, &Control::OnMouseUpCore, nullptr, dip_point, button);
}
+ void Window::OnActivatedInternal()
+ {
+ events::UiEventArgs args(this, this);
+ activated_event.Raise(args);
+ }
+
+ void Window::OnDeactivatedInternal()
+ {
+ events::UiEventArgs args(this, this);
+ deactivated_event.Raise(args);
+ }
+
void Window::DispatchMouseHoverControlChangeEvent(Control* old_control, Control* new_control, const Point& point)
{
if (new_control != old_control) //if the mouse-hover-on control changed