]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wincmn.cpp
Added wxDataViewBitmapCell
[wxWidgets.git] / src / common / wincmn.cpp
index ccd678019e12045f2b7096f44c157cda5ffd7102..2c79fc55e6d5799307f414956ac0e7f0c2066e8d 100644 (file)
@@ -292,6 +292,18 @@ wxWindowBase::~wxWindowBase()
 
     wxASSERT_MSG( GetChildren().GetCount() == 0, wxT("children not destroyed") );
 
+    // reset the top-level parent's default item if it is this widget
+    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 )
     {