From bd6336c629841c6db3a6ca53a936d629d34db53b Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 18 Apr 2014 17:15:16 +0200 Subject: 4.1 --- shared/mouse_move_dlg.cpp | 67 ----------------------------------------------- 1 file changed, 67 deletions(-) delete mode 100644 shared/mouse_move_dlg.cpp (limited to 'shared/mouse_move_dlg.cpp') diff --git a/shared/mouse_move_dlg.cpp b/shared/mouse_move_dlg.cpp deleted file mode 100644 index 7981df49..00000000 --- a/shared/mouse_move_dlg.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// ************************************************************************** -// * 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 -#include //includes "windows.h" -#include -#include -#include -#include -#include -#include -#include - -using namespace zen; - -namespace -{ -void getAllChildren(wxWindow& parent, std::vector& out) -{ - wxWindowList& wl = parent.GetChildren(); - for (wxWindowList::iterator i = wl.begin(); i != wl.end(); ++i) - { - if (dynamic_cast (*i) || //redirect clicks on these "dead" controls to move dialog instead - dynamic_cast (*i) || - dynamic_cast(*i) || - dynamic_cast (*i) || - dynamic_cast (*i) || - dynamic_cast (*i) || - dynamic_cast (*i)) - out.push_back(*i); - getAllChildren(**i, out); - } -} -} - -MouseMoveWindow::MouseMoveWindow(wxWindow& parent, bool includeParent) : wxWindow(&parent, wxID_ANY) -{ - std::vector windList; - if (includeParent) - windList.push_back(&parent); - getAllChildren(parent, windList); - - for (std::vector::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(); -} - - -void MouseMoveWindow::LeftButtonDown(wxMouseEvent& event) -{ - if (GetParent() && allowMove(event)) - { - ::ReleaseCapture(); - //::SendMessage(GetHwndOf(dialogToMove_), WM_NCLBUTTONDOWN, HTCAPTION, 0); - ::SendMessage(static_cast(GetParent()->GetHWND()), WM_NCLBUTTONDOWN, HTCAPTION, 0); - - return; - //event.Skip(); -> swallow event, to avoid other windows losing focus - } - event.Skip(); -} -- cgit