Page 1 of 1

Removing the sash from a split wxAuiNotebook

Posted: Tue Mar 05, 2013 11:56 pm
by doman
I was fixing up an AUI application that programmatically splits an wxAuiNotebook. I was trying to removing the sash because there are some glitches on dock resizing in the wx 2.9 windows build used that I didn't want to have in a production environment. So I was simply trying to remove the sash that appears after splitting... was going to post in the questions forum, but after carefully picking through the AUI source and documentation for about an hour I was able to find a solution. Taking a peek under the hood, it looks like Split() in wxAuiNotebook justs calls AddPane() from the wxAuiManager member and migrates the tab over to a new notebook -- the AUI manager itself then provides the way to get rid of that sash. The working fix that I inserted after 5-6 tries with various properties of AuiPanelInfo is commented out with // in the snippet below.

Code: Select all

/*----------------------------------------------------------
Put * page on bottom.
----------------------------------------------------------*/
if( wxAuiManager::GetManager( auibook_pages ) )
    {
    //int pane_count;
    //wxAuiPaneInfoArray& panes = wxAuiManager::GetManager( auibook_pages )->GetAllPanes();
    
    wxAuiManager::GetManager( auibook_pages )->SetDockSizeConstraint( 0, 0.350 );
    auibook_pages->Split( pages[ * ], wxBOTTOM );
    wxAuiManager::GetManager( auibook_pages )->SetDockSizeConstraint( 0, 0 );        

    //pane_count = panes.GetCount();
    //for( int i = 0; i < pane_count; i++ )
    //    {    
    //    panes[ i ].DockFixed( true );
    //    wxAuiManager::GetManager( auibook_pages )->Update();
    //    }
    }