]> git.saurik.com Git - wxWidgets.git/commitdiff
Speed up adding pages during freezing
authorJulian Smart <julian@anthemion.co.uk>
Tue, 8 Dec 2009 14:07:43 +0000 (14:07 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 8 Dec 2009 14:07:43 +0000 (14:07 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62815 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/aui/auibook.h
samples/aui/auidemo.cpp
src/aui/auibook.cpp

index fd4d0d055f79506b49fbb33d1defbc60ea4074f7..eaae78212f5217c02141cbb8a2b21bebe26b898a 100644 (file)
@@ -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; }
index 0dacca9fc062c9ffcc4dd5a37bf6e5eef6d92bcd..b6a1f6cae50af24103ae26cbc48c1f1e9bed6c7b 100644 (file)
@@ -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;
 }
 
index ca1cff4a3ae9bc10371f925cc1d305a45b291617..cc71a51e7b1be31d5e061a120afc9d3328b02ca1 100644 (file)
@@ -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