.. wxPython Phoenix documentation This file was generated by Phoenix's sphinx generator and associated tools, do not edit by hand. Copyright: (c) 2011-2017 by Total Control Software License: wxWindows License .. include:: headings.inc .. currentmodule:: wx.lib.agw.aui.auibook .. highlight:: python .. _wx.lib.agw.aui.auibook.AuiNotebook: ========================================================================================================================================== |phoenix_title| **wx.lib.agw.aui.auibook.AuiNotebook** ========================================================================================================================================== AuiNotebook is a notebook control which implements many features common in applications with dockable panes. Specifically, AuiNotebook implements functionality which allows the user to rearrange tab order via drag-and-drop, split the tab window into many different splitter configurations, and toggle through different themes to customize the control's look and feel. An effort has been made to try to maintain an API as similar to that of :class:`Notebook`. The default theme that is used is :class:`~wx.lib.agw.aui.tabart.AuiDefaultTabArt`, which provides a modern, glossy look and feel. The theme can be changed by calling :meth:`AuiNotebook.SetArtProvider`. | |class_hierarchy| Class Hierarchy ================================= .. raw:: html
Inheritance diagram for class AuiNotebook:

| |appearance| Control Appearance =============================== | .. figure:: _static/images/widgets/fullsize/wxmsw/wx.lib.agw.aui.auibook.auinotebook.png :alt: wxMSW :figclass: floatleft **wxMSW** .. figure:: _static/images/widgets/fullsize/wxmac/../no_appearance.png :alt: wxMAC :figclass: floatright **wxMAC** .. figure:: _static/images/widgets/fullsize/wxgtk/../no_appearance.png :alt: wxGTK :figclass: floatcenter **wxGTK** | |sub_classes| Known Subclasses ============================== :class:`wx.lib.agw.aui.tabmdi.AuiMDIClientWindow` | |super_classes| Known Superclasses ================================== :class:`wx.Panel` | |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.__init__` Default class constructor. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.AddControlToPage` Adds a control inside a tab (not in the tab area). :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.AddPage` Adds a page. If the `select` parameter is ``True``, calling this will generate a :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.AddTabAreaButton` Adds a button in the tab area. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.AdvanceSelection` Cycles through the tabs. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.AssignImageList` Sets the image list for the :class:`AuiNotebook` control. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.CalculateNewSplitSize` Calculates the size of the new split. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.CalculateTabCtrlHeight` Calculates the tab control area height. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.CloneTabAreaButtons` Clones the tab area buttons when the :class:`AuiNotebook` is being split. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.DeletePage` Deletes a page at the given index. Calling this method will generate a page :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.Destroy` Destroys the window safely. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.DoSizing` Performs all sizing operations in each tab control. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.EditTab` Starts the editing of an item label, sending a ``EVT_AUINOTEBOOK_BEGIN_LABEL_EDIT`` event. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.EnableTab` Enables/disables a page in the notebook. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.EnsureVisible` Ensures the input page index `indx` is visible. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.FindNextActiveTab` Finds the next active tab (used mainly when :class:`AuiNotebook` has inactive/disabled :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.FindTab` Finds the tab control that currently contains the window as well :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.FloatPage` Float the page in `page_index` by reparenting it to a floating frame. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.GetActiveTabCtrl` Returns the active tab control. It is called to determine which control :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.GetAGWWindowStyleFlag` Returns the AGW-specific style of the window. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.GetArtProvider` Returns the associated art provider. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.GetAuiManager` Returns the associated :class:`~wx.lib.agw.aui.framemanager.AuiManager`. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.GetCurrentPage` Returns the currently active page (not the index), or ``None`` if none was selected. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.GetDefaultBorder` Returns the default border style for :class:`AuiNotebook`. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.GetEnabled` Returns whether the page specified by the index `page_idx` is enabled. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.GetHeightForPageHeight` Gets the height of the notebook for a given page height. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.GetImageList` Returns the associated image list (if any). :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.GetMinMaxTabWidth` Returns the minimum and the maximum tab widths for :class:`AuiNotebook` when the :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.GetPage` Returns the page specified by the given index. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.GetPageBitmap` Returns the tab bitmap for the page. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.GetPageCount` Returns the number of pages in the notebook. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.GetPageImage` Returns the image index for the given page. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.GetPageIndex` Returns the page index for the specified window. If the window is not :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.GetPageInfo` Returns the :class:`AuiNotebookPage` info structure specified by the given index. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.GetPageText` Returns the tab label for the page. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.GetPageTextColour` Returns the tab text colour for the page. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.GetPageTooltip` Returns the tab tooltip for the page. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.GetSashDClickUnsplit` Returns whether a splitted :class:`AuiNotebook` can be unsplitted by double-clicking :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.GetSelection` Returns the index of the currently active page, or -1 if none was selected. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.GetTabContainer` Returns the instance of :class:`AuiTabContainer`. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.GetTabCtrlFromPoint` Returns the tab control at the specified point. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.GetTabCtrlHeight` Returns the tab control height. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.GetTabFrameFromTabCtrl` Returns the tab frame associated with a tab control. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.GetTabFrameFromWindow` Returns the tab frame associated with a window. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.HasCloseButton` Returns whether a tab displays a close button or not. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.HasMultiplePages` This method should be overridden to return ``True`` if this window has multiple pages. All :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.HideAllTabs` Hides all tabs on the :class:`AuiNotebook` control. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.InitNotebook` Contains common initialization code called by all constructors. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.InsertPage` This is similar to :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.AddPage` but allows the ability to specify the insert location. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.IsMouseWellOutsideWindow` Returns whether the mouse is well outside the :class:`AuiNotebook` screen rectangle. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.IsRenamable` Returns whether a tab can be renamed or not. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.LoadPerspective` Loads a layout which was saved with :meth:`SavePerspective`. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.NotebookPreview` Generates a preview of all the pages in the notebook (MSW and GTK only). :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.OnChildFocusNotebook` Handles the ``wx.EVT_CHILD_FOCUS`` event for :class:`AuiNotebook`. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.OnCloseFloatingPage` Handles the ``wx.EVT_CLOSE`` event for a floating page in :class:`AuiNotebook`. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.OnNavigationKeyNotebook` Handles the ``wx.EVT_NAVIGATION_KEY`` event for :class:`AuiNotebook`. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.OnRenameAccept` Called by :class:`TabTextCtrl`, to accept the changes and to send the :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.OnRenameCancelled` Called by :class:`TabTextCtrl`, to cancel the changes and to send the :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.OnSize` Handles the ``wx.EVT_SIZE`` event for :class:`AuiNotebook`. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.OnTabBeginDrag` Handles the ``EVT_AUINOTEBOOK_BEGIN_DRAG`` event for :class:`AuiNotebook`. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.OnTabBgDClick` Handles the ``EVT_AUINOTEBOOK_BG_DCLICK`` event for :class:`AuiNotebook`. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.OnTabButton` Handles the ``EVT_AUINOTEBOOK_BUTTON`` event for :class:`AuiNotebook`. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.OnTabCancelDrag` Handles the ``EVT_AUINOTEBOOK_CANCEL_DRAG`` event for :class:`AuiNotebook`. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.OnTabClicked` Handles the ``EVT_AUINOTEBOOK_PAGE_CHANGING`` event for :class:`AuiNotebook`. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.OnTabDClick` Handles the ``EVT_AUINOTEBOOK_TAB_DCLICK`` event for :class:`AuiNotebook`. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.OnTabDragMotion` Handles the ``EVT_AUINOTEBOOK_DRAG_MOTION`` event for :class:`AuiNotebook`. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.OnTabEndDrag` Handles the ``EVT_AUINOTEBOOK_END_DRAG`` event for :class:`AuiNotebook`. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.OnTabMiddleDown` Handles the ``EVT_AUINOTEBOOK_TAB_MIDDLE_DOWN`` event for :class:`AuiNotebook`. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.OnTabMiddleUp` Handles the ``EVT_AUINOTEBOOK_TAB_MIDDLE_UP`` event for :class:`AuiNotebook`. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.OnTabRightDown` Handles the ``EVT_AUINOTEBOOK_TAB_RIGHT_DOWN`` event for :class:`AuiNotebook`. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.OnTabRightUp` Handles the ``EVT_AUINOTEBOOK_TAB_RIGHT_UP`` event for :class:`AuiNotebook`. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.ReDockPage` Re-docks a floating :class:`AuiNotebook` tab in the original position, when possible. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.RemoveControlFromPage` Removes a control from a tab (not from the tab area). :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.RemoveEmptyTabFrames` Removes all the empty tab frames. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.RemovePage` Removes a page, without deleting the window pointer. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.RemoveTabAreaButton` Removes a button from the tab area. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.ReparentControl` Reparents a control added inside a tab. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.ResetTextControl` Called by :class:`TabTextCtrl` when it marks itself for deletion. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.SavePerspective` Saves the entire user interface layout into an encoded string, which can then :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.SetAGWWindowStyleFlag` Sets the AGW-specific style of the window. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.SetArtProvider` Sets the art provider to be used by the notebook. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.SetCloseButton` Sets whether a tab should display a close button or not. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.SetFont` Sets the tab font. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.SetImageList` Sets the image list for the :class:`AuiNotebook` control. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.SetMeasuringFont` Sets the font for calculating text measurements. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.SetMinMaxTabWidth` Sets the minimum and/or the maximum tab widths for :class:`AuiNotebook` when the :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.SetNavigatorIcon` Sets the icon used by the :class:`TabNavigatorWindow`. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.SetNormalFont` Sets the normal font for drawing tab labels. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.SetPageBitmap` Sets the tab bitmap for the page. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.SetPageImage` Sets the image index for the given page. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.SetPageText` Sets the tab label for the page. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.SetPageTextColour` Sets the tab text colour for the page. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.SetPageTooltip` Sets the tab tooltip for the page. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.SetRenamable` Sets whether a tab can be renamed via a left double-click or not. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.SetSashDClickUnsplit` Sets whether to unsplit a splitted :class:`AuiNotebook` when double-clicking on a sash. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.SetSelectedFont` Sets the selected tab font for drawing tab labels. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.SetSelection` Sets the page selection. Calling this method will generate a page change event. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.SetSelectionToPage` Sets the selection based on the input page. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.SetSelectionToWindow` Sets the selection based on the input window `win`. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.SetTabCtrlHeight` Sets the tab height. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.SetUniformBitmapSize` Ensures that all tabs will have the same height, even if some tabs don't have bitmaps. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.ShowWindowMenu` Shows the window menu for the active tab control associated with this :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.Split` Performs a split operation programmatically. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.UnSplit` Restores original view after a tab split. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.UnsplitDClick` Unsplit the :class:`AuiNotebook` on sash double-click. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.UpdateHintWindowSize` Updates the :class:`~wx.lib.agw.aui.framemanager.AuiManager` hint window size. :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.UpdateTabCtrlHeight` :meth:`~wx.lib.agw.aui.auibook.AuiNotebook.UpdateTabCtrlHeight` does the actual tab resizing. It's meant ================================================================================ ================================================================================ | |property_summary| Properties Summary ===================================== ================================================================================ ================================================================================ :attr:`~wx.lib.agw.aui.auibook.AuiNotebook.NavigatorProps` ================================================================================ ================================================================================ | |api| Class API =============== .. class:: AuiNotebook(wx.Panel) AuiNotebook is a notebook control which implements many features common in applications with dockable panes. Specifically, AuiNotebook implements functionality which allows the user to rearrange tab order via drag-and-drop, split the tab window into many different splitter configurations, and toggle through different themes to customize the control's look and feel. An effort has been made to try to maintain an API as similar to that of :class:`Notebook`. The default theme that is used is :class:`~wx.lib.agw.aui.tabart.AuiDefaultTabArt`, which provides a modern, glossy look and feel. The theme can be changed by calling :meth:`AuiNotebook.SetArtProvider`. .. method:: __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, agwStyle=AUI_NB_DEFAULT_STYLE, name="AuiNotebook") Default class constructor. :param wx.Window `parent`: the :class:`AuiNotebook` parent; :param integer `id`: an identifier for the control: a value of -1 is taken to mean a default; :param wx.Point `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 wx.Size `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 integer `style`: the underlying :class:`Panel` window style; :param integer `agwStyle`: the AGW-specific window style. This can be a combination of the following bits: ==================================== ================================== 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 ==================================== ================================== Default value for `agwStyle` is: ``AUI_NB_DEFAULT_STYLE`` = ``AUI_NB_TOP`` | ``AUI_NB_TAB_SPLIT`` | ``AUI_NB_TAB_MOVE`` | ``AUI_NB_SCROLL_BUTTONS`` | ``AUI_NB_CLOSE_ON_ACTIVE_TAB`` | ``AUI_NB_MIDDLE_CLICK_CLOSE`` | ``AUI_NB_DRAW_DND_TAB`` :param string `name`: the window name. .. method:: AddControlToPage(self, page_idx, control) Adds a control inside a tab (not in the tab area). :param integer `page_idx`: the page index; :param wx.Window `control`: almost any :class:`wx.Window` -derived instance to be located inside a tab. .. method:: AddPage(self, page, caption, select=False, bitmap=wx.NullBitmap, disabled_bitmap=wx.NullBitmap, control=None, tooltip="") Adds a page. If the `select` parameter is ``True``, calling this will generate a page change event. :param wx.Window `page`: the page to be added; :param string `caption`: specifies the text for the new page; :param bool `select`: specifies whether the page should be selected; :param wx.Bitmap `bitmap`: the bitmap to display in the enabled tab; :param wx.Bitmap `disabled_bitmap`: the bitmap to display in the disabled tab; :param wx.Window `control`: almost any :class:`wx.Window` -derived instance to be located inside a tab; :param string `tooltip`: the tooltip to display when the mouse hovers over the tab. .. method:: AddTabAreaButton(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:: AdvanceSelection(self, forward=True, wrap=True) Cycles through the tabs. :param bool `forward`: whether to advance forward or backward; :param bool `wrap`: ``True`` to return to the first tab if we reach the last tab. .. note:: The call to this function generates the page changing events. .. method:: AssignImageList(self, imageList) Sets the image list for the :class:`AuiNotebook` control. :param `imageList`: an instance of :class:`wx.ImageList`. .. method:: CalculateNewSplitSize(self) Calculates the size of the new split. .. method:: CalculateTabCtrlHeight(self) Calculates the tab control area height. .. method:: CloneTabAreaButtons(self) Clones the tab area buttons when the :class:`AuiNotebook` is being split. .. seealso:: :meth:`AddTabAreaButton` .. note:: Standard buttons for :class:`AuiNotebook` are not cloned, only custom ones. .. method:: DeletePage(self, page_idx) Deletes a page at the given index. Calling this method will generate a page change event. :param integer `page_idx`: the page index to be deleted. .. note:: :meth:`DeletePage` removes a tab from the multi-notebook, and destroys the window as well. .. seealso:: :meth:`RemovePage` .. method:: Destroy(self) Destroys the window safely. Use this function instead of the ``del`` operator, since different window classes can be destroyed differently. Frames and dialogs are not destroyed immediately when this function is called -- they are added to a list of windows to be deleted on idle time, when all the window's events have been processed. This prevents problems with events being sent to non-existent windows. :return: ``True`` if the window has either been successfully deleted, or it has been added to the list of windows pending real deletion. .. note:: This method has been added to safely un-initialize the underlying :class:`~wx.lib.agw.aui.framemanager.AuiManager` which manages the :class:`AuiNotebook` layout (i.e., tab split, re-ordering, tab floating etc...). .. method:: DoSizing(self) Performs all sizing operations in each tab control. .. method:: EditTab(self, page_index) Starts the editing of an item label, sending a ``EVT_AUINOTEBOOK_BEGIN_LABEL_EDIT`` event. :param integer `page_index`: the page index we want to edit. .. method:: EnableTab(self, page_idx, enable=True) Enables/disables a page in the notebook. :param integer `page_idx`: the page index; :param bool `enable`: ``True`` to enable the page, ``False`` to disable it. .. method:: EnsureVisible(self, indx) Ensures the input page index `indx` is visible. :param integer `indx`: the page index. .. method:: FindNextActiveTab(self, ctrl_idx, ctrl) Finds the next active tab (used mainly when :class:`AuiNotebook` has inactive/disabled tabs in it). :param integer `ctrl_idx`: the index of the first (most obvious) tab to check for active status; :param `ctrl`: an instance of :class:`AuiTabCtrl`. .. method:: FindTab(self, page) Finds the tab control that currently contains the window as well as the index of the window in the tab control. It returns ``True`` if the window was found, otherwise ``False``. :param `page`: an instance of :class:`AuiNotebookPage`. .. method:: FloatPage(self, page_index) Float the page in `page_index` by reparenting it to a floating frame. :param integer `page_index`: the index of the page to be floated. .. warning:: When the notebook is more or less full screen, tabs cannot be dragged far enough outside of the notebook to become floating pages. .. method:: GetActiveTabCtrl(self) Returns the active tab control. It is called to determine which control gets new windows being added. .. method:: GetAGWWindowStyleFlag(self) Returns the AGW-specific style of the window. .. seealso:: :meth:`SetAGWWindowStyleFlag` for a list of possible AGW-specific window styles. .. method:: GetArtProvider(self) Returns the associated art provider. .. method:: GetAuiManager(self) Returns the associated :class:`~wx.lib.agw.aui.framemanager.AuiManager`. .. method:: GetCurrentPage(self) Returns the currently active page (not the index), or ``None`` if none was selected. .. method:: GetDefaultBorder(self) Returns the default border style for :class:`AuiNotebook`. .. method:: GetEnabled(self, page_idx) Returns whether the page specified by the index `page_idx` is enabled. :param integer `page_idx`: the page index. .. method:: GetHeightForPageHeight(self, pageHeight) Gets the height of the notebook for a given page height. :param integer `pageHeight`: the given page height. .. method:: GetImageList(self) Returns the associated image list (if any). .. method:: GetMinMaxTabWidth(self) Returns the minimum and the maximum tab widths for :class:`AuiNotebook` when the ``AUI_NB_TAB_FIXED_WIDTH`` style is defined. .. note:: Minimum and maximum tabs widths are used only when the ``AUI_NB_TAB_FIXED_WIDTH`` style is present. .. seealso:: :meth:`SetMinMaxTabWidth` for more information. .. method:: GetPage(self, page_idx) Returns the page specified by the given index. :param integer `page_idx`: the page index. .. method:: GetPageBitmap(self, page_idx) Returns the tab bitmap for the page. :param integer `page_idx`: the page index. .. method:: GetPageCount(self) Returns the number of pages in the notebook. .. method:: GetPageImage(self, page) Returns the image index for the given page. :param integer `page`: the given page for which to retrieve the image index. .. method:: GetPageIndex(self, page_wnd) Returns the page index for the specified window. If the window is not found in the notebook, ``wx.NOT_FOUND`` is returned. :param wx.Window `page_wnd`: the window we are looking for. .. method:: GetPageInfo(self, page_idx) Returns the :class:`AuiNotebookPage` info structure specified by the given index. :param integer `page_idx`: the page index. .. method:: GetPageText(self, page_idx) Returns the tab label for the page. :param integer `page_idx`: the page index. .. method:: GetPageTextColour(self, page_idx) Returns the tab text colour for the page. :param integer `page_idx`: the page index. .. method:: GetPageTooltip(self, page_idx) Returns the tab tooltip for the page. :param integer `page_idx`: the page index. .. method:: GetSashDClickUnsplit(self) Returns whether a splitted :class:`AuiNotebook` can be unsplitted by double-clicking on the splitter sash. .. method:: GetSelection(self) Returns the index of the currently active page, or -1 if none was selected. .. method:: GetTabContainer(self) Returns the instance of :class:`AuiTabContainer`. .. method:: GetTabCtrlFromPoint(self, pt) Returns the tab control at the specified point. :param wx.Point `pt`: the mouse location. .. method:: GetTabCtrlHeight(self) Returns the tab control height. .. method:: GetTabFrameFromTabCtrl(self, tab_ctrl) Returns the tab frame associated with a tab control. :param `tab_ctrl`: an instance of :class:`AuiTabCtrl`. .. method:: GetTabFrameFromWindow(self, wnd) Returns the tab frame associated with a window. :param wx.Window `wnd`: the window for which we want to locate the :class:`TabFrame`. .. method:: HasCloseButton(self, page_idx) Returns whether a tab displays a close button or not. :param integer `page_idx`: the page index. .. note:: This can only be called if ``AUI_NB_CLOSE_ON_ALL_TABS`` is specified. .. method:: HasMultiplePages(self) This method should be overridden to return ``True`` if this window has multiple pages. All standard class with multiple pages such as :class:`Notebook`, :class:`Listbook` and :class:`Treebook` already override it to return ``True`` and user-defined classes with similar behaviour should do it as well to allow the library to handle such windows appropriately. .. note:: Overridden from :class:`Panel`. .. method:: HideAllTabs(self, hidden=True) Hides all tabs on the :class:`AuiNotebook` control. :param bool `hidden`: if ``True`` hides all tabs. .. method:: InitNotebook(self, agwStyle) Contains common initialization code called by all constructors. :param integer `agwStyle`: the notebook style. .. seealso:: :meth:`~AuiNotebook.__init__` for a list of available `agwStyle` bits. .. method:: InsertPage(self, page_idx, page, caption, select=False, bitmap=wx.NullBitmap, disabled_bitmap=wx.NullBitmap, control=None, tooltip="") This is similar to :meth:`AddPage`, but allows the ability to specify the insert location. :param integer `page_idx`: specifies the position for the new page; :param wx.Window `page`: the page to be added; :param string `caption`: specifies the text for the new page; :param bool `select`: specifies whether the page should be selected; :param wx.Bitmap `bitmap`: the bitmap to display in the enabled tab; :param wx.Bitmap `disabled_bitmap`: the bitmap to display in the disabled tab; :param wx.Window `control`: almost any :class:`wx.Window` -derived instance to be located inside a ; :param string `tooltip`: the tooltip to display when the mouse hovers over the tab. .. method:: IsMouseWellOutsideWindow(self) Returns whether the mouse is well outside the :class:`AuiNotebook` screen rectangle. .. method:: IsRenamable(self, page_idx) Returns whether a tab can be renamed or not. :param integer `page_idx`: the page index. :returns: ``True`` is a page can be renamed, ``False`` otherwise. .. method:: LoadPerspective(self, layout) Loads a layout which was saved with :meth:`SavePerspective`. :param string `layout`: a string which contains a saved :class:`AuiNotebook` layout. .. method:: NotebookPreview(self, thumbnail_size=200) Generates a preview of all the pages in the notebook (MSW and GTK only). :param integer `thumbnail_size`: the maximum size of every page thumbnail (default=200 pixels). .. note:: this functionality is currently unavailable on wxMAC. .. method:: OnChildFocusNotebook(self, event) Handles the ``wx.EVT_CHILD_FOCUS`` event for :class:`AuiNotebook`. :param `event`: a :class:`ChildFocusEvent` event to be processed. .. method:: OnCloseFloatingPage(self, event) Handles the ``wx.EVT_CLOSE`` event for a floating page in :class:`AuiNotebook`. :param `event`: a :class:`CloseEvent` event to be processed. .. method:: OnNavigationKeyNotebook(self, event) Handles the ``wx.EVT_NAVIGATION_KEY`` event for :class:`AuiNotebook`. :param `event`: a :class:`NavigationKeyEvent` event to be processed. .. method:: OnRenameAccept(self, page_index, value) Called by :class:`TabTextCtrl`, to accept the changes and to send the ``EVT_AUINOTEBOOK_END_LABEL_EDIT`` event. :param integer `page_index`: the page index in the notebook; :param string `value`: the new label for the tab. .. method:: OnRenameCancelled(self, page_index) Called by :class:`TabTextCtrl`, to cancel the changes and to send the ``EVT_AUINOTEBOOK_END_LABEL_EDIT`` event. :param integer `page_index`: the page index in the notebook. .. method:: OnSize(self, event) Handles the ``wx.EVT_SIZE`` event for :class:`AuiNotebook`. :param `event`: a :class:`wx.SizeEvent` event to be processed. .. method:: OnTabBeginDrag(self, event) Handles the ``EVT_AUINOTEBOOK_BEGIN_DRAG`` event for :class:`AuiNotebook`. :param `event`: a :class:`AuiNotebookEvent` event to be processed. .. method:: OnTabBgDClick(self, event) Handles the ``EVT_AUINOTEBOOK_BG_DCLICK`` event for :class:`AuiNotebook`. :param `event`: a :class:`AuiNotebookEvent` event to be processed. .. method:: OnTabButton(self, event) Handles the ``EVT_AUINOTEBOOK_BUTTON`` event for :class:`AuiNotebook`. :param `event`: a :class:`AuiNotebookEvent` event to be processed. .. method:: OnTabCancelDrag(self, event) Handles the ``EVT_AUINOTEBOOK_CANCEL_DRAG`` event for :class:`AuiNotebook`. :param `event`: a :class:`AuiNotebookEvent` event to be processed. .. method:: OnTabClicked(self, event) Handles the ``EVT_AUINOTEBOOK_PAGE_CHANGING`` event for :class:`AuiNotebook`. :param `event`: a :class:`AuiNotebookEvent` event to be processed. .. method:: OnTabDClick(self, event) Handles the ``EVT_AUINOTEBOOK_TAB_DCLICK`` event for :class:`AuiNotebook`. :param `event`: a :class:`AuiNotebookEvent` event to be processed. .. method:: OnTabDragMotion(self, event) Handles the ``EVT_AUINOTEBOOK_DRAG_MOTION`` event for :class:`AuiNotebook`. :param `event`: a :class:`AuiNotebookEvent` event to be processed. .. method:: OnTabEndDrag(self, event) Handles the ``EVT_AUINOTEBOOK_END_DRAG`` event for :class:`AuiNotebook`. :param `event`: a :class:`AuiNotebookEvent` event to be processed. .. method:: OnTabMiddleDown(self, event) Handles the ``EVT_AUINOTEBOOK_TAB_MIDDLE_DOWN`` event for :class:`AuiNotebook`. :param `event`: a :class:`AuiNotebookEvent` event to be processed. .. method:: OnTabMiddleUp(self, event) Handles the ``EVT_AUINOTEBOOK_TAB_MIDDLE_UP`` event for :class:`AuiNotebook`. :param `event`: a :class:`AuiNotebookEvent` event to be processed. .. method:: OnTabRightDown(self, event) Handles the ``EVT_AUINOTEBOOK_TAB_RIGHT_DOWN`` event for :class:`AuiNotebook`. :param `event`: a :class:`AuiNotebookEvent` event to be processed. .. method:: OnTabRightUp(self, event) Handles the ``EVT_AUINOTEBOOK_TAB_RIGHT_UP`` event for :class:`AuiNotebook`. :param `event`: a :class:`AuiNotebookEvent` event to be processed. .. method:: ReDockPage(self, pane) Re-docks a floating :class:`AuiNotebook` tab in the original position, when possible. :param `pane`: an instance of :class:`~wx.lib.agw.aui.framemanager.AuiPaneInfo`. .. method:: RemoveControlFromPage(self, page_idx) Removes a control from a tab (not from the tab area). :param integer `page_idx`: the page index. .. method:: RemoveEmptyTabFrames(self) Removes all the empty tab frames. .. method:: RemovePage(self, page_idx) Removes a page, without deleting the window pointer. :param integer `page_idx`: the page index to be removed. .. note:: :meth:`RemovePage` removes a tab from the multi-notebook, but does not destroy the window. .. seealso:: :meth:`DeletePage` .. method:: RemoveTabAreaButton(self, id) Removes a button from the tab area. :param integer `id`: the button identifier. .. seealso:: :meth:`AddTabAreaButton` for a list of button identifiers. .. method:: ReparentControl(self, control, dest_tabs) Reparents a control added inside a tab. :param wx.Window `control`: almost any :class:`wx.Window` -derived instance to be located inside a tab; :param `dest_tabs`: the destination :class:`AuiTabCtrl`. .. method:: ResetTextControl(self) Called by :class:`TabTextCtrl` when it marks itself for deletion. .. method:: SavePerspective(self) Saves the entire user interface layout into an encoded string, which can then be stored by the application (probably using :class:`Config `). When a perspective is restored using :meth:`LoadPerspective`, the entire user interface will return to the state it was when the perspective was saved. .. method:: SetAGWWindowStyleFlag(self, agwStyle) Sets the AGW-specific style of the window. :param integer `agwStyle`: the new window style. This can be a combination of the following bits: ==================================== ================================== 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 ==================================== ================================== .. note:: Please note that some styles cannot be changed after the window creation and that `Refresh` might need to be be called after changing the others for the change to take place immediately. .. todo:: Implementation of flags ``AUI_NB_RIGHT`` and ``AUI_NB_LEFT``. .. method:: SetArtProvider(self, art) Sets the art provider to be used by the notebook. :param `art`: an art provider. .. method:: SetCloseButton(self, page_idx, hasCloseButton) Sets whether a tab should display a close button or not. :param integer `page_idx`: the page index; :param bool `hasCloseButton`: ``True`` if the page displays a close button. .. note:: This can only be called if ``AUI_NB_CLOSE_ON_ALL_TABS`` is specified. .. method:: SetFont(self, font) Sets the tab font. :param wx.Font `font`: the new font to use to draw tab labels in their normal, un-selected state. .. note:: Overridden from :class:`Panel`. .. method:: SetImageList(self, imageList) Sets the image list for the :class:`AuiNotebook` control. :param wx.ImageList `imageList`: the bitmap image list to associate to :class:`AuiNotebook`. .. 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:: SetMinMaxTabWidth(self, minTabWidth, maxTabWidth) Sets the minimum and/or the maximum tab widths for :class:`AuiNotebook` when the ``AUI_NB_TAB_FIXED_WIDTH`` style is defined. Pass -1 to either `minTabWidth` or `maxTabWidth` to reset to the default tab width behaviour for :class:`AuiNotebook`. :param integer `minTabWidth`: the minimum allowed tab width, in pixels; :param integer `maxTabWidth`: the maximum allowed tab width, in pixels. .. note:: Minimum and maximum tabs widths are used only when the ``AUI_NB_TAB_FIXED_WIDTH`` style is present. .. method:: SetNavigatorIcon(self, bmp) Sets the icon used by the :class:`TabNavigatorWindow`. :param wx.Bitmap `bmp`: the new bitmap for the :class:`TabNavigatorWindow`. .. 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:: SetPageBitmap(self, page_idx, bitmap) Sets the tab bitmap for the page. :param integer `page_idx`: the page index; :param wx.Bitmap `bitmap`: the bitmap to display on the page tab. .. method:: SetPageImage(self, page, image) Sets the image index for the given page. :param integer `page`: the page index; :param integer `image`: an index into the image list which was set with :meth:`SetImageList`. .. method:: SetPageText(self, page_idx, text) Sets the tab label for the page. :param integer `page_idx`: the page index; :param string `text`: the new tab label. .. method:: SetPageTextColour(self, page_idx, colour) Sets the tab text colour for the page. :param integer `page_idx`: the page index; :param wx.Colour `colour`: the new tab label text colour. .. method:: SetPageTooltip(self, page_idx, tooltip) Sets the tab tooltip for the page. :param integer `page_idx`: the page index; :param string `tooltip`: the new tooltip. :returns: ``True`` if the page tooltip has been set, ``False`` otherwise (for example when the input `page_idx` is greater than the number of pages in the notebook. .. method:: SetRenamable(self, page_idx, renamable) Sets whether a tab can be renamed via a left double-click or not. :param integer `page_idx`: the page index; :param bool `renamable`: ``True`` if the page can be renamed. .. method:: SetSashDClickUnsplit(self, unsplit=True) Sets whether to unsplit a splitted :class:`AuiNotebook` when double-clicking on a sash. :param bool `unsplit`: ``True`` to unsplit on sash double-clicking, ``False`` otherwise. .. 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:: SetSelection(self, new_page, force=False) Sets the page selection. Calling this method will generate a page change event. :param integer `new_page`: the index of the new selection; :param bool `force`: whether to force the selection or not. .. method:: SetSelectionToPage(self, page) Sets the selection based on the input page. :param `page`: an instance of :class:`AuiNotebookPage`. .. method:: SetSelectionToWindow(self, win) Sets the selection based on the input window `win`. :param `win`: a :class:`wx.Window` derived window. .. method:: SetTabCtrlHeight(self, height) Sets the tab height. By default, the tab control height is calculated by measuring the text height and bitmap sizes on the tab captions. Calling this method will override that calculation and set the tab control to the specified height parameter. A call to this method will override any call to :meth:`SetUniformBitmapSize`. Specifying -1 as the height will return the control to its default auto-sizing behaviour. :param integer `height`: the tab control area height. .. method:: SetUniformBitmapSize(self, size) Ensures that all tabs will have the same height, even if some tabs don't have bitmaps. Passing ``wx.DefaultSize`` to this method will instruct the control to use dynamic tab height, which is the default behaviour. Under the default behaviour, when a tab with a large bitmap is added, the tab control's height will automatically increase to accommodate the larger bitmap. :param wx.Size `size`: the tab bitmap size. .. method:: ShowWindowMenu(self) Shows the window menu for the active tab control associated with this notebook, and returns ``True`` if a selection was made. .. method:: Split(self, page, direction) Performs a split operation programmatically. :param integer `page`: indicates the page that will be split off. This page will also become the active page after the split. :param integer `direction`: specifies where the pane should go, it should be one of the following: ``wx.TOP``, ``wx.BOTTOM``, ``wx.LEFT``, or ``wx.RIGHT``. .. method:: UnSplit(self) Restores original view after a tab split. .. method:: UnsplitDClick(self, part, sash_size, pos) Unsplit the :class:`AuiNotebook` on sash double-click. :param `part`: an UI part representing the sash; :param integer `sash_size`: the sash size; :param wx.Point `pos`: the double-click mouse position. .. warning:: Due to a bug on MSW, for disabled pages :func:`FindWindowAtPoint` returns the wrong window. See http://trac.wxwidgets.org/ticket/2942 .. method:: UpdateHintWindowSize(self) Updates the :class:`~wx.lib.agw.aui.framemanager.AuiManager` hint window size. .. method:: UpdateTabCtrlHeight(self, force=False) :meth:`UpdateTabCtrlHeight` does the actual tab resizing. It's meant to be used interally. :param bool `force`: ``True`` to force the tab art to repaint.