wx.lib.agw.aui.tabart.AuiDefaultTabArt¶
Tab art provider code - a tab provider provides all drawing functionality to the AuiNotebook.
This allows the AuiNotebook to have a pluggable look-and-feel.
By default, a AuiNotebook uses an instance of this class called
AuiDefaultTabArt which provides bitmap art 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. Call AuiNotebook.SetArtProvider() to make use this
new tab art.
Class Hierarchy¶
Known Subclasses¶
wx.lib.agw.aui.tabart.ChromeTabArt, wx.lib.agw.aui.tabart.FF2TabArt, wx.lib.agw.aui.tabart.VC71TabArt, wx.lib.agw.aui.tabart.VC8TabArt
Methods Summary¶
Default class constructor. |
|
Clones the art object. |
|
Draws the tab area background. |
|
Draws a button on the tab or on the tab area, depending on the button identifier. |
|
Draws the focus rectangle on a tab. |
|
Draws a single tab. |
|
Returns the tab art flags. |
|
Returns the best tab control size. |
|
Returns the tabs indent size. |
|
Returns the font for calculating text measurements. |
|
Returns the normal font for drawing tab labels. |
|
Returns the selected tab font for drawing tab labels. |
|
Returns the tab size for the given caption, bitmap and button state. |
|
Sets the tab art flags. |
|
Sets a new base colour. |
|
Sets a custom bitmap for the close, left, right and window list buttons. |
|
Sets the default colours, which are calculated from the given base colour. |
|
Sets the font for calculating text measurements. |
|
Sets the normal font for drawing tab labels. |
|
Sets the selected tab font for drawing tab labels. |
|
Sets the tab sizing information. |
|
Shows the drop-down window menu on the tab area. |
Class API¶
- class AuiDefaultTabArt(object)¶
Tab art provider code - a tab provider provides all drawing functionality to the
AuiNotebook. This allows theAuiNotebookto have a pluggable look-and-feel.By default, a
AuiNotebookuses an instance of this class calledAuiDefaultTabArtwhich provides bitmap art 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. CallAuiNotebook.SetArtProvider()to make use this new tab art.
Methods¶
- __init__(self)¶
Default class constructor.
- Clone(self)¶
Clones the art object.
- DrawBackground(self, dc, wnd, rect)¶
Draws the tab area background.
- DrawButton(self, dc, wnd, in_rect, button, orientation)¶
Draws a button on the tab or on the tab area, depending on the button identifier.
- DrawFocusRectangle(self, dc, page, wnd, draw_text, text_offset, bitmap_offset, drawn_tab_yoff, drawn_tab_height, textx, texty)¶
Draws the focus rectangle on a tab.
- Parameters:
dc – a
wx.DCdevice context;page – the page associated with the tab;
wnd – a
wx.Windowinstance object;draw_text (string) – the text that has been drawn on the tab;
text_offset (integer) – the text offset on the tab;
bitmap_offset (integer) – the bitmap offset on the tab;
drawn_tab_yoff (integer) – the y offset of the tab text;
drawn_tab_height (integer) – the height of the tab;
textx (integer) – the x text extent;
texty (integer) – the y text extent.
- DrawTab(self, dc, wnd, page, in_rect, close_button_state, paint_control=False)¶
Draws a single tab.
- Parameters:
dc – a
wx.DCdevice context;wnd – a
wx.Windowinstance object;page – the tab control page associated with the tab;
in_rect (wx.Rect) – rectangle the tab should be confined to;
close_button_state (integer) – the state of the close button on the tab;
paint_control (bool) – whether to draw the control inside a tab (if any) on a
MemoryDC.
- GetAGWFlags(self)¶
Returns the tab art flags.
See also
SetAGWFlagsfor a list of possible return values.
- GetBestTabCtrlSize(self, wnd, pages, required_bmp_size)¶
Returns the best tab control size.
- GetIndentSize(self)¶
Returns the tabs indent size.
- GetMeasuringFont(self)¶
Returns the font for calculating text measurements.
- GetNormalFont(self)¶
Returns the normal font for drawing tab labels.
- GetSelectedFont(self)¶
Returns the selected tab font for drawing tab labels.
- GetTabSize(self, dc, wnd, caption, bitmap, active, close_button_state, control=None)¶
Returns the tab size for the given caption, bitmap and button state.
- Parameters:
dc – a
wx.DCdevice context;wnd – a
wx.Windowinstance object;caption (string) – the tab text caption;
bitmap (wx.Bitmap) – the bitmap displayed on the tab;
active (bool) – whether the tab is selected or not;
close_button_state (integer) – the state of the close button on the tab;
control (wx.Window) – a
wx.Windowinstance inside a tab (orNone).
- SetAGWFlags(self, agwFlags)¶
Sets the tab art flags.
- Parameters:
agwFlags (integer) – a combination of the following values:
Flag name
Description
AUI_NB_TOPWith this style, tabs are drawn along the top of the notebook
AUI_NB_LEFTWith this style, tabs are drawn along the left of the notebook. Not implemented yet.
AUI_NB_RIGHTWith this style, tabs are drawn along the right of the notebook. Not implemented yet.
AUI_NB_BOTTOMWith this style, tabs are drawn along the bottom of the notebook
AUI_NB_TAB_SPLITAllows the tab control to be split by dragging a tab
AUI_NB_TAB_MOVEAllows a tab to be moved horizontally by dragging
AUI_NB_TAB_EXTERNAL_MOVEAllows a tab to be moved to another tab control
AUI_NB_TAB_FIXED_WIDTHWith this style, all tabs have the same width
AUI_NB_SCROLL_BUTTONSWith this style, left and right scroll buttons are displayed
AUI_NB_WINDOWLIST_BUTTONWith this style, a drop-down list of windows is available
AUI_NB_CLOSE_BUTTONWith this style, a close button is available on the tab bar
AUI_NB_CLOSE_ON_ACTIVE_TABWith this style, a close button is available on the active tab
AUI_NB_CLOSE_ON_ALL_TABSWith this style, a close button is available on all tabs
AUI_NB_MIDDLE_CLICK_CLOSEAllows to close
AuiNotebooktabs by mouse middle button clickAUI_NB_SUB_NOTEBOOKThis style is used by
AuiManagerto create automatic AuiNotebooksAUI_NB_HIDE_ON_SINGLE_TABHides the tab window if only one tab is present
AUI_NB_SMART_TABSUse Smart Tabbing, like
Alt+Tabon WindowsAUI_NB_USE_IMAGES_DROPDOWNUses images on dropdown window list menu instead of check items
AUI_NB_CLOSE_ON_TAB_LEFTDraws the tab close button on the left instead of on the right (a la Camino browser)
AUI_NB_TAB_FLOATAllows 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
AUI_NB_DRAW_DND_TABDraws an image representation of a tab while dragging (on by default)
AUI_NB_ORDER_BY_ACCESSTab navigation order by last access time for the tabs
AUI_NB_NO_TAB_FOCUSDon’t draw tab focus rectangle
- SetBaseColour(self, base_colour)¶
Sets a new base colour.
- Parameters:
base_colour – an instance of
wx.Colour.
- SetCustomButton(self, bitmap_id, button_state, bmp)¶
Sets a custom bitmap for the close, left, right and window list buttons.
- Parameters:
bitmap_id (integer) – the button identifier;
button_state (integer) – the button state;
bmp (wx.Bitmap) – the custom bitmap to use for the button.
- SetDefaultColours(self, base_colour=None)¶
Sets the default colours, which are calculated from the given base colour.
- Parameters:
base_colour – an instance of
wx.Colour. If defaulted toNone, a colour is generated accordingly to the platform and theme.
- SetMeasuringFont(self, font)¶
Sets the font for calculating text measurements.
- Parameters:
font (wx.Font) – the new font to use to measure tab labels text extents.
- SetNormalFont(self, font)¶
Sets the normal font for drawing tab labels.
- Parameters:
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.
- Parameters:
font (wx.Font) – the new font to use to draw tab labels in their selected state.
- SetSizingInfo(self, tab_ctrl_size, tab_count, minMaxTabWidth)¶
Sets the tab sizing information.
- Parameters:
tab_ctrl_size (wx.Size) – the size of the tab control area;
tab_count (integer) – the number of tabs;
minMaxTabWidth (tuple) – a tuple containing the minimum and maximum tab widths to be used when the
AUI_NB_TAB_FIXED_WIDTHstyle is active.