auibook.AuiTabContainer

Inheritance diagram for AuiTabContainer:


digraph inheritance39d883fcba {
rankdir=LR;
size="8.0, 12.0";
  "auibook.AuiTabContainer" [style="setlinewidth(0.5)",URL="#auibook.AuiTabContainer",fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,height=0.25,shape=box,fontsize=10];
}


Description

AuiTabContainer is a class which contains information about each tab. It also can render an entire tab control to a specified DC. It’s not a window class itself, because this code will be used by the AuiManager, where it is disadvantageous to have separate windows for each tab control in the case of “docked tabs”.

A derived class, AuiTabCtrl, is an actual wx.Window-derived window which can be used as a tab control in the normal sense.

Class API

Methods

class AuiTabContainer

Bases: object

AuiTabContainer is a class which contains information about each tab. It also can render an entire tab control to a specified DC. It’s not a window class itself, because this code will be used by the AuiManager, where it is disadvantageous to have separate windows for each tab control in the case of “docked tabs”.

A derived class, AuiTabCtrl, is an actual wx.Window-derived window which can be used as a tab control in the normal sense.

__init__()
Default class constructor. Used internally, do not call it in your code!
AddButton(id, location, normal_bitmap=<wx._gdi.Bitmap; proxy of <Swig Object of type 'wxBitmap *' at 0x3045078> >, disabled_bitmap=<wx._gdi.Bitmap; proxy of <Swig Object of type 'wxBitmap *' at 0x3045078> >)

Adds a button in the tab area.

Parameter: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
Parameters:
  • 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.
AddPage(page, info)

Adds a page to the tab control.

Parameters:
  • page – the window associated with this tab;
  • info – an instance of L{AuiNotebookPage}.
ButtonHitTest(x, y)

ButtonHitTest() tests if a button was hit.

Parameters:
  • x – the mouse x position;
  • y – the mouse y position.
DoShowHide()
This function shows the active window, then hides all of the other windows (in that order).
EnableTab(idx, enable=True)

Enables/disables a tab in the L{AuiTabContainer}.

Parameters:
  • idx – the tab index;
  • enable – True to enable a tab, False to disable it.
GetActivePage()
Returns the current selected tab or wx.NOT_FOUND if none is selected.
GetArtProvider()
Returns the current art provider being used.
GetEnabled(idx)

Returns whether a tab is enabled or not.

Parameter:idx – the tab index.
GetFlags()

Returns the tab art flags.

See L{SetFlags} for a list of possible return values.

GetIdxFromWindow(wnd)

Returns the tab index based on the window wnd associated with it.

Parameter:wnd – an instance of wx.Window.
GetPage(idx)

Returns the page specified by the given index.

Parameter:idx – the tab index.
GetPageCount()
Returns the number of pages in the L{AuiTabContainer}.
GetPages()
Returns a list of all the pages in this L{AuiTabContainer}.
GetTabOffset()
Returns the tab offset.
GetWindowFromIdx(idx)

Returns the window associated with the tab with index idx.

Parameter:idx – the tab index.
InsertPage(page, info, idx)

Inserts a page in the tab control in the position specified by idx.

Parameters:
  • page – the window associated with this tab;
  • info – an instance of L{AuiNotebookPage};
  • idx – the page insertion index.
IsTabVisible(tabPage, tabOffset, dc, wnd)

Returns whether a tab is visible or not.

Parameters:
  • tabPage – the tab index;
  • tabOffset – the tab offset;
  • dc – a L{wx.DC} device context;
  • wnd – an instance of wx.Window derived window.
MakeTabVisible(tabPage, win)

Make the tab visible if it wasn’t already.

Parameters:
  • tabPage – the tab index;
  • win – an instance of wx.Window derived window.
MovePage(page, new_idx)

Moves a page in a new position specified by new_idx.

Parameters:
  • page – the window associated with this tab;
  • new_idx – the new page position.
RemoveButton(id)

Removes a button from the tab area.

Parameter:id – the button identifier. See L{AddButton} for a list of button identifiers.
RemovePage(wnd)

Removes a page from the tab control.

Parameter:wnd – an instance of wx.Window, a window associated with this tab.
Render(raw_dc, wnd)

Render() renders the tab catalog to the specified DC. It is a virtual function and can be overridden to provide custom drawing capabilities.

Parameters:
  • raw_dc – a L{wx.DC} device context;
  • wnd – an instance of wx.Window derived window.
SetActivePage(wndOrInt)

Sets the L{AuiTabContainer} active page.

Parameter:wndOrInt – an instance of wx.Window or an integer specifying a tab index.
SetArtProvider(art)

Instructs L{AuiTabContainer} to use art provider specified by parameter art for all drawing calls. This allows plugable look-and-feel features. The previous art provider object, if any, will be deleted by L{AuiTabContainer}.

Parameter:art – an art provider.
SetFlags(flags)

Sets the tab art flags.

Parameter:flags – a combination of the following values:
Flag name Description
AUI_NB_TOP With this style, tabs are drawn along the top of the notebook
AUI_NB_LEFT With this style, tabs are drawn along the left of the notebook. Not implemented yet.
AUI_NB_RIGHT With this style, tabs are drawn along the right of the notebook. Not implemented yet.
AUI_NB_BOTTOM With this style, tabs are drawn along the bottom of the notebook. Not implemented for the Chrome tab art.
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
SetMeasuringFont(font)

Sets the font for calculating text measurements.

Parameter:font – a wx.Font object.
SetNoneActive()
Sets all the tabs as incative (non-selected).
SetNormalFont(font)

Sets the normal font for drawing tab labels.

Parameter:font – a wx.Font object.
SetSelectedFont(font)

Sets the selected tab font for drawing tab labels.

Parameter:font – a wx.Font object.
SetTabOffset(offset)

Sets the tab offset.

Parameter:offset – the tab offset.
SetTabRect(rect)

Sets the tab area rectangle.

Parameter:rect – an instance of wx.Rect, specifying the available area for L{AuiTabContainer}.
TabHitTest(x, y)

TabHitTest() tests if a tab was hit, passing the window pointer back if that condition was fulfilled.

Parameters:
  • x – the mouse x position;
  • y – the mouse y position.

Table Of Contents

This Page