Version: 3.3.0
wxAuiDeserializer Class Referenceabstract

#include <wx/aui/serializer.h>

+ Inheritance diagram for wxAuiDeserializer:

Detailed Description

wxAuiDeserializer is used by wxAuiManager::LoadLayout() to restore layout information saved by wxAuiManager::SaveLayout().

As wxAuiSerializer, this is an abstract base class, you need to inherit from it and override its pure virtual functions in your derived class.

Derived class function also may throw and, if any of them other than AfterLoad() does, the existing layout is not changed, i.e. wxAuiManager::LoadLayout() is exception-safe.

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

Public Member Functions

 wxAuiDeserializer (wxAuiManager &manager)
 Constructor taking the manager for which we're restoring the layout. More...
 
virtual ~wxAuiDeserializer ()=default
 Trivial but virtual destructor. More...
 
virtual void BeforeLoad ()
 Called before doing anything else. More...
 
virtual std::vector< wxAuiPaneLayoutInfoLoadPanes ()=0
 Load information about all the panes previously saved by wxAuiSerializer::SavePane(). More...
 
virtual wxWindowCreatePaneWindow (wxAuiPaneInfo &pane)
 Create the window to be managed by the given pane if necessary. More...
 
virtual void AfterLoad ()
 Called after restoring everything. More...
 
- Public Member Functions inherited from wxAuiBookDeserializer
 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...
 

Protected Attributes

wxAuiManagerm_manager
 The manager for which we're restoring the layout. More...
 

Constructor & Destructor Documentation

◆ wxAuiDeserializer()

wxAuiDeserializer::wxAuiDeserializer ( wxAuiManager manager)
explicit

Constructor taking the manager for which we're restoring the layout.

The manager remains valid for the lifetime of this object.

◆ ~wxAuiDeserializer()

virtual wxAuiDeserializer::~wxAuiDeserializer ( )
virtualdefault

Trivial but virtual destructor.

Member Function Documentation

◆ AfterLoad()

virtual void wxAuiDeserializer::AfterLoad ( )
virtual

Called after restoring everything.

Default implementation calls wxAuiManager::Update(). Override this function and do not call the base class version if you want to prevent this from happening, e.g. if you need to make further changes to the restored layout before updating it.

◆ BeforeLoad()

virtual void wxAuiDeserializer::BeforeLoad ( )
virtual

Called before doing anything else.

Does nothing by default.

◆ CreatePaneWindow()

virtual wxWindow* wxAuiDeserializer::CreatePaneWindow ( wxAuiPaneInfo pane)
virtual

Create the window to be managed by the given pane if necessary.

This function is called if any of the panes returned by LoadPanes() doesn't exist in the existing layout and allows to create windows on the fly.

If this function returns nullptr, as it does by default, the pane is not added to the manager.

If the function does create a new window, it should typically modify pane parameter to fill in the fields such as caption or icon that wouldn't normally be serialized and so wouldn't be restored by LoadPanes().

◆ LoadPanes()

virtual std::vector<wxAuiPaneLayoutInfo> wxAuiDeserializer::LoadPanes ( )
pure virtual

Load information about all the panes previously saved by wxAuiSerializer::SavePane().

Unlike the serializer function, this one is called only once and should return all the panes in the layout.

Just as the serializer function, this one doesn't need to perform any scaling itself as this will be done, if necessary, by wxAuiManager itself.

If some pane in the returned vector doesn't already exist, i.e. there is no pane with the matching name, CreatePaneWindow() is called to allow creating it on the fly.

Member Data Documentation

◆ m_manager

wxAuiManager& wxAuiDeserializer::m_manager
protected

The manager for which we're restoring the layout.