diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:08:42 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:08:42 +0200 |
commit | c32707148292d104c66276b43796d6057c8c7a5d (patch) | |
tree | bb83513f4aff24153e21a4ec92e34e4c27651b1f /ui/mouse_move_dlg.cpp | |
parent | 3.9 (diff) | |
download | FreeFileSync-c32707148292d104c66276b43796d6057c8c7a5d.tar.gz FreeFileSync-c32707148292d104c66276b43796d6057c8c7a5d.tar.bz2 FreeFileSync-c32707148292d104c66276b43796d6057c8c7a5d.zip |
3.10
Diffstat (limited to 'ui/mouse_move_dlg.cpp')
-rw-r--r-- | ui/mouse_move_dlg.cpp | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/ui/mouse_move_dlg.cpp b/ui/mouse_move_dlg.cpp index 526408d4..efaba5fc 100644 --- a/ui/mouse_move_dlg.cpp +++ b/ui/mouse_move_dlg.cpp @@ -10,17 +10,34 @@ using namespace ffs3; -void MouseMoveWindow::connectSourceWindow(wxWindow* sourceWindow) +MouseMoveWindow::MouseMoveWindow(wxWindow& parent, + wxWindow* child1, + wxWindow* child2, + wxWindow* child3, + wxWindow* child4, + wxWindow* child5, + wxWindow* child6) : wxWindow(&parent, wxID_ANY) { - sourceWindow->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(MouseMoveWindow::LeftButtonDown), NULL, this); + if (child1) child1->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(MouseMoveWindow::LeftButtonDown), NULL, this); + if (child2) child2->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(MouseMoveWindow::LeftButtonDown), NULL, this); + if (child3) child3->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(MouseMoveWindow::LeftButtonDown), NULL, this); + if (child4) child4->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(MouseMoveWindow::LeftButtonDown), NULL, this); + if (child5) child5->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(MouseMoveWindow::LeftButtonDown), NULL, this); + if (child6) child6->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(MouseMoveWindow::LeftButtonDown), NULL, this); + + Hide(); //this is just a dummy window so that its parent can have ownership + Disable(); } void MouseMoveWindow::LeftButtonDown(wxMouseEvent& event) { + if (!GetParent()) + return; + ::ReleaseCapture(); //::SendMessage(GetHwndOf(dialogToMove_), WM_NCLBUTTONDOWN, HTCAPTION, 0); - ::SendMessage(static_cast<HWND>(dialogToMove_->GetHWND()), WM_NCLBUTTONDOWN, HTCAPTION, 0); + ::SendMessage(static_cast<HWND>(GetParent()->GetHWND()), WM_NCLBUTTONDOWN, HTCAPTION, 0); //event.Skip(); -> swallow event, to avoid other windows losing focus } |