wxWindow::Freeze()/Thaw() can now be nested

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26030 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2004-03-02 18:15:00 +00:00
parent c040ce40a2
commit a1037371af
4 changed files with 175 additions and 8 deletions

View File

@ -74,6 +74,13 @@ versions, please update your code to not use them.
OTHER CHANGES
=============
2.5.2
-----
wxMSW:
- wxWindow::Freeze()/Thaw() can now be nested
2.5.1
-----

File diff suppressed because it is too large Load Diff

View File

@ -463,6 +463,9 @@ private:
// list of disabled children before last call to our Disable()
wxWindowList *m_childrenDisabled;
// number of calls to Freeze() minus number of calls to Thaw()
unsigned int m_frozenness;
DECLARE_DYNAMIC_CLASS(wxWindowMSW)
DECLARE_NO_COPY_CLASS(wxWindowMSW)
DECLARE_EVENT_TABLE()

View File

@ -431,6 +431,7 @@ void wxWindowMSW::Init()
m_lastKeydownProcessed = false;
m_childrenDisabled = NULL;
m_frozenness = 0;
// wxWnd
m_hMenu = 0;
@ -1294,16 +1295,24 @@ static inline void SendSetRedraw(HWND hwnd, bool on)
void wxWindowMSW::Freeze()
{
if ( !m_frozenness++ )
{
SendSetRedraw(GetHwnd(), false);
}
}
void wxWindowMSW::Thaw()
{
wxASSERT_MSG( m_frozenness > 0, _T("Thaw() without matching Freeze()") );
if ( !--m_frozenness )
{
SendSetRedraw(GetHwnd(), true);
// we need to refresh everything or otherwise he invalidated area is not
// repainted
Refresh();
}
}
void wxWindowMSW::Refresh(bool eraseBack, const wxRect *rect)