wx.lib.agw.aui.auibar.AuiDefaultToolBarArt¶
Toolbar art provider code - a tab provider provides all drawing functionality to the AuiToolBar
.
This allows the AuiToolBar
to have a pluggable look-and-feel.
By default, a AuiToolBar
uses an instance of this class called AuiDefaultToolBarArt
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 AuiToolBar.SetArtProvider
to make use this new tab art.
Class Hierarchy¶
Methods Summary¶
Default class constructor. |
|
Clones the |
|
Draws a toolbar background with a gradient shading. |
|
Draws a toolbar item button. |
|
Draws a label for a toolbar control. |
|
Draws a toolbar dropdown button. |
|
Draws the toolbar gripper. |
|
Draws a toolbar item label. |
|
Draws the overflow button for the |
|
Draws a toolbar background with a plain colour. |
|
Draws a toolbar separator. |
|
Returns the |
|
Returns the size of a UI element in the |
|
Returns the |
|
Returns the label size for a toolbar item. |
|
Returns the toolbar orientation. |
|
Returns the |
|
Returns the toolbar item size. |
|
Returns the bitmap and text rectangles for a toolbar item. |
|
Sets the toolbar art flags. |
|
Sets the default colours, which are calculated from the given base colour. |
|
Sets the size of a UI element in the |
|
Sets the |
|
Sets the toolbar tool orientation. |
|
Sets the text orientation. |
|
Shows the drop down window menu for overflow items. |
Class API¶
- class AuiDefaultToolBarArt(object)¶
Toolbar art provider code - a tab provider provides all drawing functionality to the
AuiToolBar
. This allows theAuiToolBar
to have a pluggable look-and-feel.By default, a
AuiToolBar
uses an instance of this class calledAuiDefaultToolBarArt
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. CallAuiToolBar.SetArtProvider
to make use this new tab art.
Methods¶
- __init__(self)¶
Default class constructor.
- Clone(self)¶
Clones the
AuiDefaultToolBarArt
art.
- DrawBackground(self, dc, wnd, _rect, horizontal=True)¶
Draws a toolbar background with a gradient shading.
- Parameters:
dc – a
wx.DC
device context;wnd – a
wx.Window
derived window;_rect (wx.Rect) – the
AuiToolBarItem
rectangle;horizontal (bool) –
True
if the toolbar is horizontal,False
if it is vertical.
- DrawButton(self, dc, wnd, item, rect)¶
Draws a toolbar item button.
- Parameters:
dc – a
wx.DC
device context;wnd – a
wx.Window
derived window;item – an instance of
AuiToolBarItem
;rect (wx.Rect) – the
AuiToolBarItem
rectangle.
- DrawControlLabel(self, dc, wnd, item, rect)¶
Draws a label for a toolbar control.
- Parameters:
dc – a
wx.DC
device context;wnd – a
wx.Window
derived window;item – an instance of
AuiToolBarItem
;rect (wx.Rect) – the
AuiToolBarItem
rectangle.
- DrawDropDownButton(self, dc, wnd, item, rect)¶
Draws a toolbar dropdown button.
- Parameters:
dc – a
wx.DC
device context;wnd – a
wx.Window
derived window;item – an instance of
AuiToolBarItem
;rect (wx.Rect) – the
AuiToolBarItem
rectangle.
- DrawGripper(self, dc, wnd, rect)¶
Draws the toolbar gripper.
- Parameters:
dc – a
wx.DC
device context;wnd – a
wx.Window
derived window;rect (wx.Rect) – the
AuiToolBarItem
rectangle.
- DrawLabel(self, dc, wnd, item, rect)¶
Draws a toolbar item label.
- Parameters:
dc – a
wx.DC
device context;wnd – a
wx.Window
derived window;item – an instance of
AuiToolBarItem
;rect (wx.Rect) – the
AuiToolBarItem
rectangle.
- DrawOverflowButton(self, dc, wnd, rect, state)¶
Draws the overflow button for the
AuiToolBar
.- Parameters:
dc – a
wx.DC
device context;wnd – a
wx.Window
derived window;rect (wx.Rect) – the
AuiToolBarItem
rectangle;state (integer) – the overflow button state.
- DrawPlainBackground(self, dc, wnd, _rect)¶
Draws a toolbar background with a plain colour.
This method contrasts with the default behaviour of the
AuiToolBar
that draws a background gradient and this break the window design when putting it within a control that has margin between the borders and the toolbar (example: putAuiToolBar
within aStaticBoxSizer
that has a plain background).- Parameters:
dc – a
wx.DC
device context;wnd – a
wx.Window
derived window;_rect (wx.Rect) – the
AuiToolBarItem
rectangle.
- DrawSeparator(self, dc, wnd, _rect)¶
Draws a toolbar separator.
- Parameters:
dc – a
wx.DC
device context;wnd – a
wx.Window
derived window;_rect (wx.Rect) – the
AuiToolBarItem
rectangle.
- GetAGWFlags(self)¶
Returns the
AuiDefaultToolBarArt
flags.See also
SetAGWFlags
for more details.
- GetElementSize(self, element_id)¶
Returns the size of a UI element in the
AuiToolBar
.- Parameters:
element_id (integer) – can be one of the following:
Element Identifier
Description
AUI_TBART_SEPARATOR_SIZE
Separator size in
AuiToolBar
AUI_TBART_GRIPPER_SIZE
Gripper size in
AuiToolBar
AUI_TBART_OVERFLOW_SIZE
Overflow button size in
AuiToolBar
- GetFont(self)¶
Returns the
AuiDefaultToolBarArt
font.
- GetLabelSize(self, dc, wnd, item)¶
Returns the label size for a toolbar item.
- Parameters:
dc – a
wx.DC
device context;wnd – a
wx.Window
derived window;item – an instance of
AuiToolBarItem
.
- GetOrientation(self)¶
Returns the toolbar orientation.
- GetTextOrientation(self)¶
Returns the
AuiDefaultToolBarArt
text orientation.See also
SetTextOrientation
for more details.
- GetToolSize(self, dc, wnd, item)¶
Returns the toolbar item size.
- Parameters:
dc – a
wx.DC
device context;wnd – a
wx.Window
derived window;item – an instance of
AuiToolBarItem
.
- GetToolsPosition(self, dc, item, rect)¶
Returns the bitmap and text rectangles for a toolbar item.
- Parameters:
dc – a
wx.DC
device context;item – an instance of
AuiToolBarItem
;rect (wx.Rect) – the tool rectangle.
- SetAGWFlags(self, agwFlags)¶
Sets the toolbar art flags.
- Parameters:
agwFlags (integer) – a combination of the following values:
Flag name
Description
AUI_TB_TEXT
Shows the text in the toolbar buttons; by default only icons are shown
AUI_TB_NO_TOOLTIPS
Don’t show tooltips on
AuiToolBar
itemsAUI_TB_NO_AUTORESIZE
Do not auto-resize the
AuiToolBar
AUI_TB_GRIPPER
Shows a gripper on the
AuiToolBar
AUI_TB_OVERFLOW
The
AuiToolBar
can contain overflow itemsAUI_TB_VERTICAL
The
AuiToolBar
is verticalAUI_TB_HORZ_LAYOUT
Shows the text and the icons alongside, not vertically stacked. This style must be used with
AUI_TB_TEXT
AUI_TB_PLAIN_BACKGROUND
Don’t draw a gradient background on the toolbar
AUI_TB_HORZ_TEXT
Combination of
AUI_TB_HORZ_LAYOUT
andAUI_TB_TEXT
- 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.
- SetElementSize(self, element_id, size)¶
Sets the size of a UI element in the
AuiToolBar
.- Parameters:
element_id (integer) – can be one of the following:
Element Identifier
Description
AUI_TBART_SEPARATOR_SIZE
Separator size in
AuiToolBar
AUI_TBART_GRIPPER_SIZE
Gripper size in
AuiToolBar
AUI_TBART_OVERFLOW_SIZE
Overflow button size in
AuiToolBar
size (integer) – the new size of the UI element.
- SetFont(self, font)¶
Sets the
AuiDefaultToolBarArt
font.- Parameters:
font (wx.Font) – the font used for displaying toolbar item labels.
- SetOrientation(self, orientation)¶
Sets the toolbar tool orientation.
- Parameters:
orientation (integer) – one of
AUI_TBTOOL_HORIZONTAL
,AUI_TBTOOL_VERT_CLOCKWISE
orAUI_TBTOOL_VERT_COUNTERCLOCKWISE
.
- SetTextOrientation(self, orientation)¶
Sets the text orientation.
- Parameters:
orientation (integer) – can be one of the following constants:
Orientation Switches
Description
AUI_TBTOOL_TEXT_LEFT
Text in
AuiToolBar
items is aligned leftAUI_TBTOOL_TEXT_RIGHT
Text in
AuiToolBar
items is aligned rightAUI_TBTOOL_TEXT_TOP
Text in
AuiToolBar
items is aligned topAUI_TBTOOL_TEXT_BOTTOM
Text in
AuiToolBar
items is aligned bottom