.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2020 by Total Control Software
License: wxWindows License
.. include:: headings.inc
.. _wx.aui.AuiBookDeserializer:
==========================================================================================================================================
|phoenix_title| **wx.aui.AuiBookDeserializer**
==========================================================================================================================================
:ref:`wx.aui.AuiBookDeserializer` is used for deserializing :ref:`wx.aui.AuiNotebook` layout.
Similarly to :ref:`wx.aui.AuiBookSerializer`, it can be used standalone with :meth:`wx.aui.AuiNotebook.LoadLayout` or as base class of :ref:`wx.aui.AuiDeserializer`.
.. versionadded:: 4.3/wxWidgets-3.3.0
|
|class_hierarchy| Class Hierarchy
=================================
.. raw:: html

Inheritance diagram for class
AuiBookDeserializer:
|
|sub_classes| Known Subclasses
==============================
:ref:`wx.aui.AuiDeserializer`
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.aui.AuiBookDeserializer.__init__` Trivial default constructor.
:meth:`~wx.aui.AuiBookDeserializer.HandleOrphanedPage` Determine what should be done with the pages not attached to any tab control after restoring the pages order.
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: wx.aui.AuiBookDeserializer(object)
**Possible constructors**::
AuiBookDeserializer() -> None
AuiBookDeserializer is used for deserializing AuiNotebook layout.
.. method:: __init__(self)
Trivial default constructor.
:rtype: `None`
.. method:: HandleOrphanedPage(self, book, page, tabCtrl, tabIndex)
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 :meth:`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.
:param `book`:
:type `book`: wx.aui.AuiNotebook
:param `page`:
:type `page`: int
:param `tabCtrl`:
:type `tabCtrl`: AuiTabCtrl
:param `tabIndex`:
:type `tabIndex`: int
:rtype: `bool`
.. note::
The `book` parameter can be used to retrieve the total number of pages or to call functions such as :meth:`wx.aui.AuiNotebook.GetMainTabCtrl` or :meth:`wx.aui.AuiNotebook.GetAllTabCtrls` on it, but this function must not attempt to modify it by adding or removing pages to/from it.