From: Julian Smart Date: Tue, 8 Dec 2009 14:07:43 +0000 (+0000) Subject: Speed up adding pages during freezing X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/64178c36026e5e31c25cf0c23384249bbc7e7439 Speed up adding pages during freezing git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62815 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/aui/auibook.h b/include/wx/aui/auibook.h index fd4d0d055f..eaae78212f 100644 --- a/include/wx/aui/auibook.h +++ b/include/wx/aui/auibook.h @@ -582,6 +582,9 @@ public: // we don't want focus for ourselves // virtual bool AcceptsFocus() const { return false; } + // Redo sizing after thawing + virtual void Thaw(); + protected: // choose the default border for this window virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; } diff --git a/samples/aui/auidemo.cpp b/samples/aui/auidemo.cpp index 0dacca9fc0..b6a1f6cae5 100644 --- a/samples/aui/auidemo.cpp +++ b/samples/aui/auidemo.cpp @@ -1574,6 +1574,7 @@ wxAuiNotebook* MyFrame::CreateNotebook() wxPoint(client_size.x, client_size.y), wxSize(430,200), m_notebook_style); + ctrl->Freeze(); wxBitmap page_bmp = wxArtProvider::GetBitmap(wxART_NORMAL_FILE, wxART_OTHER, wxSize(16,16)); @@ -1620,6 +1621,7 @@ wxAuiNotebook* MyFrame::CreateNotebook() ctrl->AddPage( new wxTextCtrl( ctrl, wxID_ANY, wxT("Some more text"), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxNO_BORDER) , wxT("wxTextCtrl 8") ); + ctrl->Thaw(); return ctrl; } diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index ca1cff4a3a..cc71a51e7b 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -2693,6 +2693,9 @@ public: if (!m_tabs) return; + if (m_tabs->IsFrozen() || m_tabs->GetParent()->IsFrozen()) + return; + m_tab_rect = wxRect(m_rect.x, m_rect.y, m_rect.width, m_tab_ctrl_height); if (m_tabs->GetFlags() & wxAUI_NB_BOTTOM) { @@ -4482,4 +4485,11 @@ bool wxAuiNotebook::ShowWindowMenu() return false; } +void wxAuiNotebook::Thaw() +{ + DoSizing(); + + wxControl::Thaw(); +} + #endif // wxUSE_AUI