tabart.AuiDefaultTabArt

Inheritance diagram for AuiDefaultTabArt:


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


Description

Tab art provider code - a tab provider provides all drawing functionality to the AuiNotebook. This allows the AuiNotebook to have a plugable 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 API

Methods

class AuiDefaultTabArt

Bases: object

Tab art provider code - a tab provider provides all drawing functionality to the AuiNotebook. This allows the AuiNotebook to have a plugable 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.

__init__()
Default class constructor.
Clone()
Clones the art object.
DrawBackground(dc, wnd, rect)

Draws the tab area background.

Parameters:
  • dc – a wx.DC device context;
  • wnd – a wx.Window instance object;
  • rect – the tab control rectangle.
DrawButton(dc, wnd, in_rect, bitmap_id, button_state, orientation)

Draws a button on the tab or on the tab area, depending on the button identifier.

Parameters:
  • dc – a wx.DC device context;
  • wnd – a wx.Window instance object;
  • in_rect – rectangle the tab should be confined to;
  • bitmap_id – the button identifier;
  • button_state – the state of the button;
  • orientation – the tab orientation.
DrawFocusRectangle(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.DC device context;
  • page – the page associated with the tab;
  • wnd – a wx.Window instance object;
  • draw_text – the text that has been drawn on the tab;
  • text_offset – the text offset on the tab;
  • bitmap_offset – the bitmap offset on the tab;
  • drawn_tab_yoff – the y offset of the tab text;
  • drawn_tab_height – the height of the tab;
  • textx – the x text extent;
  • texty – the y text extent.
DrawTab(dc, wnd, page, in_rect, close_button_state)

Draws a single tab.

Parameters:
  • dc – a wx.DC device context;
  • wnd – a wx.Window instance object;
  • page – the tab control page associated with the tab;
  • in_rect – rectangle the tab should be confined to;
  • close_button_state – the state of the close button on the tab.
GetBestTabCtrlSize(wnd, pages, required_bmp_size)

Returns the best tab control size.

Parameters:
  • wnd – a wx.Window instance object;
  • pages – the pages associated with the tabs;
  • required_bmp_size – the size of the bitmap on the tabs.
GetFlags()

Returns the tab art flags.

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

GetIndentSize()
Returns the tabs indent size.
GetMeasuringFont()
Returns the font for calculating text measurements.
GetNormalFont()
Returns the normal font for drawing tab labels.
GetSelectedFont()
Returns the selected tab font for drawing tab labels.
GetTabSize(dc, wnd, caption, bitmap, active, close_button_state)

Returns the tab size for the given caption, bitmap and button state.

Parameters:
  • dc – a wx.DC device context;
  • wnd – a wx.Window instance object;
  • caption – the tab text caption;
  • bitmap – the bitmap displayed on the tab;
  • active – whether the tab is selected or not;
  • close_button_state – the state of the close button on the tab.
SetCustomButton(bitmap_id, button_state, bmp)

Sets a custom bitmap for the close, left, right and window list buttons.

Parameters:
  • bitmap_id – the button identifier;
  • button_state – the button state;
  • bmp – the custom bitmap to use for the button.
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.
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.
SetSizingInfo(tab_ctrl_size, tab_count)

Sets the tab sizing information.

Parameters:
  • tab_ctrl_size – the size of the tab control area;
  • tab_count – the number of tabs.
ShowDropDown(wnd, pages, active_idx)

Shows the drop-down window menu on the tab area.

Parameters:
  • wnd – a wx.Window derived window instance;
  • pages – the pages associated with the tabs;
  • active_idx – the active tab index.

Table Of Contents

This Page