Inheritance diagram for wx.aui.AuiNotebook:
wx.aui.AuiNotebook is part of the wxAUI class framework.
wx.aui.AuiNotebook is a notebook control which implements many features common in applications with dockable panes. Specifically, wx.aui.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 wx.aui.AuiDefaultTabArt, which provides a modern, glossy look and feel. The theme can be changed by calling SetArtProvider.
A simple example on how to use wx.aui.AuiNotebook:
class TestPanel(wx.Panel):
""" Simple class example for wx.aui.AuiNotebook. """
def __init__(self, parent):
""" Class constructor. """
wx.Panel.__init__(self, parent, -1)
# Create the wx.aui.AuiNotebook
self.nb = wx.aui.AuiNotebook(self)
# Create a simple text control
page = wx.TextCtrl(self.nb, -1, "Hello World!", style=wx.TE_MULTILINE)
# Add the text control as wx.aui.AuiNotebook page
self.nb.AddPage(page, "Welcome")
# Add some more pages to the wx.aui.AuiNotebook
for num in range(1, 5):
page = wx.TextCtrl(self.nb, -1, "This is page %d" % num, style=wx.TE_MULTILINE)
self.nb.AddPage(page, "Tab Number %d" % num)
# Put the wx.aui.AuiNotebook in a sizer and
# assign the sizer to the main panel
sizer = wx.BoxSizer()
sizer.Add(self.nb, 1, wx.EXPAND)
self.SetSizer(sizer)
# Create a wx.App instance
app = wx.App(0)
# This is our main application frame
frame = wx.Frame(None, -1, "wx.aui.AuiNotebook Sample")
panel = TestPanel(frame)
# Center the frame and show it
frame.CenterOnScreen()
frame.Show()
# Run the MainLoop(), we are done.
app.MainLoop()
wx.aui.AuiMDIClientWindow
Window Style | Description |
---|---|
wx.aui.AUI_NB_DEFAULT_STYLE | Defined as wx.aui.AUI_NB_TOP | wx.aui.AUI_NB_TAB_SPLIT | wx.aui.AUI_NB_TAB_MOVE | wx.aui.AUI_NB_SCROLL_BUTTONS | wx.aui.AUI_NB_CLOSE_ON_ACTIVE_TAB. |
wx.aui.AUI_NB_TAB_SPLIT | Allows the tab control to be split by dragging a tab. |
wx.aui.AUI_NB_TAB_MOVE | Allows a tab to be moved horizontally by dragging. |
wx.aui.AUI_NB_TAB_EXTERNAL_MOVE | Allows a tab to be moved to another tab control. |
wx.aui.AUI_NB_TAB_FIXED_WIDTH | With this style, all tabs have the same width. |
wx.aui.AUI_NB_SCROLL_BUTTONS | With this style, left and right scroll buttons are displayed. |
wx.aui.AUI_NB_WINDOWLIST_BUTTON | With this style, a drop-down list of windows is available. |
wx.aui.AUI_NB_CLOSE_BUTTON | With this style, a close button is available on the tab bar. |
wx.aui.AUI_NB_CLOSE_ON_ACTIVE_TAB | With this style, the close button is visible on the active tab. |
wx.aui.AUI_NB_CLOSE_ON_ALL_TABS | With this style, the close button is visible on all tabs. |
wx.aui.AUI_NB_TOP | With this style, tabs are drawn along the top of the notebook. |
wx.aui.AUI_NB_BOTTOM | With this style, tabs are drawn along the bottom of the notebook. |
Constructor, create a wx.aui.AuiNotebook.
Parameters:
Returns:
Adds a page.
If the select parameter is True, calling this will generate a page change event.
Parameters:
Returns:
bool
See also
Sets the selection to the next or previous page.
Parameters:
Creates the wx.aui.AuiNotebook.
Parameters:
Returns:
bool
Deletes a page at the given index.
Calling this method will generate a page change event.
Parameters:
Returns:
bool
Returns the associated art provider.
Returns:
Returns the desired height of the notebook for the given page height.
Use this to fit the notebook to a given page size.
Parameters:
Returns:
int
Returns the page specified by the given index.
Parameters:
Returns:
Returns the tab bitmap for the page.
Parameters:
Returns:
Returns the number of pages in the notebook.
Returns:
long
Returns the page index for the specified window.
If the window is not found in the notebook, wx.NOT_FOUND is returned.
Parameters:
Returns:
int
Returns the tab label for the page.
Parameters:
Returns:
string
Returns the currently selected page.
Returns:
int
Returns the height of the tab control.
Returns:
int
InsertPage is similar to AddPage, but allows the ability to specify the insert location.
If the select parameter is True, calling this will generate a page change event.
Parameters:
Returns:
bool
See also
Removes a page, without deleting the window pointer.
Parameters:
Returns:
bool
Sets the art provider to be used by the notebook.
Parameters:
Sets the bitmap for the page.
To remove a bitmap from the tab caption, pass wx.NullBitmap.
Parameters:
Returns:
bool
Sets the tab label for the page.
Parameters:
Returns:
bool
Sets the page selection.
Calling this method will generate a page change event.
Parameters:
Returns:
long
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:
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:
Shows the window menu for the active tab control associated with this notebook, and returns True if a selection was made.
Returns:
bool
Split performs a split operation programmatically.
Parameters: