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:
@@ -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
@@ -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()
|
||||||
|
@@ -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;
|
||||||
@@ -1294,16 +1295,24 @@ static inline void SendSetRedraw(HWND hwnd, bool on)
|
|||||||
|
|
||||||
void wxWindowMSW::Freeze()
|
void wxWindowMSW::Freeze()
|
||||||
{
|
{
|
||||||
SendSetRedraw(GetHwnd(), false);
|
if ( !m_frozenness++ )
|
||||||
|
{
|
||||||
|
SendSetRedraw(GetHwnd(), false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowMSW::Thaw()
|
void wxWindowMSW::Thaw()
|
||||||
{
|
{
|
||||||
SendSetRedraw(GetHwnd(), true);
|
wxASSERT_MSG( m_frozenness > 0, _T("Thaw() without matching Freeze()") );
|
||||||
|
|
||||||
// we need to refresh everything or otherwise he invalidated area is not
|
if ( !--m_frozenness )
|
||||||
// repainted
|
{
|
||||||
Refresh();
|
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)
|
void wxWindowMSW::Refresh(bool eraseBack, const wxRect *rect)
|
||||||
|
Reference in New Issue
Block a user