diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:09:45 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:09:45 +0200 |
commit | 88c8801298cbf6fec9cdce254c7b3cb9e066a421 (patch) | |
tree | 35a35acf48eb227bac30abc8f87ea9b1c3c57b68 /ui/mouse_move_dlg.cpp | |
parent | 3.12 (diff) | |
download | FreeFileSync-88c8801298cbf6fec9cdce254c7b3cb9e066a421.tar.gz FreeFileSync-88c8801298cbf6fec9cdce254c7b3cb9e066a421.tar.bz2 FreeFileSync-88c8801298cbf6fec9cdce254c7b3cb9e066a421.zip |
3.13
Diffstat (limited to 'ui/mouse_move_dlg.cpp')
-rw-r--r-- | ui/mouse_move_dlg.cpp | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/ui/mouse_move_dlg.cpp b/ui/mouse_move_dlg.cpp index efaba5fc..abaa7ead 100644 --- a/ui/mouse_move_dlg.cpp +++ b/ui/mouse_move_dlg.cpp @@ -1,10 +1,11 @@ // ************************************************************************** // * This file is part of the FreeFileSync project. It is distributed under * // * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #include "mouse_move_dlg.h" +#include <vector> #include <wx/msw/wrapwin.h> //includes "windows.h" using namespace ffs3; @@ -18,26 +19,36 @@ MouseMoveWindow::MouseMoveWindow(wxWindow& parent, wxWindow* child5, wxWindow* child6) : wxWindow(&parent, wxID_ANY) { - 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); + std::vector<wxWindow*> windList; + + if (child1) windList.push_back(child1); + if (child2) windList.push_back(child2); + if (child3) windList.push_back(child3); + if (child4) windList.push_back(child4); + if (child5) windList.push_back(child5); + if (child6) windList.push_back(child6); + + for (std::vector<wxWindow*>::const_iterator i = windList.begin(); i != windList.end(); ++i) + (*i)->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(MouseMoveWindow::LeftButtonDown), NULL, this); Hide(); //this is just a dummy window so that its parent can have ownership Disable(); } +MouseMoveWindow::~MouseMoveWindow() {} + + void MouseMoveWindow::LeftButtonDown(wxMouseEvent& event) { - if (!GetParent()) - return; - - ::ReleaseCapture(); - //::SendMessage(GetHwndOf(dialogToMove_), WM_NCLBUTTONDOWN, HTCAPTION, 0); - ::SendMessage(static_cast<HWND>(GetParent()->GetHWND()), WM_NCLBUTTONDOWN, HTCAPTION, 0); + if (GetParent() && allowMove(event)) + { + ::ReleaseCapture(); + //::SendMessage(GetHwndOf(dialogToMove_), WM_NCLBUTTONDOWN, HTCAPTION, 0); + ::SendMessage(static_cast<HWND>(GetParent()->GetHWND()), WM_NCLBUTTONDOWN, HTCAPTION, 0); - //event.Skip(); -> swallow event, to avoid other windows losing focus + return; + //event.Skip(); -> swallow event, to avoid other windows losing focus + } + event.Skip(); } |