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 OTHER CHANGES
============= =============
2.5.2
-----
wxMSW:
- wxWindow::Freeze()/Thaw() can now be nested
2.5.1 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() // list of disabled children before last call to our Disable()
wxWindowList *m_childrenDisabled; wxWindowList *m_childrenDisabled;
// number of calls to Freeze() minus number of calls to Thaw()
unsigned int m_frozenness;
DECLARE_DYNAMIC_CLASS(wxWindowMSW) DECLARE_DYNAMIC_CLASS(wxWindowMSW)
DECLARE_NO_COPY_CLASS(wxWindowMSW) DECLARE_NO_COPY_CLASS(wxWindowMSW)
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()

View File

@ -431,6 +431,7 @@ void wxWindowMSW::Init()
m_lastKeydownProcessed = false; m_lastKeydownProcessed = false;
m_childrenDisabled = NULL; m_childrenDisabled = NULL;
m_frozenness = 0;
// wxWnd // wxWnd
m_hMenu = 0; m_hMenu = 0;
@ -1293,11 +1294,18 @@ static inline void SendSetRedraw(HWND hwnd, bool on)
} }
void wxWindowMSW::Freeze() void wxWindowMSW::Freeze()
{
if ( !m_frozenness++ )
{ {
SendSetRedraw(GetHwnd(), false); SendSetRedraw(GetHwnd(), false);
} }
}
void wxWindowMSW::Thaw() void wxWindowMSW::Thaw()
{
wxASSERT_MSG( m_frozenness > 0, _T("Thaw() without matching Freeze()") );
if ( !--m_frozenness )
{ {
SendSetRedraw(GetHwnd(), true); SendSetRedraw(GetHwnd(), true);
@ -1305,6 +1313,7 @@ void wxWindowMSW::Thaw()
// repainted // repainted
Refresh(); Refresh();
} }
}
void wxWindowMSW::Refresh(bool eraseBack, const wxRect *rect) void wxWindowMSW::Refresh(bool eraseBack, const wxRect *rect)
{ {