.. 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.aui.auibook
.. highlight:: python
.. _wx.lib.agw.aui.auibook.AuiTabContainer:
==========================================================================================================================================
|phoenix_title| **wx.lib.agw.aui.auibook.AuiTabContainer**
==========================================================================================================================================
AuiTabContainer is a class which contains information about each tab.
It also can render an entire tab control to a specified DC.
It's not a window class itself, because this code will be used by
the :class:`AuiNotebook`, where it is disadvantageous to have separate
windows for each tab control in the case of "docked tabs".
A derived class, :class:`AuiTabCtrl`, is an actual :class:`wx.Window` - derived window
which can be used as a tab control in the normal sense.
|
|class_hierarchy| Class Hierarchy
=================================
.. raw:: html

Inheritance diagram for class
AuiTabContainer:
|
|sub_classes| Known Subclasses
==============================
:class:`wx.lib.agw.aui.auibook.AuiTabCtrl`
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.__init__` Default class constructor.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.AddButton` Adds a button in the tab area.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.AddPage` Adds a page to the tab control.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.ButtonHitTest` Tests if a button was hit.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.CloneButtons` Clones the tab area buttons when the :class:`AuiNotebook` is being split.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.DoShowHide` This function shows the active window, then hides all of the other windows
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.EnableTab` Enables/disables a tab in the :class:`AuiTabContainer`.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.FindNextActiveTab` Finds the next active tab in the :class:`AuiTabContainer`.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.GetActivePage` Returns the current selected tab or ``wx.NOT_FOUND`` if none is selected.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.GetAGWFlags` Returns the tab art flags.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.GetArtProvider` Returns the current art provider being used.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.GetEnabled` Returns whether a tab is enabled or not.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.GetHidden` Returns whether a tab is hidden or not.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.GetIdxFromWindow` Returns the tab index based on the window `wnd` associated with it.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.GetPage` Returns the page specified by the given index.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.GetPageCount` Returns the number of pages in the :class:`AuiTabContainer`.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.GetPages` Returns a list of all the pages in this :class:`AuiTabContainer`.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.GetShownPageCount` Returns the number of pages shown in the :class:`AuiTabContainer`.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.GetTabOffset` Returns the tab offset.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.GetWindowFromIdx` Returns the window associated with the tab with index `idx`.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.HideTab` hides/shows a tab in the :class:`AuiTabContainer`.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.InsertPage` Inserts a page in the tab control in the position specified by `idx`.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.IsTabVisible` Returns whether a tab is visible or not.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.MakeTabVisible` Make the tab visible if it wasn't already.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.MovePage` Moves a page in a new position specified by `new_idx`.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.RemoveButton` Removes a button from the tab area.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.RemovePage` Removes a page from the tab control.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.Render` Renders the tab catalog to the specified :class:`wx.DC`.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.SetActivePage` Sets the :class:`AuiNotebook` active page.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.SetAGWFlags` Sets the tab art flags.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.SetArtProvider` Instructs :class:`AuiTabContainer` to use art provider specified by parameter `art`
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.SetMeasuringFont` Sets the font for calculating text measurements.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.SetNoneActive` Sets all the tabs as inactive (non-selected).
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.SetNormalFont` Sets the normal font for drawing tab labels.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.SetSelectedFont` Sets the selected tab font for drawing tab labels.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.SetTabOffset` Sets the tab offset.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.SetTabRect` Sets the tab area rectangle.
:meth:`~wx.lib.agw.aui.auibook.AuiTabContainer.TabHitTest` TabHitTest() tests if a tab was hit, passing the window pointer
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: AuiTabContainer(object)
AuiTabContainer is a class which contains information about each tab.
It also can render an entire tab control to a specified DC.
It's not a window class itself, because this code will be used by
the :class:`AuiNotebook`, where it is disadvantageous to have separate
windows for each tab control in the case of "docked tabs".
A derived class, :class:`AuiTabCtrl`, is an actual :class:`wx.Window` - derived window
which can be used as a tab control in the normal sense.
.. method:: __init__(self, auiNotebook)
Default class constructor.
Used internally, do not call it in your code!
:param `auiNotebook`: the parent :class:`AuiNotebook` window.
.. method:: AddButton(self, id, location, normal_bitmap=wx.NullBitmap, disabled_bitmap=wx.NullBitmap, name="")
Adds a button in the tab area.
:param integer `id`: the button identifier. This can be one of the following:
============================== =================================
Button Identifier Description
============================== =================================
``AUI_BUTTON_CLOSE`` Shows a close button on the tab area
``AUI_BUTTON_WINDOWLIST`` Shows a window list button on the tab area
``AUI_BUTTON_LEFT`` Shows a left button on the tab area
``AUI_BUTTON_RIGHT`` Shows a right button on the tab area
============================== =================================
:param integer `location`: the button location. Can be ``wx.LEFT`` or ``wx.RIGHT``;
:param wx.Bitmap `normal_bitmap`: the bitmap for an enabled tab;
:param wx.Bitmap `disabled_bitmap`: the bitmap for a disabled tab;
:param string `name`: the button name.
.. method:: AddPage(self, page, info)
Adds a page to the tab control.
:param wx.Window `page`: the window associated with this tab;
:param `info`: an instance of :class:`AuiNotebookPage`.
.. method:: ButtonHitTest(self, x, y, state_flags=AUI_BUTTON_STATE_HIDDEN|AUI_BUTTON_STATE_DISABLED)
Tests if a button was hit.
:param integer `x`: the mouse `x` position;
:param integer `y`: the mouse `y` position;
:param integer `state_flags`: the current button state (hidden, disabled, etc...).
:returns: and instance of :class:`AuiTabContainerButton` if a button was hit, ``None`` otherwise.
.. method:: CloneButtons(self)
Clones the tab area buttons when the :class:`AuiNotebook` is being split.
.. seealso:: :meth:`AddButton`
.. note:: Standard buttons for :class:`AuiNotebook` are not cloned, only custom ones.
.. method:: DoShowHide(self)
This function shows the active window, then hides all of the other windows
(in that order).
.. method:: EnableTab(self, idx, enable=True)
Enables/disables a tab in the :class:`AuiTabContainer`.
:param integer `idx`: the tab index;
:param bool `enable`: ``True`` to enable a tab, ``False`` to disable it.
.. method:: FindNextActiveTab(self, idx)
Finds the next active tab in the :class:`AuiTabContainer`.
:param integer `idx`: the index of the first (most obvious) tab to check for active status;
.. method:: GetActivePage(self)
Returns the current selected tab or ``wx.NOT_FOUND`` if none is selected.
.. method:: GetAGWFlags(self)
Returns the tab art flags.
.. seealso:: :meth:`SetAGWFlags` for a list of possible return values.
.. method:: GetArtProvider(self)
Returns the current art provider being used.
.. method:: GetEnabled(self, idx)
Returns whether a tab is enabled or not.
:param integer `idx`: the tab index.
.. method:: GetHidden(self, idx)
Returns whether a tab is hidden or not.
:param integer `idx`: the tab index.
.. method:: GetIdxFromWindow(self, wnd)
Returns the tab index based on the window `wnd` associated with it.
:param `wnd`: an instance of :class:`wx.Window`.
.. method:: GetPage(self, idx)
Returns the page specified by the given index.
:param integer `idx`: the tab index.
.. method:: GetPageCount(self)
Returns the number of pages in the :class:`AuiTabContainer`.
.. method:: GetPages(self)
Returns a list of all the pages in this :class:`AuiTabContainer`.
.. method:: GetShownPageCount(self)
Returns the number of pages shown in the :class:`AuiTabContainer`.
.. method:: GetTabOffset(self)
Returns the tab offset.
.. method:: GetWindowFromIdx(self, idx)
Returns the window associated with the tab with index `idx`.
:param integer `idx`: the tab index.
.. method:: HideTab(self, idx, hidden=True)
hides/shows a tab in the :class:`AuiTabContainer`.
:param integer `idx`: the tab index;
:param bool `hidden`: ``True`` to hide a tab, ``False`` to show it.
.. method:: InsertPage(self, page, info, idx)
Inserts a page in the tab control in the position specified by `idx`.
:param wx.Window `page`: the window associated with this tab;
:param `info`: an instance of :class:`AuiNotebookPage`;
:param integer `idx`: the page insertion index.
.. method:: IsTabVisible(self, tabPage, tabOffset, dc, wnd)
Returns whether a tab is visible or not.
:param integer `tabPage`: the tab index;
:param integer `tabOffset`: the tab offset;
:param `dc`: a :class:`wx.DC` device context;
:param `wnd`: an instance of :class:`wx.Window` derived window.
.. method:: MakeTabVisible(self, tabPage, win)
Make the tab visible if it wasn't already.
:param integer `tabPage`: the tab index;
:param `win`: an instance of :class:`wx.Window` derived window.
.. method:: MovePage(self, page, new_idx)
Moves a page in a new position specified by `new_idx`.
:param wx.Window `page`: the window associated with this tab;
:param integer `new_idx`: the new page position.
.. method:: RemoveButton(self, id)
Removes a button from the tab area.
:param integer `id`: the button identifier. See :meth:`AddButton` for a list of button identifiers.
.. seealso:: :meth:`AddButton`
.. method:: RemovePage(self, wnd)
Removes a page from the tab control.
:param `wnd`: an instance of :class:`wx.Window`, a window associated with this tab.
.. method:: Render(self, raw_dc, wnd)
Renders the tab catalog to the specified :class:`wx.DC`.
It is a virtual function and can be overridden to provide custom drawing
capabilities.
:param `raw_dc`: a :class:`wx.DC` device context;
:param `wnd`: an instance of :class:`wx.Window`.
.. method:: SetActivePage(self, wndOrInt)
Sets the :class:`AuiNotebook` active page.
:param `wndOrInt`: an instance of :class:`wx.Window` or an integer specifying a tab index.
.. method:: SetAGWFlags(self, agwFlags)
Sets the tab art flags.
:param integer `agwFlags`: a combination of the following values:
==================================== ==================================
Flag name Description
==================================== ==================================
``AUI_NB_TOP`` With this style, tabs are drawn along the top of the notebook
``AUI_NB_LEFT`` With this style, tabs are drawn along the left of the notebook. Not implemented yet
``AUI_NB_RIGHT`` With this style, tabs are drawn along the right of the notebook. Not implemented yet
``AUI_NB_BOTTOM`` With this style, tabs are drawn along the bottom of the notebook
``AUI_NB_TAB_SPLIT`` Allows the tab control to be split by dragging a tab
``AUI_NB_TAB_MOVE`` Allows a tab to be moved horizontally by dragging
``AUI_NB_TAB_EXTERNAL_MOVE`` Allows a tab to be moved to another tab control
``AUI_NB_TAB_FIXED_WIDTH`` With this style, all tabs have the same width
``AUI_NB_SCROLL_BUTTONS`` With this style, left and right scroll buttons are displayed
``AUI_NB_WINDOWLIST_BUTTON`` With this style, a drop-down list of windows is available
``AUI_NB_CLOSE_BUTTON`` With this style, a close button is available on the tab bar
``AUI_NB_CLOSE_ON_ACTIVE_TAB`` With this style, a close button is available on the active tab
``AUI_NB_CLOSE_ON_ALL_TABS`` With this style, a close button is available on all tabs
``AUI_NB_MIDDLE_CLICK_CLOSE`` Allows to close :class:`AuiNotebook` tabs by mouse middle button click
``AUI_NB_SUB_NOTEBOOK`` This style is used by :class:`~wx.lib.agw.aui.framemanager.AuiManager` to create automatic AuiNotebooks
``AUI_NB_HIDE_ON_SINGLE_TAB`` Hides the tab window if only one tab is present
``AUI_NB_SMART_TABS`` Use Smart Tabbing, like ``Alt`` + ``Tab`` on Windows
``AUI_NB_USE_IMAGES_DROPDOWN`` Uses images on dropdown window list menu instead of check items
``AUI_NB_CLOSE_ON_TAB_LEFT`` Draws the tab close button on the left instead of on the right (a la Camino browser)
``AUI_NB_TAB_FLOAT`` Allows the floating of single tabs. Known limitation: when the notebook is more or less full screen,
tabs cannot be dragged far enough outside of the notebook to become floating pages
``AUI_NB_DRAW_DND_TAB`` Draws an image representation of a tab while dragging (on by default)
``AUI_NB_ORDER_BY_ACCESS`` Tab navigation order by last access time for the tabs
``AUI_NB_NO_TAB_FOCUS`` Don't draw tab focus rectangle
==================================== ==================================
.. todo:: Implementation of flags ``AUI_NB_RIGHT`` and ``AUI_NB_LEFT``.
.. method:: SetArtProvider(self, art)
Instructs :class:`AuiTabContainer` to use art provider specified by parameter `art`
for all drawing calls. This allows pluggable look-and-feel features.
:param `art`: an art provider.
.. note:: The previous art provider object, if any, will be deleted by :class:`AuiTabContainer`.
.. method:: SetMeasuringFont(self, font)
Sets the font for calculating text measurements.
:param wx.Font `font`: the new font to use to measure tab label text extents.
.. method:: SetNoneActive(self)
Sets all the tabs as inactive (non-selected).
.. method:: SetNormalFont(self, font)
Sets the normal font for drawing tab labels.
:param wx.Font `font`: the new font to use to draw tab labels in their normal, un-selected state.
.. method:: SetSelectedFont(self, font)
Sets the selected tab font for drawing tab labels.
:param wx.Font `font`: the new font to use to draw tab labels in their selected state.
.. method:: SetTabOffset(self, offset)
Sets the tab offset.
:param integer `offset`: the tab offset.
.. method:: SetTabRect(self, rect)
Sets the tab area rectangle.
:param wx.Rect `rect`: the available area for :class:`AuiTabContainer`.
.. method:: TabHitTest(self, x, y)
TabHitTest() tests if a tab was hit, passing the window pointer
back if that condition was fulfilled.
:param integer `x`: the mouse `x` position;
:param integer `y`: the mouse `y` position.