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

[XaraXtreme-commits] Commit Complete



Commit by  : alex
Repository : xara
Revision   : 819
Date       : Sun Apr 16 19:15:09 BST 2006

Changed paths:
   M /Trunk/XaraLX/wxXtra/Makefile.am
   A /Trunk/XaraLX/wxXtra/cwfrompoint.cpp
   A /Trunk/XaraLX/wxXtra/cwfrompoint.h

Added wxChildWindowFromPoint


Diff:
Index: Trunk/XaraLX/wxXtra/cwfrompoint.cpp
===================================================================
--- Trunk/XaraLX/wxXtra/cwfrompoint.cpp	(revision 0)
+++ Trunk/XaraLX/wxXtra/cwfrompoint.cpp	(revision 819)
@@ -0,0 +1,60 @@
+// $Id$
+/* @@tag:xara-cn-tp@@ THIRD PARTY COPYRIGHT */
+// The following line makes normalize.pl skip type fixing
+/* SKIPFIXTYPES: START */
+
+// This file is derived from CVSHEAD wxWidgets and is thus
+// under the wxWidgets / wxWindows license.
+
+#include "cwfrompoint.h"
+
+// This is an exact duplication of wxFindWindowAtPoint
+// (the unexported variant thereof)
+
+wxWindow* wxChildWindowFromPoint(wxWindow* win, const wxPoint& pt)
+{
+    if (!win->IsShown())
+        return NULL;
+
+    // Hack for wxNotebook case: at least in wxGTK, all pages
+    // claim to be shown, so we must only deal with the selected one.
+#if wxUSE_NOTEBOOK
+    if (win->IsKindOf(CLASSINFO(wxNotebook)))
+    {
+      wxNotebook* nb = (wxNotebook*) win;
+      int sel = nb->GetSelection();
+      if (sel >= 0)
+      {
+        wxWindow* child = nb->GetPage(sel);
+        wxWindow* foundWin = wxChildWindowFromPoint(child, pt);
+        if (foundWin)
+           return foundWin;
+      }
+    }
+#endif
+
+    wxWindowList::compatibility_iterator node = win->GetChildren().GetLast();
+    while (node)
+    {
+        wxWindow* child = node->GetData();
+        wxWindow* foundWin = wxChildWindowFromPoint(child, pt);
+        if (foundWin)
+          return foundWin;
+        node = node->GetPrevious();
+    }
+
+    wxPoint pos = win->GetPosition();
+    wxSize sz = win->GetSize();
+    if (win->GetParent())
+    {
+        pos = win->GetParent()->ClientToScreen(pos);
+    }
+
+    wxRect rect(pos, sz);
+    if (rect.Inside(pt))
+        return win;
+    else
+        return NULL;
+}
+
+

Property changes on: Trunk/XaraLX/wxXtra/cwfrompoint.cpp
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Index: Trunk/XaraLX/wxXtra/Makefile.am
===================================================================
--- Trunk/XaraLX/wxXtra/Makefile.am	(revision 818)
+++ Trunk/XaraLX/wxXtra/Makefile.am	(revision 819)
@@ -6,7 +6,7 @@
 noinst_LIBRARIES	= libwxXtra.a
 
 # the application source, library search path, and link libraries
-libwxXtra_a_SOURCES = manager.cpp wxmousestate.cpp doublebuffer.cpp
+libwxXtra_a_SOURCES = manager.cpp wxmousestate.cpp doublebuffer.cpp cwfrompoint.cpp
 
 # make sure this does NOT have our include files in the path
 # Don't use GTK includes for now - y ou will need this with sub-2.6.3 but that's not supported
Index: Trunk/XaraLX/wxXtra/cwfrompoint.h
===================================================================
--- Trunk/XaraLX/wxXtra/cwfrompoint.h	(revision 0)
+++ Trunk/XaraLX/wxXtra/cwfrompoint.h	(revision 819)
@@ -0,0 +1,16 @@
+// $Id$
+/* @@tag:xara-cn-tp@@ THIRD PARTY COPYRIGHT */
+// The following line makes normalize.pl skip type fixing
+/* SKIPFIXTYPES: START */
+
+// This file is derived from CVSHEAD wxWidgets and is thus
+// under the wxWidgets / wxWindows license.
+
+#ifndef __WXXTRA_CWFROMPOINT_H
+#define __WXXTRA_CWFROMPOINT_H
+
+#include <wx/wx.h>
+
+extern wxWindow* wxChildWindowFromPoint(wxWindow* win, const wxPoint& pt);
+
+#endif // __WXXTRA_DOUBLEBUFFER_H

Property changes on: Trunk/XaraLX/wxXtra/cwfrompoint.h
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF


Xara