diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:11:56 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:11:56 +0200 |
commit | 98ecf620f7de377dc8ae9ad7fbd1e3b24477e138 (patch) | |
tree | faadc6d8822c20cd3bc6f50b2a98e6c580585949 /shared/mouse_move_dlg.cpp | |
parent | 3.16 (diff) | |
download | FreeFileSync-98ecf620f7de377dc8ae9ad7fbd1e3b24477e138.tar.gz FreeFileSync-98ecf620f7de377dc8ae9ad7fbd1e3b24477e138.tar.bz2 FreeFileSync-98ecf620f7de377dc8ae9ad7fbd1e3b24477e138.zip |
3.17
Diffstat (limited to 'shared/mouse_move_dlg.cpp')
-rw-r--r-- | shared/mouse_move_dlg.cpp | 49 |
1 files changed, 31 insertions, 18 deletions
diff --git a/shared/mouse_move_dlg.cpp b/shared/mouse_move_dlg.cpp index abaa7ead..95074b55 100644 --- a/shared/mouse_move_dlg.cpp +++ b/shared/mouse_move_dlg.cpp @@ -7,26 +7,42 @@ #include "mouse_move_dlg.h" #include <vector> #include <wx/msw/wrapwin.h> //includes "windows.h" +#include <wx/stattext.h> +#include <wx/statbmp.h> +#include <wx/statline.h> +#include <wx/animate.h> +#include <wx/panel.h> +#include <wx/gauge.h> +#include <wx/statusbr.h> -using namespace ffs3; +using namespace zen; +namespace +{ +void getAllChildren(wxWindow& parent, std::vector<wxWindow*>& out) +{ + wxWindowList& wl = parent.GetChildren(); + for (wxWindowList::iterator i = wl.begin(); i != wl.end(); ++i) + { + if (dynamic_cast<wxStaticText*> (*i) || //redirect clicks on these "dead" controls to move dialog instead + dynamic_cast<wxStaticBitmap*> (*i) || + dynamic_cast<wxAnimationCtrl*>(*i) || + dynamic_cast<wxGauge*> (*i) || + dynamic_cast<wxStaticLine*> (*i) || + dynamic_cast<wxStatusBar*> (*i) || + dynamic_cast<wxPanel*> (*i)) + out.push_back(*i); + getAllChildren(**i, out); + } +} +} -MouseMoveWindow::MouseMoveWindow(wxWindow& parent, - wxWindow* child1, - wxWindow* child2, - wxWindow* child3, - wxWindow* child4, - wxWindow* child5, - wxWindow* child6) : wxWindow(&parent, wxID_ANY) +MouseMoveWindow::MouseMoveWindow(wxWindow& parent, bool includeParent) : 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); + if (includeParent) + windList.push_back(&parent); + getAllChildren(parent, windList); for (std::vector<wxWindow*>::const_iterator i = windList.begin(); i != windList.end(); ++i) (*i)->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(MouseMoveWindow::LeftButtonDown), NULL, this); @@ -36,9 +52,6 @@ MouseMoveWindow::MouseMoveWindow(wxWindow& parent, } -MouseMoveWindow::~MouseMoveWindow() {} - - void MouseMoveWindow::LeftButtonDown(wxMouseEvent& event) { if (GetParent() && allowMove(event)) |