wx.aui.AuiTabArt¶
Tab art provider defines all the drawing functions used by wx.aui.AuiNotebook.
This allows the wx.aui.AuiNotebook to have a pluggable look-and-feel.
By default, a wx.aui.AuiNotebook uses an instance of class AuiDefaultTabArt, derived from this class, which provides bitmaps and a colour scheme that is adapted to the major platforms’ look. You can either derive from that class to alter its behaviour or write a completely new tab art class.
Another example of creating a new wx.aui.AuiNotebook tab bar is wx.aui.AuiSimpleTabArt.
Call wx.aui.AuiNotebook.SetArtProvider to make use of this new tab art.
Class Hierarchy¶
Known Subclasses¶
wx.aui.AuiFlatTabArt, wx.aui.AuiGenericTabArt, wx.aui.AuiSimpleTabArt
Methods Summary¶
Constructor. |
|
Clones the art object. |
|
Draws a background on the given area. |
|
Draws a button. |
|
Draws a tab for the specified notebook page. |
|
Draws a tab. |
|
Returns the rectangle for the given button. |
|
Returns the indent size. |
|
Returns the font to use for normal, non-selected, tabs. |
|
Returns the size of the tab for the specified notebook page. |
|
Returns the font to use for the selected tab. |
|
Returns the tab size for the given caption, bitmap and state. |
|
Sets the colour of the selected tab. |
|
Sets the colour of the inactive tabs. |
|
Sets flags. |
|
Sets the font used for calculating measurements. |
|
Sets the normal font for drawing labels. |
|
Sets the font for drawing text for selected UI elements. |
|
Sets sizing information. |
Properties Summary¶
See |
|
See |
|
See |
Class API¶
- class wx.aui.AuiTabArt(object)¶
Possible constructors:
AuiTabArt() -> None
Tab art provider defines all the drawing functions used by AuiNotebook.
Methods¶
- __init__(self)¶
Constructor.
- Return type:
None
- Clone(self)¶
Clones the art object.
- Return type:
- DrawBackground(self, dc, wnd, rect)¶
Draws a background on the given area.
- DrawButton(self, dc, wnd, in_rect, bitmap_id, button_state, orientation, out_rect)¶
Draws a button.
- DrawPageTab(self, dc, wnd, page, rect)¶
Draws a tab for the specified notebook page.
This function must be overridden if
DrawTabis not overridden and, also, if pinned tabs are used, as they are not supported byDrawTab.The pane contains the information about the page to draw, in particular its
wx.aui.AuiNotebookPage.buttonsspecifies the buttons to draw if it is not empty and receives the rectangles where they were drawn on output in thewx.aui.AuiTabContainerButton.rectfields.Note that if a button state is
AUI_BUTTON_STATE_HIDDEN, the effect is the same as not including this button at all, i.e. it is not drawn and the output field is not modified in this case.The
wx.aui.AuiNotebookPage.rectfield is also updated by this function to contain the bounding rectangle of the tab.- Parameters:
dc (wx.DC)
wnd (wx.Window)
page (wx.aui.AuiNotebookPage)
rect (wx.Rect)
- Return type:
int
- Returns:
The total horizontal span of the tab, which may be greater than the page bounding rectangle.
Added in version 4.3/wxWidgets-3.3.0.
- DrawTab(self, dc, wnd, page, rect, close_button_state, out_tab_rect, out_button_rect, x_extent)¶
Draws a tab.
This function used to be pure virtual and so had to be overridden in the derived classes in the previous versions of wxWidgets, however since version 3.3.0 it doesn’t have to be overridden if
DrawPageTabis overridden and, moreover, it is recommended to overrideDrawPageTabinstead of this function in the new code.
- GetButtonRect(self, dc, wnd, inRect, bitmapId, buttonState, orientation, outRect=nullptr)¶
Returns the rectangle for the given button.
This function is not pure virtual because it is only for multi-line tabs, but it must be implemented if
wx.aui.AUI_NB_MULTILINEis used.If specified, the returned rectangle must be filled with the same value as
DrawButtonputs into its outRect but here it can also be null in which case just its width is returned.- Parameters:
dc (wx.ReadOnlyDC)
wnd (wx.Window)
inRect (wx.Rect)
bitmapId (int)
buttonState (int)
orientation (int)
outRect (wx.Rect)
- Return type:
int
Added in version 4.3/wxWidgets-3.3.0.
- GetIndentSize(self)¶
Returns the indent size.
- Return type:
int
- GetNormalFont(self)¶
Returns the font to use for normal, non-selected, tabs.
By default, returns an invalid font, meaning that the font set for wx.aui.AuiNotebook itself should be used.
This function should be overridden for
SetNormalFontto actually work.- Return type:
Font
Added in version 4.3/wxWidgets-3.3.0.
- GetPageTabSize(self, dc, wnd, page, xExtent=nullptr)¶
Returns the size of the tab for the specified notebook page.
This function must be overridden if
GetTabSizeis not overridden and, also, if pinned tabs are used, as they are not supported byGetTabSize.- Parameters:
dc (wx.ReadOnlyDC)
wnd (wx.Window)
page (wx.aui.AuiNotebookPage)
xExtent (int)
- Return type:
Size
Added in version 4.3/wxWidgets-3.3.0.
- GetSelectedFont(self)¶
Returns the font to use for the selected tab.
By default, returns an invalid font, meaning that the font set for wx.aui.AuiNotebook itself should be used.
This function should be overridden for
SetSelectedFontto actually work.- Return type:
Font
Added in version 4.3/wxWidgets-3.3.0.
- GetTabSize(self, dc, wnd, caption, bitmap, active, close_button_state, x_extent)¶
Returns the tab size for the given caption, bitmap and state.
This function used to be pure virtual and so had to be overridden in the derived classes in the previous versions of wxWidgets, however since version 3.3.0 it doesn’t have to be overridden if
GetPageTabSizeis overridden and it is recommended to overrideGetPageTabSizeinstead of this function in the new code.- Parameters:
dc (wx.ReadOnlyDC)
wnd (wx.Window)
caption (string)
bitmap (wx.BitmapBundle)
active (bool)
close_button_state (int)
x_extent (int)
- Return type:
Size
- SetActiveColour(self, colour)¶
Sets the colour of the selected tab.
- Parameters:
colour (wx.Colour)
- Return type:
None
Added in version 2.9.2.
- SetColour(self, colour)¶
Sets the colour of the inactive tabs.
- Parameters:
colour (wx.Colour)
- Return type:
None
Added in version 2.9.2.
- SetFlags(self, flags)¶
Sets flags.
- Parameters:
flags (int)
- Return type:
None
- SetMeasuringFont(self, font)¶
Sets the font used for calculating measurements.
- Parameters:
font (wx.Font)
- Return type:
None
- SetNormalFont(self, font)¶
Sets the normal font for drawing labels.
- Parameters:
font (wx.Font)
- Return type:
None
See also
- SetSelectedFont(self, font)¶
Sets the font for drawing text for selected UI elements.
- Parameters:
font (wx.Font)
- Return type:
None
See also
- SetSizingInfo(self, tab_ctrl_size, tab_count, wnd=nullptr)¶
Sets sizing information.
The wnd argument is only present in wxWidgets 3.1.6 and newer and is required, it only has nullptr default value for compatibility reasons.
Properties¶
- IndentSize¶
See
GetIndentSize
- NormalFont¶
See
GetNormalFontandSetNormalFont
- SelectedFont¶
See
GetSelectedFontandSetSelectedFont