changed defaultitem method from belonging to a panel to any window

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12872 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2001-12-04 20:08:29 +00:00
parent ea64fd024a
commit 9c641c057c
4 changed files with 452 additions and 470 deletions

View File

@@ -103,11 +103,11 @@ wxControl::~wxControl()
m_isBeingDeleted = TRUE;
// If we delete an item, we should initialize the parent panel,
// because it could now be invalid.
wxPanel *panel = wxDynamicCast(GetParent(), wxPanel);
if ( panel )
wxWindow *parent = GetParent() ;
if ( parent )
{
if (panel->GetDefaultItem() == (wxButton*) this)
panel->SetDefaultItem(NULL);
if (parent->GetDefaultItem() == (wxButton*) this)
parent->SetDefaultItem(NULL);
}
if ( m_macControl )
{