X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ca67f0d85925332847b79a8215514fd2d4034f3c..d9106ec5b679d5c9a5eb61b9633e5f3b1437b6a8:/src/common/toplvcmn.cpp diff --git a/src/common/toplvcmn.cpp b/src/common/toplvcmn.cpp index ceee633abf..b5d3e5e39d 100644 --- a/src/common/toplvcmn.cpp +++ b/src/common/toplvcmn.cpp @@ -3,7 +3,6 @@ // Purpose: common (for all platforms) wxTopLevelWindow functions // Author: Julian Smart, Vadim Zeitlin // Created: 01/02/97 -// Id: $Id$ // Copyright: (c) 1998 Robert Roebling and Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -39,11 +38,8 @@ BEGIN_EVENT_TABLE(wxTopLevelWindowBase, wxWindow) EVT_CLOSE(wxTopLevelWindowBase::OnCloseWindow) EVT_SIZE(wxTopLevelWindowBase::OnSize) - WX_EVENT_TABLE_CONTROL_CONTAINER(wxTopLevelWindowBase) END_EVENT_TABLE() -WX_DELEGATE_TO_CONTROL_CONTAINER(wxTopLevelWindowBase, wxWindow) - // ============================================================================ // implementation // ============================================================================ @@ -58,8 +54,6 @@ wxTopLevelWindowBase::wxTopLevelWindowBase() { // Unlike windows, top level windows are created hidden by default. m_isShown = false; - - WX_INIT_CONTROL_CONTAINER(); } wxTopLevelWindowBase::~wxTopLevelWindowBase() @@ -352,7 +346,7 @@ void wxTopLevelWindowBase::SetIcon(const wxIcon& icon) // passing wxNullIcon to SetIcon() is possible (it means that we shouldn't // have any icon), but adding an invalid icon to wxIconBundle is not wxIconBundle icons; - if ( icon.Ok() ) + if ( icon.IsOk() ) icons.AddIcon(icon); SetIcons(icons); @@ -366,6 +360,14 @@ void wxTopLevelWindowBase::SetIcon(const wxIcon& icon) // whole client area void wxTopLevelWindowBase::DoLayout() { + // We are called during the window destruction several times, e.g. as + // wxFrame tries to adjust to its tool/status bars disappearing. But + // actually doing the layout is pretty useless in this case as the window + // will disappear anyhow -- so just don't bother. + if ( IsBeingDeleted() ) + return; + + // if we're using constraints or sizers - do use them if ( GetAutoLayout() ) {