aboutsummaryrefslogtreecommitdiff
path: root/src/ui/window.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2018-11-24 00:41:38 +0800
committercrupest <crupest@outlook.com>2018-11-24 00:41:38 +0800
commitd4658bfd97e1770e7ab4de356b3fd8c0d1999493 (patch)
treeaa91d04d7abfe776625ed2980bcae82fbfd516d0 /src/ui/window.cpp
parente8589550140d20b675fa7736441d7cdd1daee4d7 (diff)
downloadcru-d4658bfd97e1770e7ab4de356b3fd8c0d1999493.tar.gz
cru-d4658bfd97e1770e7ab4de356b3fd8c0d1999493.tar.bz2
cru-d4658bfd97e1770e7ab4de356b3fd8c0d1999493.zip
Improve hit test for clip.
Diffstat (limited to 'src/ui/window.cpp')
-rw-r--r--src/ui/window.cpp23
1 files changed, 3 insertions, 20 deletions
diff --git a/src/ui/window.cpp b/src/ui/window.cpp
index 87656cdc..ceabddef 100644
--- a/src/ui/window.cpp
+++ b/src/ui/window.cpp
@@ -132,7 +132,8 @@ namespace cru::ui
return new Window(tag_popup_constructor{}, parent, caption);
}
- Window::Window(tag_overlapped_constructor) : Control(WindowConstructorTag{}, this), control_list_({ this }) {
+ Window::Window(tag_overlapped_constructor) : Control(WindowConstructorTag{}, this)
+ {
const auto window_manager = WindowManager::GetInstance();
hwnd_ = CreateWindowEx(0,
@@ -148,7 +149,7 @@ namespace cru::ui
AfterCreateHwnd(window_manager);
}
- Window::Window(tag_popup_constructor, Window* parent, const bool caption) : Control(WindowConstructorTag{}, this), control_list_({ this })
+ Window::Window(tag_popup_constructor, Window* parent, const bool caption) : Control(WindowConstructorTag{}, this)
{
if (parent != nullptr && !parent->IsWindowValid())
throw std::runtime_error("Parent window is not valid.");
@@ -506,24 +507,6 @@ namespace cru::ui
is_layout_invalid_ = false;
}
- void Window::RefreshControlList() {
- control_list_.clear();
- TraverseDescendants([this](Control* control) {
- this->control_list_.push_back(control);
- });
- }
-
- Control * Window::HitTest(const Point & point)
- {
- for (auto i = control_list_.crbegin(); i != control_list_.crend(); ++i) {
- auto control = *i;
- if (control->IsPointInside(control->WindowToControl(point))) {
- return control;
- }
- }
- return nullptr;
- }
-
bool Window::RequestFocusFor(Control * control)
{
if (control == nullptr)