summaryrefslogtreecommitdiff
path: root/shared/mouse_move_dlg.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:10:11 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:10:11 +0200
commitc0cdb2ad99a1e2a6ade5ce76c91177a79258e669 (patch)
tree4701a015385d9a6a5a4ba99a8f1f5d400fff26b1 /shared/mouse_move_dlg.cpp
parent3.13 (diff)
downloadFreeFileSync-c0cdb2ad99a1e2a6ade5ce76c91177a79258e669.tar.gz
FreeFileSync-c0cdb2ad99a1e2a6ade5ce76c91177a79258e669.tar.bz2
FreeFileSync-c0cdb2ad99a1e2a6ade5ce76c91177a79258e669.zip
3.14
Diffstat (limited to 'shared/mouse_move_dlg.cpp')
-rw-r--r--shared/mouse_move_dlg.cpp54
1 files changed, 54 insertions, 0 deletions
diff --git a/shared/mouse_move_dlg.cpp b/shared/mouse_move_dlg.cpp
new file mode 100644
index 00000000..abaa7ead
--- /dev/null
+++ b/shared/mouse_move_dlg.cpp
@@ -0,0 +1,54 @@
+// **************************************************************************
+// * 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-2011 ZenJu (zhnmju123 AT gmx.de) *
+// **************************************************************************
+//
+#include "mouse_move_dlg.h"
+#include <vector>
+#include <wx/msw/wrapwin.h> //includes "windows.h"
+
+using namespace ffs3;
+
+
+MouseMoveWindow::MouseMoveWindow(wxWindow& parent,
+ wxWindow* child1,
+ wxWindow* child2,
+ wxWindow* child3,
+ wxWindow* child4,
+ wxWindow* child5,
+ wxWindow* child6) : wxWindow(&parent, wxID_ANY)
+{
+ 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() && allowMove(event))
+ {
+ ::ReleaseCapture();
+ //::SendMessage(GetHwndOf(dialogToMove_), WM_NCLBUTTONDOWN, HTCAPTION, 0);
+ ::SendMessage(static_cast<HWND>(GetParent()->GetHWND()), WM_NCLBUTTONDOWN, HTCAPTION, 0);
+
+ return;
+ //event.Skip(); -> swallow event, to avoid other windows losing focus
+ }
+ event.Skip();
+}
bgstack15