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.
__init__ | Default class constructor. |
AddControlToPage | Adds a control inside a tab (not in the tab area). |
AddPage | Adds a page. |
AddTabAreaButton | Adds a button in the tab area. |
AdvanceSelection | Cycles through the tabs. |
AssignImageList | Sets the image list for the AuiNotebook control. |
CalculateNewSplitSize | Calculates the size of the new split. |
CalculateTabCtrlHeight | Calculates the tab control area height. |
CloneTabAreaButtons | Clones the tab area buttons when the AuiNotebook is being split. |
DeletePage | Deletes a page at the given index. |
Destroy | Destroys the window safely. |
DoSizing | Performs all sizing operations in each tab control. |
EditTab | Starts the editing of an item label, sending a EVT_AUINOTEBOOK_BEGIN_LABEL_EDIT event. |
EnableTab | Enables/disables a page in the notebook. |
EnsureVisible | Ensures the input page index indx is visible. |
FindNextActiveTab | Finds the next active tab (used mainly when AuiNotebook has inactive/disabled |
FindTab | Finds the tab control that currently contains the window as well as the index of the window in the tab control. |
FloatPage | Float the page in page_index by reparenting it to a floating frame. |
GetAGWWindowStyleFlag | Returns the AGW-specific style of the window. |
GetActiveTabCtrl | Returns the active tab control. |
GetArtProvider | Returns the associated art provider. |
GetAuiManager | Returns the associated AuiManager. |
GetCurrentPage | Returns the currently active page (not the index), or None if none was selected. |
GetDefaultBorder | Returns the default border style for AuiNotebook. |
GetEnabled | Returns whether the page specified by the index page_idx is enabled. |
GetHeightForPageHeight | Gets the height of the notebook for a given page height. |
GetImageList | Returns the associated image list (if any). |
GetMinMaxTabWidth | Returns the minimum and the maximum tab widths for AuiNotebook when the |
GetPage | Returns the page specified by the given index. |
GetPageBitmap | Returns the tab bitmap for the page. |
GetPageCount | Returns the number of pages in the notebook. |
GetPageImage | Returns the image index for the given page. |
GetPageIndex | Returns the page index for the specified window. |
GetPageInfo | Returns the AuiNotebookPage info structure specified by the given index. |
GetPageText | Returns the tab label for the page. |
GetPageTextColour | Returns the tab text colour for the page. |
GetSashDClickUnsplit | Returns whether a splitted AuiNotebook can be unsplitted by double-clicking |
GetSelection | Returns the index of the currently active page, or -1 if none was selected. |
GetTabContainer | Returns the instance of AuiTabContainer. |
GetTabCtrlFromPoint | Returns the tab control at the specified point. |
GetTabCtrlHeight | Returns the tab control height. |
GetTabFrameFromTabCtrl | Returns the tab frame associated with a tab control. |
GetTabFrameFromWindow | Returns the tab frame associated with a window. |
HasCloseButton | Returns whether a tab displays a close button or not. |
HasMultiplePages | This method should be overridden to return True if this window has multiple pages. All |
HideAllTabs | Hides all tabs on the AuiNotebook control. |
InitNotebook | Contains common initialization code called by all constructors. |
InsertPage | This is similar to AddPage, but allows the ability to specify the insert location. |
IsMouseWellOutsideWindow | Returns whether the mouse is well outside the AuiNotebook screen rectangle. |
IsRenamable | Returns whether a tab can be renamed or not. |
LoadPerspective | Loads a layout which was saved with SavePerspective. |
NotebookPreview | Generates a preview of all the pages in the notebook (MSW and GTK only). |
OnChildFocusNotebook | Handles the wx.EVT_CHILD_FOCUS event for AuiNotebook. |
OnCloseFloatingPage | Handles the wx.EVT_CLOSE event for a floating page in AuiNotebook. |
OnNavigationKeyNotebook | Handles the wx.EVT_NAVIGATION_KEY event for AuiNotebook. |
OnRenameAccept | Called by TabTextCtrl, to accept the changes and to send the |
OnRenameCancelled | Called by TabTextCtrl, to cancel the changes and to send the |
OnSize | Handles the wx.EVT_SIZE event for AuiNotebook. |
OnTabBeginDrag | Handles the EVT_AUINOTEBOOK_BEGIN_DRAG event for AuiNotebook. |
OnTabBgDClick | Handles the EVT_AUINOTEBOOK_BG_DCLICK event for AuiNotebook. |
OnTabButton | Handles the EVT_AUINOTEBOOK_BUTTON event for AuiNotebook. |
OnTabCancelDrag | Handles the EVT_AUINOTEBOOK_CANCEL_DRAG event for AuiNotebook. |
OnTabClicked | Handles the EVT_AUINOTEBOOK_PAGE_CHANGING event for AuiNotebook. |
OnTabDClick | Handles the EVT_AUINOTEBOOK_TAB_DCLICK event for AuiNotebook. |
OnTabDragMotion | Handles the EVT_AUINOTEBOOK_DRAG_MOTION event for AuiNotebook. |
OnTabEndDrag | Handles the EVT_AUINOTEBOOK_END_DRAG event for AuiNotebook. |
OnTabMiddleDown | Handles the EVT_AUINOTEBOOK_TAB_MIDDLE_DOWN event for AuiNotebook. |
OnTabMiddleUp | Handles the EVT_AUINOTEBOOK_TAB_MIDDLE_UP event for AuiNotebook. |
OnTabRightDown | Handles the EVT_AUINOTEBOOK_TAB_RIGHT_DOWN event for AuiNotebook. |
OnTabRightUp | Handles the EVT_AUINOTEBOOK_TAB_RIGHT_UP event for AuiNotebook. |
ReDockPage | Re-docks a floating AuiNotebook tab in the original position, when possible. |
RemoveControlFromPage | Removes a control from a tab (not from the tab area). |
RemoveEmptyTabFrames | Removes all the empty tab frames. |
RemovePage | Removes a page, without deleting the window pointer. |
RemoveTabAreaButton | Removes a button from the tab area. |
ReparentControl | Reparents a control added inside a tab. |
ResetTextControl | Called by TabTextCtrl when it marks itself for deletion. |
SavePerspective | Saves the entire user interface layout into an encoded string, which can then |
SetAGWWindowStyleFlag | Sets the AGW-specific style of the window. |
SetArtProvider | Sets the art provider to be used by the notebook. |
SetCloseButton | Sets whether a tab should display a close button or not. |
SetFont | Sets the tab font. |
SetImageList | Sets the image list for the AuiNotebook control. |
SetMeasuringFont | Sets the font for calculating text measurements. |
SetMinMaxTabWidth | Sets the minimum and/or the maximum tab widths for AuiNotebook when the |
SetNavigatorIcon | Sets the icon used by the TabNavigatorWindow. |
SetNormalFont | Sets the normal font for drawing tab labels. |
SetPageBitmap | Sets the tab bitmap for the page. |
SetPageImage | Sets the image index for the given page. |
SetPageText | Sets the tab label for the page. |
SetPageTextColour | Sets the tab text colour for the page. |
SetRenamable | Sets whether a tab can be renamed via a left double-click or not. |
SetSashDClickUnsplit | Sets whether to unsplit a splitted AuiNotebook when double-clicking on a sash. |
SetSelectedFont | Sets the selected tab font for drawing tab labels. |
SetSelection | Sets the page selection. |
SetSelectionToPage | Sets the selection based on the input page. |
SetSelectionToWindow | Sets the selection based on the input window win. |
SetTabCtrlHeight | Sets the tab height. |
SetUniformBitmapSize | Ensures that all tabs will have the same height, even if some tabs don’t have bitmaps. |
ShowWindowMenu | Shows the window menu for the active tab control associated with this |
Split | Performs a split operation programmatically. |
UnSplit | Restores original view after a tab split. |
UnsplitDClick | Unsplit the AuiNotebook on sash double-click. |
UpdateHintWindowSize | Updates the AuiManager hint window size. |
UpdateTabCtrlHeight | UpdateTabCtrlHeight() does the actual tab resizing. It’s meant |
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().
Default class constructor.
Parameters: |
|
---|
Adds a control inside a tab (not in the tab area).
Parameters: |
|
---|
Adds a page. If the select parameter is True, calling this will generate a page change event.
Parameters: |
|
---|
Adds a button in the tab area.
Parameters: |
|
---|
Cycles through the tabs.
Parameters: |
|
---|
Note
The call to this function generates the page changing events.
Sets the image list for the AuiNotebook control.
Parameters: | imageList – an instance of wx.ImageList. |
---|
Clones the tab area buttons when the AuiNotebook is being split.
See also
Note
Standard buttons for AuiNotebook are not cloned, only custom ones.
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
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. |
---|
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. |
---|
Enables/disables a page in the notebook.
Parameters: |
|
---|
Ensures the input page index indx is visible.
Parameters: | indx – the page index. |
---|
Finds the next active tab (used mainly when AuiNotebook has inactive/disabled tabs in it).
Parameters: |
|
---|
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. |
---|
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.
Returns the AGW-specific style of the window.
See also
SetAGWWindowStyleFlag for a list of possible AGW-specific window styles.
Returns the active tab control. It is called to determine which control gets new windows being added.
Returns the associated AuiManager.
Returns the currently active page (not the index), or None if none was selected.
Returns the default border style for AuiNotebook.
Returns whether the page specified by the index page_idx is enabled.
Parameters: | page_idx – the page index. |
---|
Gets the height of the notebook for a given page height.
Parameters: | pageHeight – the given page height. |
---|
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.
Returns the page specified by the given index.
Parameters: | page_idx – the page index. |
---|
Returns the tab bitmap for the page.
Parameters: | page_idx – the page index. |
---|
Returns the image index for the given page.
Parameters: | page – the given page for which to retrieve the image index. |
---|
Returns the page index for the specified window. If the window is not found in the notebook, wx.NOT_FOUND is returned.
Returns the AuiNotebookPage info structure specified by the given index.
Parameters: | page_idx – the page index. |
---|
Returns the tab label for the page.
Parameters: | page_idx – the page index. |
---|
Returns the tab text colour for the page.
Parameters: | page_idx – the page index. |
---|
Returns whether a splitted AuiNotebook can be unsplitted by double-clicking on the splitter sash.
Returns the instance of AuiTabContainer.
Returns the tab control at the specified point.
Parameters: | pt – a wx.Point object. |
---|
Returns the tab frame associated with a tab control.
Parameters: | tab_ctrl – an instance of AuiTabCtrl. |
---|
Returns the tab frame associated with a window.
Parameters: | wnd – an instance of wx.Window. |
---|
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.
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.
Hides all tabs on the AuiNotebook control.
Parameters: | hidden – if True hides all tabs. |
---|
Contains common initialization code called by all constructors.
Parameters: | agwStyle – the notebook style. |
---|
See also
This is similar to AddPage, but allows the ability to specify the insert location.
Parameters: |
|
---|
Returns whether the mouse is well outside the AuiNotebook screen rectangle.
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. |
Loads a layout which was saved with SavePerspective.
Parameters: | layout – a string which contains a saved AuiNotebook layout. |
---|
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.
Handles the wx.EVT_CHILD_FOCUS event for AuiNotebook.
Parameters: | event – a wx.ChildFocusEvent event to be processed. |
---|
Handles the wx.EVT_CLOSE event for a floating page in AuiNotebook.
Parameters: | event – a wx.CloseEvent event to be processed. |
---|
Handles the wx.EVT_NAVIGATION_KEY event for AuiNotebook.
Parameters: | event – a wx.NavigationKeyEvent event to be processed. |
---|
Called by TabTextCtrl, to accept the changes and to send the EVT_AUINOTEBOOK_END_LABEL_EDIT event.
Parameters: |
|
---|
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. |
---|
Handles the wx.EVT_SIZE event for AuiNotebook.
Parameters: | event – a wx.SizeEvent event to be processed. |
---|
Handles the EVT_AUINOTEBOOK_BEGIN_DRAG event for AuiNotebook.
Parameters: | event – a AuiNotebookEvent event to be processed. |
---|
Handles the EVT_AUINOTEBOOK_BG_DCLICK event for AuiNotebook.
Parameters: | event – a AuiNotebookEvent event to be processed. |
---|
Handles the EVT_AUINOTEBOOK_BUTTON event for AuiNotebook.
Parameters: | event – a AuiNotebookEvent event to be processed. |
---|
Handles the EVT_AUINOTEBOOK_CANCEL_DRAG event for AuiNotebook.
Parameters: | event – a AuiNotebookEvent event to be processed. |
---|
Handles the EVT_AUINOTEBOOK_PAGE_CHANGING event for AuiNotebook.
Parameters: | event – a AuiNotebookEvent event to be processed. |
---|
Handles the EVT_AUINOTEBOOK_TAB_DCLICK event for AuiNotebook.
Parameters: | event – a AuiNotebookEvent event to be processed. |
---|
Handles the EVT_AUINOTEBOOK_DRAG_MOTION event for AuiNotebook.
Parameters: | event – a AuiNotebookEvent event to be processed. |
---|
Handles the EVT_AUINOTEBOOK_END_DRAG event for AuiNotebook.
Parameters: | event – a AuiNotebookEvent event to be processed. |
---|
Handles the EVT_AUINOTEBOOK_TAB_MIDDLE_DOWN event for AuiNotebook.
Parameters: | event – a AuiNotebookEvent event to be processed. |
---|
Handles the EVT_AUINOTEBOOK_TAB_MIDDLE_UP event for AuiNotebook.
Parameters: | event – a AuiNotebookEvent event to be processed. |
---|
Handles the EVT_AUINOTEBOOK_TAB_RIGHT_DOWN event for AuiNotebook.
Parameters: | event – a AuiNotebookEvent event to be processed. |
---|
Handles the EVT_AUINOTEBOOK_TAB_RIGHT_UP event for AuiNotebook.
Parameters: | event – a AuiNotebookEvent event to be processed. |
---|
Re-docks a floating AuiNotebook tab in the original position, when possible.
Parameters: | pane – an instance of AuiPaneInfo. |
---|
Removes a control from a tab (not from the tab area).
Parameters: | page_idx – the page index. |
---|
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
Removes a button from the tab area.
Parameters: | id – the button identifier. See AddTabAreaButton for a list of button identifiers. |
---|
See also
Reparents a control added inside a tab.
Parameters: |
|
---|
Called by TabTextCtrl when it marks itself for deletion.
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.
Sets the AGW-specific style of the window.
Parameters: | agwStyle – the new window style. This can be a combination of the following bits:
|
---|
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.
Sets the art provider to be used by the notebook.
Parameters: | art – an art provider. |
---|
Sets whether a tab should display a close button or not.
Parameters: |
|
---|
Note
This can only be called if AUI_NB_CLOSE_ON_ALL_TABS is specified.
Sets the tab font.
Parameters: | font – a wx.Font object. |
---|
Note
Overridden from wx.PyPanel.
Sets the image list for the AuiNotebook control.
Parameters: | imageList – an instance of wx.ImageList. |
---|
Sets the font for calculating text measurements.
Parameters: | font – a wx.Font object. |
---|
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: |
|
---|
Note
Minimum and maximum tabs widths are used only when the AUI_NB_TAB_FIXED_WIDTH style is present.
Sets the icon used by the TabNavigatorWindow.
Parameters: | bmp – an instance of wx.Bitmap. |
---|
Sets the normal font for drawing tab labels.
Parameters: | font – a wx.Font object. |
---|
Sets the tab bitmap for the page.
Parameters: |
|
---|
Sets the image index for the given page.
Parameters: |
|
---|
Sets the tab label for the page.
Parameters: |
|
---|
Sets the tab text colour for the page.
Parameters: |
|
---|
Sets whether a tab can be renamed via a left double-click or not.
Parameters: |
|
---|
Sets whether to unsplit a splitted AuiNotebook when double-clicking on a sash.
Parameters: | unsplit – True to unsplit on sash double-clicking, False otherwise. |
---|
Sets the selected tab font for drawing tab labels.
Parameters: | font – a wx.Font object. |
---|
Sets the page selection. Calling this method will generate a page change event.
Parameters: |
|
---|
Sets the selection based on the input page.
Parameters: | page – an instance of AuiNotebookPage. |
---|
Sets the selection based on the input window win.
Parameters: | win – a wx.Window derived window. |
---|
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. |
---|
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. |
---|
Shows the window menu for the active tab control associated with this notebook, and returns True if a selection was made.
Performs a split operation programmatically.
Parameters: |
|
---|
Unsplit the AuiNotebook on sash double-click.
Parameters: |
|
---|
Warning
Due to a bug on MSW, for disabled pages wx.FindWindowAtPoint returns the wrong window. See http://trac.wxwidgets.org/ticket/2942
Updates the AuiManager hint window size.