]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wincmn.cpp
Document that wxDCClipper currently resets clipping region.
[wxWidgets.git] / src / common / wincmn.cpp
index 614ee459932895ec0935982076f0e833cbdce811..17d8f40a31a5fe19a9094e66697a7ad5d6de9ec1 100644 (file)
@@ -75,7 +75,7 @@
 #include "wx/platinfo.h"
 #include "wx/private/window.h"
 
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
     #include "wx/msw/wrapwin.h"
 #endif
 
@@ -1242,9 +1242,28 @@ void wxWindowBase::Thaw()
 }
 
 // ----------------------------------------------------------------------------
-// reparenting the window
+// Dealing with parents and children.
 // ----------------------------------------------------------------------------
 
+bool wxWindowBase::IsDescendant(wxWindowBase* win) const
+{
+    // Iterate until we find this window in the parent chain or exhaust it.
+    while ( win )
+    {
+        wxWindow* const parent = win->GetParent();
+        if ( parent == this )
+            return true;
+
+        // Stop iterating on reaching the top level window boundary.
+        if ( parent->IsTopLevel() )
+            break;
+
+        win = parent;
+    }
+
+    return false;
+}
+
 void wxWindowBase::AddChild(wxWindowBase *child)
 {
     wxCHECK_RET( child, wxT("can't add a NULL child") );
@@ -1916,6 +1935,7 @@ wxWindowBase::FindWindowById( long id, const wxWindow* parent )
 // dialog oriented functions
 // ----------------------------------------------------------------------------
 
+#if WXWIN_COMPATIBILITY_2_8
 void wxWindowBase::MakeModal(bool modal)
 {
     // Disable all other windows
@@ -1932,6 +1952,7 @@ void wxWindowBase::MakeModal(bool modal)
         }
     }
 }
+#endif // WXWIN_COMPATIBILITY_2_8
 
 bool wxWindowBase::Validate()
 {
@@ -2607,17 +2628,12 @@ void wxWindowBase::GetPositionConstraint(int *x, int *y) const
 
 void wxWindowBase::AdjustForParentClientOrigin(int& x, int& y, int sizeFlags) const
 {
-    // don't do it for the dialogs/frames - they float independently of their
-    // parent
-    if ( !IsTopLevel() )
+    wxWindow *parent = GetParent();
+    if ( !(sizeFlags & wxSIZE_NO_ADJUSTMENTS) && parent )
     {
-        wxWindow *parent = GetParent();
-        if ( !(sizeFlags & wxSIZE_NO_ADJUSTMENTS) && parent )
-        {
-            wxPoint pt(parent->GetClientAreaOrigin());
-            x += pt.x;
-            y += pt.y;
-        }
+        wxPoint pt(parent->GetClientAreaOrigin());
+        x += pt.x;
+        y += pt.y;
     }
 }