summaryrefslogtreecommitdiff
path: root/shared/mouse_move_dlg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'shared/mouse_move_dlg.cpp')
-rw-r--r--shared/mouse_move_dlg.cpp49
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))
bgstack15