.. 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
.. currentmodule:: wx.lib.agw.labelbook
.. highlight:: python
.. _wx.lib.agw.labelbook.FlatBookBase:
==========================================================================================================================================
|phoenix_title| **wx.lib.agw.labelbook.FlatBookBase**
==========================================================================================================================================
Base class for the containing window for :class:`LabelBook` and :class:`FlatImageBook`.
|
|class_hierarchy| Class Hierarchy
=================================
.. raw:: html

Inheritance diagram for class
FlatBookBase:
|
|sub_classes| Known Subclasses
==============================
:class:`wx.lib.agw.labelbook.FlatImageBook`, :class:`wx.lib.agw.labelbook.LabelBook`
|
|super_classes| Known Superclasses
==================================
:class:`wx.Panel`
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.lib.agw.labelbook.FlatBookBase.__init__` Default class constructor.
:meth:`~wx.lib.agw.labelbook.FlatBookBase.AddPage` Adds a page to the book.
:meth:`~wx.lib.agw.labelbook.FlatBookBase.AdvanceSelection` Cycles through the tabs.
:meth:`~wx.lib.agw.labelbook.FlatBookBase.AssignImageList` Assigns an image list to the control.
:meth:`~wx.lib.agw.labelbook.FlatBookBase.ChangeSelection` Changes the selection for the given page, returning the previous selection.
:meth:`~wx.lib.agw.labelbook.FlatBookBase.DeleteAllPages` Deletes all the pages in the book.
:meth:`~wx.lib.agw.labelbook.FlatBookBase.DeletePage` Deletes the specified page, and the associated window.
:meth:`~wx.lib.agw.labelbook.FlatBookBase.DoSetSelection` Select the window by the provided pointer.
:meth:`~wx.lib.agw.labelbook.FlatBookBase.EnableTab` Enables or disables a tab.
:meth:`~wx.lib.agw.labelbook.FlatBookBase.GetAGWWindowStyleFlag` Returns the :class:`FlatBookBase` window style.
:meth:`~wx.lib.agw.labelbook.FlatBookBase.GetCurrentPage` Returns the currently selected notebook page or ``None``.
:meth:`~wx.lib.agw.labelbook.FlatBookBase.GetEnabled` Returns whether a tab is enabled or not.
:meth:`~wx.lib.agw.labelbook.FlatBookBase.GetFontBold` Gets the font bold status.
:meth:`~wx.lib.agw.labelbook.FlatBookBase.GetFontSizeMultiple` Gets the font size multiple for the page captions.
:meth:`~wx.lib.agw.labelbook.FlatBookBase.GetImageList` Returns the associated image list.
:meth:`~wx.lib.agw.labelbook.FlatBookBase.GetPage` Returns the window at the given page position.
:meth:`~wx.lib.agw.labelbook.FlatBookBase.GetPageCount` Returns the number of pages in the book.
:meth:`~wx.lib.agw.labelbook.FlatBookBase.GetPageImage` Returns the image index for the given page.
:meth:`~wx.lib.agw.labelbook.FlatBookBase.GetPageText` Returns the text for the given page.
:meth:`~wx.lib.agw.labelbook.FlatBookBase.GetSelection` Returns the current selection.
:meth:`~wx.lib.agw.labelbook.FlatBookBase.HasAGWFlag` Returns whether a flag is present in the :class:`FlatBookBase` style.
:meth:`~wx.lib.agw.labelbook.FlatBookBase.InsertPage` Inserts a page into the book at the specified position.
:meth:`~wx.lib.agw.labelbook.FlatBookBase.OnNavigationKey` Handles the ``wx.EVT_NAVIGATION_KEY`` event for :class:`FlatBookBase`.
:meth:`~wx.lib.agw.labelbook.FlatBookBase.RemovePage` Deletes the specified page, without deleting the associated window.
:meth:`~wx.lib.agw.labelbook.FlatBookBase.ResizeTabArea` Resizes the tab area if the control has the ``INB_FIT_LABELTEXT`` style set.
:meth:`~wx.lib.agw.labelbook.FlatBookBase.SetAGWWindowStyleFlag` Sets the window style.
:meth:`~wx.lib.agw.labelbook.FlatBookBase.SetFontBold` Sets whether the page captions are bold or not.
:meth:`~wx.lib.agw.labelbook.FlatBookBase.SetFontSizeMultiple` Sets the font size multiple for the page captions.
:meth:`~wx.lib.agw.labelbook.FlatBookBase.SetPageImage` Sets the image index for the given page.
:meth:`~wx.lib.agw.labelbook.FlatBookBase.SetPageText` Sets the text for the given page.
:meth:`~wx.lib.agw.labelbook.FlatBookBase.SetSelection` Changes the selection from currently visible/selected page to the page
================================================================================ ================================================================================
|
|property_summary| Properties Summary
=====================================
================================================================================ ================================================================================
:attr:`~wx.lib.agw.labelbook.FlatBookBase.CurrentPage` See `GetCurrentPage`
:attr:`~wx.lib.agw.labelbook.FlatBookBase.Page` See `GetPage`
:attr:`~wx.lib.agw.labelbook.FlatBookBase.PageCount` See `GetPageCount`
:attr:`~wx.lib.agw.labelbook.FlatBookBase.PageImage` See `GetPageImage, SetPageImage`
:attr:`~wx.lib.agw.labelbook.FlatBookBase.PageText` See `GetPageText, SetPageText`
:attr:`~wx.lib.agw.labelbook.FlatBookBase.Selection` See `GetSelection, SetSelection`
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: FlatBookBase(wx.Panel)
Base class for the containing window for :class:`LabelBook` and :class:`FlatImageBook`.
.. method:: __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, agwStyle=0, name="FlatBookBase")
Default class constructor.
:param `parent`: parent window. Must not be ``None``;
:param `id`: window identifier. A value of -1 indicates a default value;
:param `pos`: the control position. A value of (-1, -1) indicates a default position,
chosen by either the windowing system or wxPython, depending on platform;
:param `size`: the control size. A value of (-1, -1) indicates a default size,
chosen by either the windowing system or wxPython, depending on platform;
:param `style`: the underlying :class:`Panel` window style;
:param `agwStyle`: the AGW-specific window style. This can be a combination of the
following bits:
=========================== =========== ==================================================
Window Styles Hex Value Description
=========================== =========== ==================================================
``INB_BOTTOM`` 0x1 Place labels below the page area. Available only for :class:`FlatImageBook`.
``INB_LEFT`` 0x2 Place labels on the left side. Available only for :class:`FlatImageBook`.
``INB_RIGHT`` 0x4 Place labels on the right side.
``INB_TOP`` 0x8 Place labels above the page area.
``INB_BORDER`` 0x10 Draws a border around :class:`LabelBook` or :class:`FlatImageBook`.
``INB_SHOW_ONLY_TEXT`` 0x20 Shows only text labels and no images. Available only for :class:`LabelBook`.
``INB_SHOW_ONLY_IMAGES`` 0x40 Shows only tab images and no label texts. Available only for :class:`LabelBook`.
``INB_FIT_BUTTON`` 0x80 Displays a pin button to show/hide the book control.
``INB_DRAW_SHADOW`` 0x100 Draw shadows below the book tabs. Available only for :class:`LabelBook`.
``INB_USE_PIN_BUTTON`` 0x200 Displays a pin button to show/hide the book control.
``INB_GRADIENT_BACKGROUND`` 0x400 Draws a gradient shading on the tabs background. Available only for :class:`LabelBook`.
``INB_WEB_HILITE`` 0x800 On mouse hovering, tabs behave like html hyperlinks. Available only for :class:`LabelBook`.
``INB_NO_RESIZE`` 0x1000 Don't allow resizing of the tab area.
``INB_FIT_LABELTEXT`` 0x2000 Will fit the tab area to the longest text (or text+image if you have images) in all the tabs.
``INB_BOLD_TAB_SELECTION`` 0x4000 Show the selected tab text using a bold font.
=========================== =========== ==================================================
:param `name`: the window name.
.. method:: AddPage(self, page, text, select=False, imageId=-1)
Adds a page to the book.
:param `page`: specifies the new page;
:param `text`: specifies the text for the new page;
:param `select`: specifies whether the page should be selected;
:param `imageId`: specifies the optional image index for the new page.
.. note:: The call to this function generates the page changing events.
.. method:: AdvanceSelection(self, forward=True)
Cycles through the tabs.
:param `forward`: if ``True``, the selection is advanced in ascending order
(to the right), otherwise the selection is advanced in descending order.
.. note:: The call to this function generates the page changing events.
.. method:: AssignImageList(self, imglist)
Assigns an image list to the control.
:param `imglist`: an instance of :class:`wx.ImageList`.
.. method:: ChangeSelection(self, page)
Changes the selection for the given page, returning the previous selection.
:param `page`: an integer specifying the page to be selected.
.. note:: The call to this function does not generate the page changing events.
.. method:: DeleteAllPages(self)
Deletes all the pages in the book.
.. method:: DeletePage(self, page)
Deletes the specified page, and the associated window.
:param `page`: an integer specifying the page to be deleted.
.. note:: The call to this function generates the page changing events.
.. method:: DoSetSelection(self, window)
Select the window by the provided pointer.
:param `window`: an instance of :class:`wx.Window`.
.. method:: EnableTab(self, page, enabled=True)
Enables or disables a tab.
:param `page`: an integer specifying the page index;
:param `enabled`: ``True`` to enable a tab, ``False`` to disable it.
.. method:: GetAGWWindowStyleFlag(self)
Returns the :class:`FlatBookBase` window style.
.. seealso:: :meth:`~FlatBookBase.SetAGWWindowStyleFlag` for a list of possible window style flags.
.. method:: GetCurrentPage(self)
Returns the currently selected notebook page or ``None``.
.. method:: GetEnabled(self, page)
Returns whether a tab is enabled or not.
:param `page`: an integer specifying the page index.
.. method:: GetFontBold(self)
Gets the font bold status.
.. method:: GetFontSizeMultiple(self)
Gets the font size multiple for the page captions.
.. method:: GetImageList(self)
Returns the associated image list.
.. method:: GetPage(self, page)
Returns the window at the given page position.
:param `page`: an integer specifying the page to be returned.
.. method:: GetPageCount(self)
Returns the number of pages in the book.
.. method:: GetPageImage(self, page)
Returns the image index for the given page.
:param `page`: an integer specifying the page index.
.. method:: GetPageText(self, page)
Returns the text for the given page.
:param `page`: an integer specifying the page index.
.. method:: GetSelection(self)
Returns the current selection.
.. method:: HasAGWFlag(self, flag)
Returns whether a flag is present in the :class:`FlatBookBase` style.
:param `flag`: one of the possible :class:`FlatBookBase` window styles.
.. seealso:: :meth:`~FlatBookBase.SetAGWWindowStyleFlag` for a list of possible window style flags.
.. method:: InsertPage(self, page_idx, page, text, select=False, imageId=-1)
Inserts a page into the book at the specified position.
:param `page_idx`: specifies the position for the new page;
:param `page`: specifies the new page;
:param `text`: specifies the text for the new page;
:param `select`: specifies whether the page should be selected;
:param `imageId`: specifies the optional image index for the new page.
.. note:: The call to this function generates the page changing events.
.. method:: OnNavigationKey(self, event)
Handles the ``wx.EVT_NAVIGATION_KEY`` event for :class:`FlatBookBase`.
:param `event`: a :class:`NavigationKeyEvent` event to be processed.
.. method:: RemovePage(self, page)
Deletes the specified page, without deleting the associated window.
:param `page`: an integer specifying the page to be removed.
.. note:: The call to this function generates the page changing events.
.. method:: ResizeTabArea(self)
Resizes the tab area if the control has the ``INB_FIT_LABELTEXT`` style set.
.. method:: SetAGWWindowStyleFlag(self, agwStyle)
Sets the window style.
:param `agwStyle`: can be a combination of the following bits:
=========================== =========== ==================================================
Window Styles Hex Value Description
=========================== =========== ==================================================
``INB_BOTTOM`` 0x1 Place labels below the page area. Available only for :class:`FlatImageBook`.
``INB_LEFT`` 0x2 Place labels on the left side. Available only for :class:`FlatImageBook`.
``INB_RIGHT`` 0x4 Place labels on the right side.
``INB_TOP`` 0x8 Place labels above the page area.
``INB_BORDER`` 0x10 Draws a border around :class:`LabelBook` or :class:`FlatImageBook`.
``INB_SHOW_ONLY_TEXT`` 0x20 Shows only text labels and no images. Available only for :class:`LabelBook`.
``INB_SHOW_ONLY_IMAGES`` 0x40 Shows only tab images and no label texts. Available only for :class:`LabelBook`.
``INB_FIT_BUTTON`` 0x80 Displays a pin button to show/hide the book control.
``INB_DRAW_SHADOW`` 0x100 Draw shadows below the book tabs. Available only for :class:`LabelBook`.
``INB_USE_PIN_BUTTON`` 0x200 Displays a pin button to show/hide the book control.
``INB_GRADIENT_BACKGROUND`` 0x400 Draws a gradient shading on the tabs background. Available only for :class:`LabelBook`.
``INB_WEB_HILITE`` 0x800 On mouse hovering, tabs behave like html hyperlinks. Available only for :class:`LabelBook`.
``INB_NO_RESIZE`` 0x1000 Don't allow resizing of the tab area.
``INB_FIT_LABELTEXT`` 0x2000 Will fit the tab area to the longest text (or text+image if you have images) in all the tabs.
``INB_BOLD_TAB_SELECTION`` 0x4000 Show the selected tab text using a bold font.
=========================== =========== ==================================================
.. method:: SetFontBold(self, bold)
Sets whether the page captions are bold or not.
:param `bold`: ``True`` or ``False``.
.. method:: SetFontSizeMultiple(self, multiple)
Sets the font size multiple for the page captions.
:param `multiple`: The multiple to be applied to the system font to get the our font size.
.. method:: SetPageImage(self, page, imageId)
Sets the image index for the given page.
:param `page`: an integer specifying the page index;
:param `image`: an index into the image list.
.. method:: SetPageText(self, page, text)
Sets the text for the given page.
:param `page`: an integer specifying the page index;
:param `text`: the new tab label.
.. method:: SetSelection(self, page)
Changes the selection from currently visible/selected page to the page
given by page.
:param `page`: an integer specifying the page to be selected.
.. note:: The call to this function generates the page changing events.
.. attribute:: CurrentPage
See `GetCurrentPage`
.. attribute:: Page
See `GetPage`
.. attribute:: PageCount
See `GetPageCount`
.. attribute:: PageImage
See `GetPageImage, SetPageImage`
.. attribute:: PageText
See `GetPageText, SetPageText`
.. attribute:: Selection
See `GetSelection, SetSelection`