diff --git a/include/wx/utils.h b/include/wx/utils.h index 3f4aea8daf..ea3042e38b 100644 --- a/include/wx/utils.h +++ b/include/wx/utils.h @@ -25,6 +25,7 @@ #if wxUSE_GUI #include "wx/gdicmn.h" #include "wx/mousestate.h" + #include "wx/vector.h" #endif class WXDLLIMPEXP_FWD_BASE wxArrayString; @@ -51,7 +52,6 @@ class WXDLLIMPEXP_FWD_BASE wxArrayInt; class WXDLLIMPEXP_FWD_BASE wxProcess; class WXDLLIMPEXP_FWD_CORE wxFrame; class WXDLLIMPEXP_FWD_CORE wxWindow; -class wxWindowList; class WXDLLIMPEXP_FWD_CORE wxEventLoop; // ---------------------------------------------------------------------------- @@ -733,7 +733,7 @@ private: #if defined(__WXOSX__) && wxOSX_USE_COCOA wxEventLoop* m_modalEventLoop; #endif - wxWindowList *m_winDisabled; + wxVector m_winDisabled; bool m_disabled; wxDECLARE_NO_COPY_CLASS(wxWindowDisabler); diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index 9fbed34457..2963212555 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -1530,8 +1530,6 @@ void wxWindowDisabler::DoDisable(wxWindow *winToSkip) { // remember the top level windows which were already disabled, so that we // don't reenable them later - m_winDisabled = NULL; - wxWindowList::compatibility_iterator node; for ( node = wxTopLevelWindows.GetFirst(); node; node = node->GetNext() ) { @@ -1546,12 +1544,7 @@ void wxWindowDisabler::DoDisable(wxWindow *winToSkip) } else { - if ( !m_winDisabled ) - { - m_winDisabled = new wxWindowList; - } - - m_winDisabled->Append(winTop); + m_winDisabled.push_back(winTop); } } } @@ -1565,14 +1558,12 @@ wxWindowDisabler::~wxWindowDisabler() for ( node = wxTopLevelWindows.GetFirst(); node; node = node->GetNext() ) { wxWindow *winTop = node->GetData(); - if ( !m_winDisabled || !m_winDisabled->Find(winTop) ) + if ( !wxVectorContains(m_winDisabled, winTop) ) { winTop->Enable(); } //else: had been already disabled, don't reenable } - - delete m_winDisabled; } #endif