AGW Logo

agw_title 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 wx.Notebook.

The default theme that is used is AuiDefaultTabArt, which provides a modern, glossy look and feel. The theme can be changed by calling SetArtProvider.

hierarchy Inheritance Diagram

Inheritance diagram for: AuiNotebook

Inheritance diagram of AuiNotebook


subclasses Known Subclasses

  • aui.tabmdi.AuiMDIClientWindow

appearance Control Appearance


AuiNotebook

AuiNotebook


method_summary Methods Summary

__init__Default class constructor.
AddControlToPageAdds a control inside a tab (not in the tab area).
AddPageAdds a page.
AddTabAreaButtonAdds a button in the tab area.
AdvanceSelectionCycles through the tabs.
AssignImageListSets the image list for the AuiNotebook control.
CalculateNewSplitSizeCalculates the size of the new split.
CalculateTabCtrlHeightCalculates the tab control area height.
CloneTabAreaButtonsClones the tab area buttons when the AuiNotebook is being split.
DeletePageDeletes a page at the given index.
DestroyDestroys the window safely.
DoSizingPerforms all sizing operations in each tab control.
EditTabStarts the editing of an item label, sending a EVT_AUINOTEBOOK_BEGIN_LABEL_EDIT event.
EnableTabEnables/disables a page in the notebook.
EnsureVisibleEnsures the input page index indx is visible.
FindNextActiveTabFinds the next active tab (used mainly when AuiNotebook has inactive/disabled
FindTabFinds the tab control that currently contains the window as well as the index of the window in the tab control.
FloatPageFloat the page in page_index by reparenting it to a floating frame.
GetAGWWindowStyleFlagReturns the AGW-specific style of the window.
GetActiveTabCtrlReturns the active tab control.
GetArtProviderReturns the associated art provider.
GetAuiManagerReturns the associated AuiManager.
GetCurrentPageReturns the currently active page (not the index), or None if none was selected.
GetDefaultBorderReturns the default border style for AuiNotebook.
GetEnabledReturns whether the page specified by the index page_idx is enabled.
GetHeightForPageHeightGets the height of the notebook for a given page height.
GetImageListReturns the associated image list (if any).
GetMinMaxTabWidthReturns the minimum and the maximum tab widths for AuiNotebook when the
GetPageReturns the page specified by the given index.
GetPageBitmapReturns the tab bitmap for the page.
GetPageCountReturns the number of pages in the notebook.
GetPageImageReturns the image index for the given page.
GetPageIndexReturns the page index for the specified window.
GetPageInfoReturns the AuiNotebookPage info structure specified by the given index.
GetPageTextReturns the tab label for the page.
GetPageTextColourReturns the tab text colour for the page.
GetSashDClickUnsplitReturns whether a splitted AuiNotebook can be unsplitted by double-clicking
GetSelectionReturns the index of the currently active page, or -1 if none was selected.
GetTabContainerReturns the instance of AuiTabContainer.
GetTabCtrlFromPointReturns the tab control at the specified point.
GetTabCtrlHeightReturns the tab control height.
GetTabFrameFromTabCtrlReturns the tab frame associated with a tab control.
GetTabFrameFromWindowReturns the tab frame associated with a window.
HasCloseButtonReturns whether a tab displays a close button or not.
HasMultiplePagesThis method should be overridden to return True if this window has multiple pages. All
HideAllTabsHides all tabs on the AuiNotebook control.
InitNotebookContains common initialization code called by all constructors.
InsertPageThis is similar to AddPage, but allows the ability to specify the insert location.
IsMouseWellOutsideWindowReturns whether the mouse is well outside the AuiNotebook screen rectangle.
IsRenamableReturns whether a tab can be renamed or not.
LoadPerspectiveLoads a layout which was saved with SavePerspective.
NotebookPreviewGenerates a preview of all the pages in the notebook (MSW and GTK only).
OnChildFocusNotebookHandles the wx.EVT_CHILD_FOCUS event for AuiNotebook.
OnCloseFloatingPageHandles the wx.EVT_CLOSE event for a floating page in AuiNotebook.
OnNavigationKeyNotebookHandles the wx.EVT_NAVIGATION_KEY event for AuiNotebook.
OnRenameAcceptCalled by TabTextCtrl, to accept the changes and to send the
OnRenameCancelledCalled by TabTextCtrl, to cancel the changes and to send the
OnSizeHandles the wx.EVT_SIZE event for AuiNotebook.
OnTabBeginDragHandles the EVT_AUINOTEBOOK_BEGIN_DRAG event for AuiNotebook.
OnTabBgDClickHandles the EVT_AUINOTEBOOK_BG_DCLICK event for AuiNotebook.
OnTabButtonHandles the EVT_AUINOTEBOOK_BUTTON event for AuiNotebook.
OnTabCancelDragHandles the EVT_AUINOTEBOOK_CANCEL_DRAG event for AuiNotebook.
OnTabClickedHandles the EVT_AUINOTEBOOK_PAGE_CHANGING event for AuiNotebook.
OnTabDClickHandles the EVT_AUINOTEBOOK_TAB_DCLICK event for AuiNotebook.
OnTabDragMotionHandles the EVT_AUINOTEBOOK_DRAG_MOTION event for AuiNotebook.
OnTabEndDragHandles the EVT_AUINOTEBOOK_END_DRAG event for AuiNotebook.
OnTabMiddleDownHandles the EVT_AUINOTEBOOK_TAB_MIDDLE_DOWN event for AuiNotebook.
OnTabMiddleUpHandles the EVT_AUINOTEBOOK_TAB_MIDDLE_UP event for AuiNotebook.
OnTabRightDownHandles the EVT_AUINOTEBOOK_TAB_RIGHT_DOWN event for AuiNotebook.
OnTabRightUpHandles the EVT_AUINOTEBOOK_TAB_RIGHT_UP event for AuiNotebook.
ReDockPageRe-docks a floating AuiNotebook tab in the original position, when possible.
RemoveControlFromPageRemoves a control from a tab (not from the tab area).
RemoveEmptyTabFramesRemoves all the empty tab frames.
RemovePageRemoves a page, without deleting the window pointer.
RemoveTabAreaButtonRemoves a button from the tab area.
ReparentControlReparents a control added inside a tab.
ResetTextControlCalled by TabTextCtrl when it marks itself for deletion.
SavePerspectiveSaves the entire user interface layout into an encoded string, which can then
SetAGWWindowStyleFlagSets the AGW-specific style of the window.
SetArtProviderSets the art provider to be used by the notebook.
SetCloseButtonSets whether a tab should display a close button or not.
SetFontSets the tab font.
SetImageListSets the image list for the AuiNotebook control.
SetMeasuringFontSets the font for calculating text measurements.
SetMinMaxTabWidthSets the minimum and/or the maximum tab widths for AuiNotebook when the
SetNavigatorIconSets the icon used by the TabNavigatorWindow.
SetNormalFontSets the normal font for drawing tab labels.
SetPageBitmapSets the tab bitmap for the page.
SetPageImageSets the image index for the given page.
SetPageTextSets the tab label for the page.
SetPageTextColourSets the tab text colour for the page.
SetRenamableSets whether a tab can be renamed via a left double-click or not.
SetSashDClickUnsplitSets whether to unsplit a splitted AuiNotebook when double-clicking on a sash.
SetSelectedFontSets the selected tab font for drawing tab labels.
SetSelectionSets the page selection.
SetSelectionToPageSets the selection based on the input page.
SetSelectionToWindowSets the selection based on the input window win.
SetTabCtrlHeightSets the tab height.
SetUniformBitmapSizeEnsures that all tabs will have the same height, even if some tabs don’t have bitmaps.
ShowWindowMenuShows the window menu for the active tab control associated with this
SplitPerforms a split operation programmatically.
UnSplitRestores original view after a tab split.
UnsplitDClickUnsplit the AuiNotebook on sash double-click.
UpdateHintWindowSizeUpdates the AuiManager hint window size.
UpdateTabCtrlHeightUpdateTabCtrlHeight() does the actual tab resizing. It’s meant

API Class API

class AuiNotebook(wx.PyPanel)[source]

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 wx.Notebook.

The default theme that is used is AuiDefaultTabArt, which provides a modern, glossy look and feel. The theme can be changed by calling AuiNotebook.SetArtProvider().



__init__(parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, agwStyle=AUI_NB_DEFAULT_STYLE, name="AuiNotebook")[source]

Default class constructor.

Parameters:
  • parent – the AuiNotebook parent;
  • id – an identifier for the control: a value of -1 is taken to mean a default;
  • pos – the control position. A value of (-1, -1) indicates a default position, chosen by either the windowing system or wxPython, depending on platform;
  • size – the control size. A value of (-1, -1) indicates a default size, chosen by either the windowing system or wxPython, depending on platform;
  • style – the underlying wx.PyPanel window style;
  • 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 AuiNotebook tabs by mouse middle button click
    AUI_NB_SUB_NOTEBOOK This style is used by 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

  • name – the window name.


AddControlToPage(page_idx, control)[source]

Adds a control inside a tab (not in the tab area).

Parameters:
  • page_idx – the page index;
  • control – an instance of wx.Window.


AddPage(page, caption, select=False, bitmap=wx.NullBitmap, disabled_bitmap=wx.NullBitmap, control=None)[source]

Adds a page. If the select parameter is True, calling this will generate a page change event.

Parameters:
  • page – the page to be added;
  • caption – specifies the text for the new page;
  • select – specifies whether the page should be selected;
  • bitmap – the wx.Bitmap to display in the enabled tab;
  • disabled_bitmap – the wx.Bitmap to display in the disabled tab;

  • control – a wx.Window instance inside a tab (or None).



AddTabAreaButton(id, location, normal_bitmap=wx.NullBitmap, disabled_bitmap=wx.NullBitmap)[source]

Adds a button in the tab area.

Parameters:
  • 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
  • location – the button location. Can be wx.LEFT or wx.RIGHT;
  • normal_bitmap – the bitmap for an enabled tab;
  • disabled_bitmap – the bitmap for a disabled tab.


AdvanceSelection(forward=True, wrap=True)[source]

Cycles through the tabs.

Parameters:
  • forward – whether to advance forward or backward;
  • wrapTrue to return to the first tab if we reach the last tab.

Note

The call to this function generates the page changing events.



AssignImageList(imageList)[source]

Sets the image list for the AuiNotebook control.

Parameters:imageList – an instance of wx.ImageList.


CalculateNewSplitSize()[source]

Calculates the size of the new split.



CalculateTabCtrlHeight()[source]

Calculates the tab control area height.



CloneTabAreaButtons()[source]

Clones the tab area buttons when the AuiNotebook is being split.

See also

AddTabAreaButton

Note

Standard buttons for AuiNotebook are not cloned, only custom ones.



DeletePage(page_idx)[source]

Deletes a page at the given index. Calling this method will generate a page change event.

Parameters:page_idx – the page index to be deleted.

Note

DeletePage removes a tab from the multi-notebook, and destroys the window as well.

See also

RemovePage



Destroy()[source]

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.

Returns:True if the window has either been successfully deleted, or it has been added to the list of windows pending real deletion.


DoSizing()[source]

Performs all sizing operations in each tab control.



EditTab(page_index)[source]

Starts the editing of an item label, sending a EVT_AUINOTEBOOK_BEGIN_LABEL_EDIT event.

Parameters:page_index – the page index we want to edit.


EnableTab(page_idx, enable=True)[source]

Enables/disables a page in the notebook.

Parameters:
  • page_idx – the page index;
  • enableTrue to enable the page, False to disable it.


EnsureVisible(indx)[source]

Ensures the input page index indx is visible.

Parameters:indx – the page index.


FindNextActiveTab(ctrl_idx, ctrl)[source]

Finds the next active tab (used mainly when AuiNotebook has inactive/disabled tabs in it).

Parameters:
  • ctrl_idx – the index of the first (most obvious) tab to check for active status;
  • ctrl – an instance of AuiTabCtrl.


FindTab(page)[source]

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.

Parameters:page – an instance of AuiNotebookPage.


FloatPage(page_index)[source]

Float the page in page_index by reparenting it to a floating frame.

Parameters: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.



GetAGWWindowStyleFlag()[source]

Returns the AGW-specific style of the window.

See also

SetAGWWindowStyleFlag for a list of possible AGW-specific window styles.



GetActiveTabCtrl()[source]

Returns the active tab control. It is called to determine which control gets new windows being added.



GetArtProvider()[source]

Returns the associated art provider.



GetAuiManager()[source]

Returns the associated AuiManager.



GetCurrentPage()[source]

Returns the currently active page (not the index), or None if none was selected.



GetDefaultBorder()[source]

Returns the default border style for AuiNotebook.



GetEnabled(page_idx)[source]

Returns whether the page specified by the index page_idx is enabled.

Parameters:page_idx – the page index.


GetHeightForPageHeight(pageHeight)[source]

Gets the height of the notebook for a given page height.

Parameters:pageHeight – the given page height.


GetImageList()[source]

Returns the associated image list (if any).



GetMinMaxTabWidth()[source]

Returns the minimum and the maximum tab widths for 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.

See also

SetMinMaxTabWidth for more information.



GetPage(page_idx)[source]

Returns the page specified by the given index.

Parameters:page_idx – the page index.


GetPageBitmap(page_idx)[source]

Returns the tab bitmap for the page.

Parameters:page_idx – the page index.


GetPageCount()[source]

Returns the number of pages in the notebook.



GetPageImage(page)[source]

Returns the image index for the given page.

Parameters:page – the given page for which to retrieve the image index.


GetPageIndex(page_wnd)[source]

Returns the page index for the specified window. If the window is not found in the notebook, wx.NOT_FOUND is returned.



GetPageInfo(page_idx)[source]

Returns the AuiNotebookPage info structure specified by the given index.

Parameters:page_idx – the page index.


GetPageText(page_idx)[source]

Returns the tab label for the page.

Parameters:page_idx – the page index.


GetPageTextColour(page_idx)[source]

Returns the tab text colour for the page.

Parameters:page_idx – the page index.


GetSashDClickUnsplit()[source]

Returns whether a splitted AuiNotebook can be unsplitted by double-clicking on the splitter sash.



GetSelection()[source]

Returns the index of the currently active page, or -1 if none was selected.



GetTabContainer()[source]

Returns the instance of AuiTabContainer.



GetTabCtrlFromPoint(pt)[source]

Returns the tab control at the specified point.

Parameters:pt – a wx.Point object.


GetTabCtrlHeight()[source]

Returns the tab control height.



GetTabFrameFromTabCtrl(tab_ctrl)[source]

Returns the tab frame associated with a tab control.

Parameters:tab_ctrl – an instance of AuiTabCtrl.


GetTabFrameFromWindow(wnd)[source]

Returns the tab frame associated with a window.

Parameters:wnd – an instance of wx.Window.



HasCloseButton(page_idx)[source]

Returns whether a tab displays a close button or not.

Parameters:page_idx – the page index.

Note

This can only be called if AUI_NB_CLOSE_ON_ALL_TABS is specified.



HasMultiplePages()[source]

This method should be overridden to return True if this window has multiple pages. All standard class with multiple pages such as wx.Notebook, wx.Listbook and wx.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 wx.PyPanel.



HideAllTabs(hidden=True)[source]

Hides all tabs on the AuiNotebook control.

Parameters:hidden – if True hides all tabs.


InitNotebook(agwStyle)[source]

Contains common initialization code called by all constructors.

Parameters:agwStyle – the notebook style.

See also

__init__



InsertPage(page_idx, page, caption, select=False, bitmap=wx.NullBitmap, disabled_bitmap=wx.NullBitmap, control=None)[source]

This is similar to AddPage, but allows the ability to specify the insert location.

Parameters:
  • page_idx – specifies the position for the new page;
  • page – the page to be added;
  • caption – specifies the text for the new page;
  • select – specifies whether the page should be selected;
  • bitmap – the wx.Bitmap to display in the enabled tab;

  • disabled_bitmap – the wx.Bitmap to display in the disabled tab;

  • control – a wx.Window instance inside a tab (or None).



IsMouseWellOutsideWindow()[source]

Returns whether the mouse is well outside the AuiNotebook screen rectangle.



IsRenamable(page_idx)[source]

Returns whether a tab can be renamed or not.

Parameters:page_idx – the page index.
Returns:True is a page can be renamed, False otherwise.


LoadPerspective(layout)[source]

Loads a layout which was saved with SavePerspective.

Parameters:layout – a string which contains a saved AuiNotebook layout.


NavigatorProps


NotebookPreview(thumbnail_size=200)[source]

Generates a preview of all the pages in the notebook (MSW and GTK only).

Parameters:thumbnail_size – the maximum size of every page thumbnail.

Note

this functionality is currently unavailable on wxMac.



OnChildFocusNotebook(event)[source]

Handles the wx.EVT_CHILD_FOCUS event for AuiNotebook.

Parameters:event – a wx.ChildFocusEvent event to be processed.


OnCloseFloatingPage(event)[source]

Handles the wx.EVT_CLOSE event for a floating page in AuiNotebook.

Parameters:event – a wx.CloseEvent event to be processed.


OnNavigationKeyNotebook(event)[source]

Handles the wx.EVT_NAVIGATION_KEY event for AuiNotebook.

Parameters:event – a wx.NavigationKeyEvent event to be processed.


OnRenameAccept(page_index, value)[source]

Called by TabTextCtrl, to accept the changes and to send the EVT_AUINOTEBOOK_END_LABEL_EDIT event.

Parameters:
  • page_index – the page index in the notebook;
  • value – the new label for the tab.


OnRenameCancelled(page_index)[source]

Called by TabTextCtrl, to cancel the changes and to send the EVT_AUINOTEBOOK_END_LABEL_EDIT event.

Parameters:page_index – the page index in the notebook.


OnSize(event)[source]

Handles the wx.EVT_SIZE event for AuiNotebook.

Parameters:event – a wx.SizeEvent event to be processed.


OnTabBeginDrag(event)[source]

Handles the EVT_AUINOTEBOOK_BEGIN_DRAG event for AuiNotebook.

Parameters:event – a AuiNotebookEvent event to be processed.


OnTabBgDClick(event)[source]

Handles the EVT_AUINOTEBOOK_BG_DCLICK event for AuiNotebook.

Parameters:event – a AuiNotebookEvent event to be processed.


OnTabButton(event)[source]

Handles the EVT_AUINOTEBOOK_BUTTON event for AuiNotebook.

Parameters:event – a AuiNotebookEvent event to be processed.


OnTabCancelDrag(event)[source]

Handles the EVT_AUINOTEBOOK_CANCEL_DRAG event for AuiNotebook.

Parameters:event – a AuiNotebookEvent event to be processed.


OnTabClicked(event)[source]

Handles the EVT_AUINOTEBOOK_PAGE_CHANGING event for AuiNotebook.

Parameters:event – a AuiNotebookEvent event to be processed.


OnTabDClick(event)[source]

Handles the EVT_AUINOTEBOOK_TAB_DCLICK event for AuiNotebook.

Parameters:event – a AuiNotebookEvent event to be processed.


OnTabDragMotion(event)[source]

Handles the EVT_AUINOTEBOOK_DRAG_MOTION event for AuiNotebook.

Parameters:event – a AuiNotebookEvent event to be processed.


OnTabEndDrag(event)[source]

Handles the EVT_AUINOTEBOOK_END_DRAG event for AuiNotebook.

Parameters:event – a AuiNotebookEvent event to be processed.


OnTabMiddleDown(event)[source]

Handles the EVT_AUINOTEBOOK_TAB_MIDDLE_DOWN event for AuiNotebook.

Parameters:event – a AuiNotebookEvent event to be processed.


OnTabMiddleUp(event)[source]

Handles the EVT_AUINOTEBOOK_TAB_MIDDLE_UP event for AuiNotebook.

Parameters:event – a AuiNotebookEvent event to be processed.


OnTabRightDown(event)[source]

Handles the EVT_AUINOTEBOOK_TAB_RIGHT_DOWN event for AuiNotebook.

Parameters:event – a AuiNotebookEvent event to be processed.


OnTabRightUp(event)[source]

Handles the EVT_AUINOTEBOOK_TAB_RIGHT_UP event for AuiNotebook.

Parameters:event – a AuiNotebookEvent event to be processed.


ReDockPage(pane)[source]

Re-docks a floating AuiNotebook tab in the original position, when possible.

Parameters:pane – an instance of AuiPaneInfo.


RemoveControlFromPage(page_idx)[source]

Removes a control from a tab (not from the tab area).

Parameters:page_idx – the page index.


RemoveEmptyTabFrames()[source]

Removes all the empty tab frames.



RemovePage(page_idx)[source]

Removes a page, without deleting the window pointer.

Parameters:page_idx – the page index to be removed.

Note

RemovePage removes a tab from the multi-notebook, but does not destroy the window.

See also

DeletePage



RemoveTabAreaButton(id)[source]

Removes a button from the tab area.

Parameters:id – the button identifier. See AddTabAreaButton for a list of button identifiers.

See also

AddTabAreaButton



ReparentControl(control, dest_tabs)[source]

Reparents a control added inside a tab.

Parameters:


ResetTextControl()[source]

Called by TabTextCtrl when it marks itself for deletion.



SavePerspective()[source]

Saves the entire user interface layout into an encoded string, which can then be stored by the application (probably using wx.Config). When a perspective is restored using LoadPerspective, the entire user interface will return to the state it was when the perspective was saved.



SetAGWWindowStyleFlag(agwStyle)[source]

Sets the AGW-specific style of the window.

Parameters: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 AuiNotebook tabs by mouse middle button click
AUI_NB_SUB_NOTEBOOK This style is used by 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.



SetArtProvider(art)[source]

Sets the art provider to be used by the notebook.

Parameters:art – an art provider.


SetCloseButton(page_idx, hasCloseButton)[source]

Sets whether a tab should display a close button or not.

Parameters:
  • page_idx – the page index;
  • hasCloseButtonTrue if the page displays a close button.

Note

This can only be called if AUI_NB_CLOSE_ON_ALL_TABS is specified.



SetFont(font)[source]

Sets the tab font.

Parameters:font – a wx.Font object.

Note

Overridden from wx.PyPanel.



SetImageList(imageList)[source]

Sets the image list for the AuiNotebook control.

Parameters:imageList – an instance of wx.ImageList.



SetMeasuringFont(font)[source]

Sets the font for calculating text measurements.

Parameters:font – a wx.Font object.



SetMinMaxTabWidth(minTabWidth, maxTabWidth)[source]

Sets the minimum and/or the maximum tab widths for 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 AuiNotebook.

Parameters:
  • minTabWidth – the minimum allowed tab width, in pixels;
  • 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.



SetNavigatorIcon(bmp)[source]

Sets the icon used by the TabNavigatorWindow.

Parameters:bmp – an instance of wx.Bitmap.



SetNormalFont(font)[source]

Sets the normal font for drawing tab labels.

Parameters:font – a wx.Font object.



SetPageBitmap(page_idx, bitmap)[source]

Sets the tab bitmap for the page.

Parameters:
  • page_idx – the page index;
  • bitmap – an instance of wx.Bitmap.



SetPageImage(page, image)[source]

Sets the image index for the given page.

Parameters:
  • page – the page index;
  • image – an index into the image list which was set with SetImageList.


SetPageText(page_idx, text)[source]

Sets the tab label for the page.

Parameters:
  • page_idx – the page index;
  • text – the new tab label.


SetPageTextColour(page_idx, colour)[source]

Sets the tab text colour for the page.

Parameters:
  • page_idx – the page index;
  • colour – an instance of wx.Colour.


SetRenamable(page_idx, renamable)[source]

Sets whether a tab can be renamed via a left double-click or not.

Parameters:
  • page_idx – the page index;
  • renamableTrue if the page can be renamed.


SetSashDClickUnsplit(unsplit=True)[source]

Sets whether to unsplit a splitted AuiNotebook when double-clicking on a sash.

Parameters:unsplitTrue to unsplit on sash double-clicking, False otherwise.


SetSelectedFont(font)[source]

Sets the selected tab font for drawing tab labels.

Parameters:font – a wx.Font object.



SetSelection(new_page, force=False)[source]

Sets the page selection. Calling this method will generate a page change event.

Parameters:
  • new_page – the index of the new selection;
  • force – whether to force the selection or not.


SetSelectionToPage(page)[source]

Sets the selection based on the input page.

Parameters:page – an instance of AuiNotebookPage.


SetSelectionToWindow(win)[source]

Sets the selection based on the input window win.

Parameters:win – a wx.Window derived window.



SetTabCtrlHeight(height)[source]

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 SetUniformBitmapSize. Specifying -1 as the height will return the control to its default auto-sizing behaviour.

Parameters:height – the tab control area height.


SetUniformBitmapSize(size)[source]

Ensures that all tabs will have the same height, even if some tabs don’t have bitmaps. Passing wx.DefaultSize to this function 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.

Parameters:size – an instance of wx.Size specifying the tab bitmap size.


ShowWindowMenu()[source]

Shows the window menu for the active tab control associated with this notebook, and returns True if a selection was made.



Split(page, direction)[source]

Performs a split operation programmatically.

Parameters:
  • page – indicates the page that will be split off. This page will also become the active page after the split.
  • direction – specifies where the pane should go, it should be one of the following: wx.TOP, wx.BOTTOM, wx.LEFT, or wx.RIGHT.


UnSplit()[source]

Restores original view after a tab split.



UnsplitDClick(part, sash_size, pos)[source]

Unsplit the AuiNotebook on sash double-click.

Parameters:
  • part – an UI part representing the sash;
  • sash_size – the sash size;
  • pos – the double-click mouse position.

Warning

Due to a bug on MSW, for disabled pages wx.FindWindowAtPoint returns the wrong window. See http://trac.wxwidgets.org/ticket/2942



UpdateHintWindowSize()[source]

Updates the AuiManager hint window size.



UpdateTabCtrlHeight(force=False)[source]

UpdateTabCtrlHeight() does the actual tab resizing. It’s meant to be used interally.

Parameters:forceTrue to force the tab art to repaint.
Tree

Table Of Contents

Previous topic

aui.auibook

Next topic

AuiNotebookEvent