X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/865a74c70011e0e253fe3f966a0726d6ee302dd2..89fad939ec0d423961d8e93b2a0927f5b77bf256:/src/common/wincmn.cpp diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 7d16c18b26..2c79fc55e6 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -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 ) { @@ -2971,6 +2983,7 @@ wxAccStatus wxWindowAccessible::GetFocus(int* WXUNUSED(childId), wxAccessible** return wxACC_NOT_IMPLEMENTED; } +#if wxUSE_VARIANT // Gets a variant representing the selected children // of this object. // Acceptable values: @@ -2987,6 +3000,7 @@ wxAccStatus wxWindowAccessible::GetSelections(wxVariant* WXUNUSED(selections)) return wxACC_NOT_IMPLEMENTED; } +#endif // wxUSE_VARIANT #endif // wxUSE_ACCESSIBILITY