[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-commits] Commit Complete



Commit by  : alex
Repository : xara
Revision   : 1397
Date       : Sun Jul  2 13:24:21 BST 2006

Changed paths:
   M /Trunk/XaraLX/wxXtra/cwfrompoint.cpp

Workaround for MDI child-windows


Diff:
Index: Trunk/XaraLX/wxXtra/cwfrompoint.cpp
===================================================================
--- Trunk/XaraLX/wxXtra/cwfrompoint.cpp	(revision 1396)
+++ Trunk/XaraLX/wxXtra/cwfrompoint.cpp	(revision 1397)
@@ -31,7 +31,22 @@
 
 wxWindow* wxChildWindowFromPoint(wxWindow* win, const wxPoint& pt, bool hidden /* =true */, int depth /* =1 */)
 {
-    if (!(hidden || win->IsShown()))
+    bool shown = win->IsShown();
+
+    if (win->IsKindOf(CLASSINFO(wxMDIChildFrame)))
+    {
+        wxWindow * pParent=win;
+        // Look for a wxMDIParentFrame
+        while ((pParent = /*assignment*/ pParent->GetParent()) && !(pParent->IsKindOf(CLASSINFO(wxMDIParentFrame)))) {}
+        if (pParent)
+        {
+            // If this isn't the active child, then treat it as if it was hidden.
+            if (((wxMDIParentFrame *)pParent)->GetActiveChild() != win)
+                shown=FALSE;
+        }
+    }
+
+    if (!(hidden || shown))
         return NULL;
 
     // Hack for wxNotebook case: at least in wxGTK, all pages


Xara