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 AuiNotebook
, 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.
wx.lib.agw.aui.auibook.AuiTabCtrl
Default class constructor. |
|
Adds a button in the tab area. |
|
Adds a page to the tab control. |
|
Tests if a button was hit. |
|
Clones the tab area buttons when the |
|
This function shows the active window, then hides all of the other windows |
|
Enables/disables a tab in the |
|
Finds the next active tab in the |
|
Returns the current selected tab or |
|
Returns the tab art flags. |
|
Returns the current art provider being used. |
|
Returns whether a tab is enabled or not. |
|
Returns whether a tab is hidden or not. |
|
Returns the tab index based on the window wnd associated with it. |
|
Returns the page specified by the given index. |
|
Returns the number of pages in the |
|
Returns a list of all the pages in this |
|
Returns the number of pages shown in the |
|
Returns the tab offset. |
|
Returns the window associated with the tab with index idx. |
|
hides/shows a tab in the |
|
Inserts a page in the tab control in the position specified by idx. |
|
Returns whether a tab is visible or not. |
|
Make the tab visible if it wasn’t already. |
|
Moves a page in a new position specified by new_idx. |
|
Removes a button from the tab area. |
|
Removes a page from the tab control. |
|
Renders the tab catalog to the specified |
|
Sets the |
|
Sets the tab art flags. |
|
Instructs |
|
Sets the font for calculating text measurements. |
|
Sets all the tabs as inactive (non-selected). |
|
Sets the normal font for drawing tab labels. |
|
Sets the selected tab font for drawing tab labels. |
|
Sets the tab offset. |
|
Sets the tab area rectangle. |
|
TabHitTest() tests if a tab was hit, passing the window pointer |
AuiTabContainer
(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 AuiNotebook
, 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__
(self, auiNotebook)¶Default class constructor. Used internally, do not call it in your code!
auiNotebook – the parent AuiNotebook
window.
AddButton
(self, id, location, normal_bitmap=wx.NullBitmap, disabled_bitmap=wx.NullBitmap, name="")¶Adds a button in the tab area.
id (integer) – the button identifier. This can be one of the following:
Button Identifier |
Description |
---|---|
|
Shows a close button on the tab area |
|
Shows a window list button on the tab area |
|
Shows a left button on the tab area |
|
Shows a right button on the tab area |
location (integer) – the button location. Can be wx.LEFT
or wx.RIGHT
;
normal_bitmap (wx.Bitmap) – the bitmap for an enabled tab;
disabled_bitmap (wx.Bitmap) – the bitmap for a disabled tab;
name (string) – the button name.
AddPage
(self, page, info)¶Adds a page to the tab control.
page (wx.Window) – the window associated with this tab;
info – an instance of AuiNotebookPage
.
ButtonHitTest
(self, x, y, state_flags=AUI_BUTTON_STATE_HIDDEN|AUI_BUTTON_STATE_DISABLED)¶Tests if a button was hit.
x (integer) – the mouse x position;
y (integer) – the mouse y position;
state_flags (integer) – the current button state (hidden, disabled, etc…).
and instance of AuiTabContainerButton
if a button was hit, None
otherwise.
CloneButtons
(self)¶Clones the tab area buttons when the AuiNotebook
is being split.
DoShowHide
(self)¶This function shows the active window, then hides all of the other windows (in that order).
EnableTab
(self, idx, enable=True)¶Enables/disables a tab in the AuiTabContainer
.
idx (integer) – the tab index;
enable (bool) – True
to enable a tab, False
to disable it.
FindNextActiveTab
(self, idx)¶Finds the next active tab in the AuiTabContainer
.
idx (integer) – the index of the first (most obvious) tab to check for active status;
GetActivePage
(self)¶Returns the current selected tab or wx.NOT_FOUND
if none is selected.
GetAGWFlags
(self)¶Returns the tab art flags.
See also
SetAGWFlags
for a list of possible return values.
GetArtProvider
(self)¶Returns the current art provider being used.
GetEnabled
(self, idx)¶Returns whether a tab is enabled or not.
idx (integer) – the tab index.
GetHidden
(self, idx)¶Returns whether a tab is hidden or not.
idx (integer) – the tab index.
GetIdxFromWindow
(self, wnd)¶Returns the tab index based on the window wnd associated with it.
wnd – an instance of wx.Window
.
GetPage
(self, idx)¶Returns the page specified by the given index.
idx (integer) – the tab index.
GetPageCount
(self)¶Returns the number of pages in the AuiTabContainer
.
GetPages
(self)¶Returns a list of all the pages in this AuiTabContainer
.
GetShownPageCount
(self)¶Returns the number of pages shown in the AuiTabContainer
.
GetTabOffset
(self)¶Returns the tab offset.
GetWindowFromIdx
(self, idx)¶Returns the window associated with the tab with index idx.
idx (integer) – the tab index.
HideTab
(self, idx, hidden=True)¶hides/shows a tab in the AuiTabContainer
.
idx (integer) – the tab index;
hidden (bool) – True
to hide a tab, False
to show it.
InsertPage
(self, page, info, idx)¶Inserts a page in the tab control in the position specified by idx.
page (wx.Window) – the window associated with this tab;
info – an instance of AuiNotebookPage
;
idx (integer) – the page insertion index.
IsTabVisible
(self, tabPage, tabOffset, dc, wnd)¶Returns whether a tab is visible or not.
MakeTabVisible
(self, tabPage, win)¶Make the tab visible if it wasn’t already.
tabPage (integer) – the tab index;
win – an instance of wx.Window
derived window.
MovePage
(self, page, new_idx)¶Moves a page in a new position specified by new_idx.
page (wx.Window) – the window associated with this tab;
new_idx (integer) – the new page position.
RemoveButton
(self, id)¶Removes a button from the tab area.
id (integer) – the button identifier. See AddButton
for a list of button identifiers.
See also
RemovePage
(self, wnd)¶Removes a page from the tab control.
wnd – an instance of wx.Window
, a window associated with this tab.
Render
(self, raw_dc, wnd)¶Renders the tab catalog to the specified wx.DC
.
It is a virtual function and can be overridden to provide custom drawing capabilities.
SetActivePage
(self, wndOrInt)¶Sets the AuiNotebook
active page.
wndOrInt – an instance of wx.Window
or an integer specifying a tab index.
SetAGWFlags
(self, agwFlags)¶Sets the tab art flags.
agwFlags (integer) – a combination of the following values:
Flag name |
Description |
---|---|
|
With this style, tabs are drawn along the top of the notebook |
|
With this style, tabs are drawn along the left of the notebook. Not implemented yet |
|
With this style, tabs are drawn along the right of the notebook. Not implemented yet |
|
With this style, tabs are drawn along the bottom of the notebook |
|
Allows the tab control to be split by dragging a tab |
|
Allows a tab to be moved horizontally by dragging |
|
Allows a tab to be moved to another tab control |
|
With this style, all tabs have the same width |
|
With this style, left and right scroll buttons are displayed |
|
With this style, a drop-down list of windows is available |
|
With this style, a close button is available on the tab bar |
|
With this style, a close button is available on the active tab |
|
With this style, a close button is available on all tabs |
|
Allows to close |
|
This style is used by |
|
Hides the tab window if only one tab is present |
|
Use Smart Tabbing, like |
|
Uses images on dropdown window list menu instead of check items |
|
Draws the tab close button on the left instead of on the right (a la Camino browser) |
|
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 |
|
Draws an image representation of a tab while dragging (on by default) |
|
Tab navigation order by last access time for the tabs |
|
Don’t draw tab focus rectangle |
Todo
Implementation of flags AUI_NB_RIGHT
and AUI_NB_LEFT
.
SetArtProvider
(self, art)¶Instructs AuiTabContainer
to use art provider specified by parameter art
for all drawing calls. This allows pluggable look-and-feel features.
art – an art provider.
Note
The previous art provider object, if any, will be deleted by AuiTabContainer
.
SetMeasuringFont
(self, font)¶Sets the font for calculating text measurements.
font (wx.Font) – the new font to use to measure tab label text extents.
SetNoneActive
(self)¶Sets all the tabs as inactive (non-selected).
SetNormalFont
(self, font)¶Sets the normal font for drawing tab labels.
font (wx.Font) – the new font to use to draw tab labels in their normal, un-selected state.
SetSelectedFont
(self, font)¶Sets the selected tab font for drawing tab labels.
font (wx.Font) – the new font to use to draw tab labels in their selected state.
SetTabOffset
(self, offset)¶Sets the tab offset.
offset (integer) – the tab offset.
SetTabRect
(self, rect)¶Sets the tab area rectangle.
rect (wx.Rect) – the available area for AuiTabContainer
.
TabHitTest
(self, x, y)¶TabHitTest() tests if a tab was hit, passing the window pointer back if that condition was fulfilled.
x (integer) – the mouse x position;
y (integer) – the mouse y position.