aboutsummaryrefslogtreecommitdiff
path: root/CruUI/ui/window.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2018-09-10 00:09:52 +0800
committercrupest <crupest@outlook.com>2018-09-10 00:09:52 +0800
commitaa8ba64f4f580552ba14325dd3e04f38a3c9a1de (patch)
treecde762da1a0bfb24c28a8a3dfa5253ad95a5b809 /CruUI/ui/window.cpp
parent74031db4b8c366531db5be8fa8d765483ab377b0 (diff)
downloadcru-aa8ba64f4f580552ba14325dd3e04f38a3c9a1de.tar.gz
cru-aa8ba64f4f580552ba14325dd3e04f38a3c9a1de.tar.bz2
cru-aa8ba64f4f580552ba14325dd3e04f38a3c9a1de.zip
...
Diffstat (limited to 'CruUI/ui/window.cpp')
-rw-r--r--CruUI/ui/window.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/CruUI/ui/window.cpp b/CruUI/ui/window.cpp
index 2c731a1e..392bca87 100644
--- a/CruUI/ui/window.cpp
+++ b/CruUI/ui/window.cpp
@@ -97,9 +97,9 @@ namespace cru
RefreshInvalidControlPositionCache(); // first refresh position cache.
for (const auto i : cache_invalid_controls_) // traverse all descendants of position-invalid controls and notify position change event
i->TraverseDescendants([](Control* control)
- {
- control->CheckAndNotifyPositionChanged();
- });
+ {
+ control->CheckAndNotifyPositionChanged();
+ });
cache_invalid_controls_.clear(); // after update and notify, clear the set.
});
}
@@ -401,6 +401,12 @@ namespace cru
return rect;
}
+ bool Window::IsMessageInQueue(UINT message)
+ {
+ MSG msg;
+ return ::PeekMessageW(&msg, hwnd_, message, message, PM_NOREMOVE) != 0;
+ }
+
void Window::OnDestroyInternal() {
Application::GetInstance()->GetWindowManager()->UnregisterWindow(hwnd_);
hwnd_ = nullptr;