]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wincmn.cpp
added explanatory comment
[wxWidgets.git] / src / common / wincmn.cpp
index 51b6e771c3bd7365d7edf36c8e0d721c01a7d10e..13ccfb0e473255e084b9ab8a4b51c4e80a8d8a3c 100644 (file)
@@ -318,23 +318,9 @@ wxWindowBase::~wxWindowBase()
 
     wxASSERT_MSG( GetChildren().GetCount() == 0, wxT("children not destroyed") );
 
-    // reset the top-level parent's default item if it is this widget
+    // notify the parent about this window destruction
     if ( m_parent )
-    {
-        wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent((wxWindow*)this),
-                                              wxTopLevelWindow);
-
-        if ( tlw && tlw->GetDefaultItem() == this )
-            tlw->SetDefaultItem(NULL);
-        if ( tlw && tlw->GetTmpDefaultItem() == this )
-            tlw->SetTmpDefaultItem(NULL);
-    }
-
-    // reset the dangling pointer our parent window may keep to us
-    if ( m_parent )
-    {
         m_parent->RemoveChild(this);
-    }
 
 #if wxUSE_CARET
     delete m_caret;
@@ -497,18 +483,7 @@ wxSize wxWindowBase::DoGetBestSize() const
 
     if ( m_windowSizer )
     {
-        // Adjust to window size, since the return value of GetWindowSizeForVirtualSize is
-        // expressed in window and not client size
-        wxSize minSize = m_windowSizer->GetMinSize();
-        wxSize size(GetSize());
-        wxSize clientSize(GetClientSize());
-
-        wxSize minWindowSize(minSize.x + size.x - clientSize.x,
-                             minSize.y + size.y - clientSize.y);
-
-        best = GetWindowSizeForVirtualSize(minWindowSize);
-
-        return best;
+        best = m_windowSizer->GetMinSize();
     }
 #if wxUSE_CONSTRAINTS
     else if ( m_constraints )
@@ -2651,17 +2626,18 @@ bool wxWindowBase::TryParent(wxEvent& event)
 // keyboard navigation
 // ----------------------------------------------------------------------------
 
-// Navigates in the specified direction.
-bool wxWindowBase::Navigate(int flags)
+// Navigates in the specified direction inside this window
+bool wxWindowBase::DoNavigateIn(int flags)
 {
+#ifdef wxHAS_NATIVE_TAB_TRAVERSAL
+    // native code doesn't process our wxNavigationKeyEvents anyhow
+    return false;
+#else // !wxHAS_NATIVE_TAB_TRAVERSAL
     wxNavigationKeyEvent eventNav;
     eventNav.SetFlags(flags);
-    eventNav.SetEventObject(this);
-    if ( GetParent()->GetEventHandler()->ProcessEvent(eventNav) )
-    {
-        return true;
-    }
-    return false;
+    eventNav.SetEventObject(FindFocus());
+    return GetEventHandler()->ProcessEvent(eventNav);
+#endif // wxHAS_NATIVE_TAB_TRAVERSAL/!wxHAS_NATIVE_TAB_TRAVERSAL
 }
 
 void wxWindowBase::DoMoveInTabOrder(wxWindow *win, MoveKind move)