Version: 3.3.0
wxAuiBookDeserializer Class Referenceabstract

#include <wx/aui/serializer.h>

+ Inheritance diagram for wxAuiBookDeserializer:

Detailed Description

wxAuiBookDeserializer is used for deserializing wxAuiNotebook layout.

Similarly to wxAuiBookSerializer, it can be used standalone with wxAuiNotebook::LoadLayout() or as base class of wxAuiDeserializer.

Library:  wxAui
Category:  Window Docking (wxAUI)
Since
3.3.0

Public Member Functions

 wxAuiBookDeserializer ()=default
 Trivial default ctor. More...
 
virtual ~wxAuiBookDeserializer ()=default
 Trivial but virtual destructor. More...
 
virtual std::vector< wxAuiTabLayoutInfoLoadNotebookTabs (const wxString &name)=0
 Load information about the notebook tabs previously saved by wxAuiBookSerializer::SaveNotebookTabControl(). More...
 
virtual bool HandleOrphanedPage (wxAuiNotebook &book, int page, wxAuiTabCtrl **tabCtrl, int *tabIndex)
 Determine what should be done with the pages not attached to any tab control after restoring the pages order. More...
 

Constructor & Destructor Documentation

◆ wxAuiBookDeserializer()

wxAuiBookDeserializer::wxAuiBookDeserializer ( )
default

Trivial default ctor.

◆ ~wxAuiBookDeserializer()

virtual wxAuiBookDeserializer::~wxAuiBookDeserializer ( )
virtualdefault

Trivial but virtual destructor.

Member Function Documentation

◆ HandleOrphanedPage()

virtual bool wxAuiBookDeserializer::HandleOrphanedPage ( wxAuiNotebook book,
int  page,
wxAuiTabCtrl **  tabCtrl,
int *  tabIndex 
)
virtual

Determine what should be done with the pages not attached to any tab control after restoring the pages order.

It is possible that the data returned by LoadNotebookTabs() doesn't contain the layout information for all the currently existing pages, e.g. because data saved by an earlier program version is being loaded into a newer version in which new pages were added. In this case, this function is called for each page that wasn't assigned to any tab after restoring the pages order and can be overridden to determine what should be done with it.

The default implementation of this function just returns true without modifying the output arguments, which results in the page being appended to the main tab control. The overridden version may return true but modify tabCtrl and tabIndex arguments to change where the page should be inserted, e.g. by setting tabIndex to 0 to insert the new pages at the beginning instead of appending them.

Finally, the overridden function may return false to indicate that the page should be removed from the notebook.

Note
The book parameter can be used to retrieve the total number of pages or to call functions such as wxAuiNotebook::GetMainTabCtrl() or wxAuiNotebook::GetAllTabCtrls() on it, but this function must not attempt to modify it by adding or removing pages to/from it.

◆ LoadNotebookTabs()

virtual std::vector<wxAuiTabLayoutInfo> wxAuiBookDeserializer::LoadNotebookTabs ( const wxString name)
pure virtual

Load information about the notebook tabs previously saved by wxAuiBookSerializer::SaveNotebookTabControl().

When using this class as a base class of wxAuiDeserializer, this function is called by wxAuiManager::LoadLayout() after loading the pane with the name name if it is a wxAuiNotebook. Otherwise, i.e. when using wxAuiNotebook::LoadLayout() directly, this function is called with the same name as was passed to that function.

If restoring the notebook layout is not necessary, this function can just return an empty vector which is interpreted as meaning that the default notebook layout should be used.