]> git.saurik.com Git - wxWidgets.git/commitdiff
Applied patch [ 1777700 ] call Reparent() from wxAuiNotebook::InsertPage()
authorJulian Smart <julian@anthemion.co.uk>
Tue, 21 Aug 2007 07:41:42 +0000 (07:41 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 21 Aug 2007 07:41:42 +0000 (07:41 +0000)
(Fixes bug [ 1769662 ] wxAuiNotebook::InsertPage() does not change page parent)

Applied patch [ 1777713 ] wxAuiNotebook::InsertPage() - properly update m_curpage
(Fixes bug [ 1769655 ] wxAuiNotebook::InsertPage() leads to inconsistent state)

From Andrey Yazhuk.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48249 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/aui/auibook.cpp

index dcc83d68f9d7fc7e8486118e0e8b8d1910426c3e..e8f25b28d7e9f5492c1d00ff6863f606ac02cd2f 100644 (file)
@@ -2989,6 +2989,8 @@ bool wxAuiNotebook::InsertPage(size_t page_idx,
                                bool select,
                                const wxBitmap& bitmap)
 {
                                bool select,
                                const wxBitmap& bitmap)
 {
+    page->Reparent(this);
+
     wxAuiNotebookPage info;
     info.window = page;
     info.caption = caption;
     wxAuiNotebookPage info;
     info.window = page;
     info.caption = caption;
@@ -3019,6 +3021,10 @@ bool wxAuiNotebook::InsertPage(size_t page_idx,
     DoSizing();
     active_tabctrl->DoShowHide();
 
     DoSizing();
     active_tabctrl->DoShowHide();
 
+    // adjust selected index
+    if(m_curpage >= (int) page_idx)
+        m_curpage++;
+
     if (select)
     {
         SetSelectionToWindow(page);
     if (select)
     {
         SetSelectionToWindow(page);