diff options
author | crupest <crupest@outlook.com> | 2019-05-23 23:07:27 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-05-23 23:07:27 +0800 |
commit | 9c2ece689c580f6857f50a81c09d423e6fed4a83 (patch) | |
tree | fb3e01fb00fbdbe76d052ee4e46392032848c884 /src/ui | |
parent | 691918e9e25b4f7e4731ff8d0e563c6316160254 (diff) | |
download | cru-9c2ece689c580f6857f50a81c09d423e6fed4a83.tar.gz cru-9c2ece689c580f6857f50a81c09d423e6fed4a83.tar.bz2 cru-9c2ece689c580f6857f50a81c09d423e6fed4a83.zip |
...
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/window.cpp | 50 |
1 files changed, 30 insertions, 20 deletions
diff --git a/src/ui/window.cpp b/src/ui/window.cpp index 347a7a49..291f6fb6 100644 --- a/src/ui/window.cpp +++ b/src/ui/window.cpp @@ -105,26 +105,36 @@ Window::Window(tag_overlapped_constructor) { platform::native::UiApplication::GetInstance()->CreateWindow(nullptr); render_object_.reset(new render::WindowRenderObject(this)); - event_revoker_guard_.Add(native_window_->DestroyEvent()->AddHandler( - std::bind(&Window::OnNativeDestroy, this))); - event_revoker_guard_.Add(native_window_->PaintEvent()->AddHandler( - std::bind(&Window::OnNativePaint, this))); - event_revoker_guard_.Add(native_window_->ResizeEvent()->AddHandler( - std::bind(&Window::OnNativeResize, this, _1))); - event_revoker_guard_.Add(native_window_->FocusEvent()->AddHandler( - std::bind(&Window::OnNativeFocus, this, _1))); - event_revoker_guard_.Add(native_window_->MouseEnterLeaveEvent()->AddHandler( - std::bind(&Window::OnNativeMouseEnterLeave, this, _1))); - event_revoker_guard_.Add(native_window_->MouseMoveEvent()->AddHandler( - std::bind(&Window::OnNativeMouseMove, this, _1))); - event_revoker_guard_.Add(native_window_->MouseDownEvent()->AddHandler( - std::bind(&Window::OnNativeMouseDown, this, _1, _2))); - event_revoker_guard_.Add(native_window_->MouseUpEvent()->AddHandler( - std::bind(&Window::OnNativeMouseUp, this, _1, _2))); - event_revoker_guard_.Add(native_window_->KeyDownEvent()->AddHandler( - std::bind(&Window::OnNativeKeyDown, this, _1))); - event_revoker_guard_.Add(native_window_->KeyUpEvent()->AddHandler( - std::bind(&Window::OnNativeKeyUp, this, _1))); + event_revoker_guards_.push_back( + EventRevokerGuard(native_window_->DestroyEvent()->AddHandler( + std::bind(&Window::OnNativeDestroy, this)))); + event_revoker_guards_.push_back( + EventRevokerGuard(native_window_->PaintEvent()->AddHandler( + std::bind(&Window::OnNativePaint, this)))); + event_revoker_guards_.push_back( + EventRevokerGuard(native_window_->ResizeEvent()->AddHandler( + std::bind(&Window::OnNativeResize, this, _1)))); + event_revoker_guards_.push_back( + EventRevokerGuard(native_window_->FocusEvent()->AddHandler( + std::bind(&Window::OnNativeFocus, this, _1)))); + event_revoker_guards_.push_back( + EventRevokerGuard(native_window_->MouseEnterLeaveEvent()->AddHandler( + std::bind(&Window::OnNativeMouseEnterLeave, this, _1)))); + event_revoker_guards_.push_back( + EventRevokerGuard(native_window_->MouseMoveEvent()->AddHandler( + std::bind(&Window::OnNativeMouseMove, this, _1)))); + event_revoker_guards_.push_back( + EventRevokerGuard(native_window_->MouseDownEvent()->AddHandler( + std::bind(&Window::OnNativeMouseDown, this, _1, _2)))); + event_revoker_guards_.push_back( + EventRevokerGuard(native_window_->MouseUpEvent()->AddHandler( + std::bind(&Window::OnNativeMouseUp, this, _1, _2)))); + event_revoker_guards_.push_back( + EventRevokerGuard(native_window_->KeyDownEvent()->AddHandler( + std::bind(&Window::OnNativeKeyDown, this, _1)))); + event_revoker_guards_.push_back( + EventRevokerGuard(native_window_->KeyUpEvent()->AddHandler( + std::bind(&Window::OnNativeKeyUp, this, _1)))); } Window::~Window() { |