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 theAuiToolBarto have a pluggable look-and-feel.By default, a
AuiToolBaruses an instance of this class calledAuiDefaultToolBarArtwhich 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.SetArtProviderto make use this new tab art.
Methods¶
- __init__(self)¶
Default class constructor.
- Clone(self)¶
Clones the
AuiDefaultToolBarArtart.
- DrawBackground(self, dc, wnd, _rect, horizontal=True)¶
Draws a toolbar background with a gradient shading.
- Parameters:
dc – a
wx.DCdevice context;wnd – a
wx.Windowderived window;_rect (wx.Rect) – the
AuiToolBarItemrectangle;horizontal (bool) –
Trueif the toolbar is horizontal,Falseif it is vertical.
- DrawButton(self, dc, wnd, item, rect)¶
Draws a toolbar item button.
- Parameters:
dc – a
wx.DCdevice context;wnd – a
wx.Windowderived window;item – an instance of
AuiToolBarItem;rect (wx.Rect) – the
AuiToolBarItemrectangle.
- DrawControlLabel(self, dc, wnd, item, rect)¶
Draws a label for a toolbar control.
- Parameters:
dc – a
wx.DCdevice context;wnd – a
wx.Windowderived window;item – an instance of
AuiToolBarItem;rect (wx.Rect) – the
AuiToolBarItemrectangle.
- DrawDropDownButton(self, dc, wnd, item, rect)¶
Draws a toolbar dropdown button.
- Parameters:
dc – a
wx.DCdevice context;wnd – a
wx.Windowderived window;item – an instance of
AuiToolBarItem;rect (wx.Rect) – the
AuiToolBarItemrectangle.
- DrawGripper(self, dc, wnd, rect)¶
Draws the toolbar gripper.
- Parameters:
dc – a
wx.DCdevice context;wnd – a
wx.Windowderived window;rect (wx.Rect) – the
AuiToolBarItemrectangle.
- DrawLabel(self, dc, wnd, item, rect)¶
Draws a toolbar item label.
- Parameters:
dc – a
wx.DCdevice context;wnd – a
wx.Windowderived window;item – an instance of
AuiToolBarItem;rect (wx.Rect) – the
AuiToolBarItemrectangle.
- DrawOverflowButton(self, dc, wnd, rect, state)¶
Draws the overflow button for the
AuiToolBar.- Parameters:
dc – a
wx.DCdevice context;wnd – a
wx.Windowderived window;rect (wx.Rect) – the
AuiToolBarItemrectangle;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
AuiToolBarthat 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: putAuiToolBarwithin aStaticBoxSizerthat has a plain background).- Parameters:
dc – a
wx.DCdevice context;wnd – a
wx.Windowderived window;_rect (wx.Rect) – the
AuiToolBarItemrectangle.
- DrawSeparator(self, dc, wnd, _rect)¶
Draws a toolbar separator.
- Parameters:
dc – a
wx.DCdevice context;wnd – a
wx.Windowderived window;_rect (wx.Rect) – the
AuiToolBarItemrectangle.
- GetAGWFlags(self)¶
Returns the
AuiDefaultToolBarArtflags.See also
SetAGWFlagsfor 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_SIZESeparator size in
AuiToolBarAUI_TBART_GRIPPER_SIZEGripper size in
AuiToolBarAUI_TBART_OVERFLOW_SIZEOverflow button size in
AuiToolBar
- GetFont(self)¶
Returns the
AuiDefaultToolBarArtfont.
- GetLabelSize(self, dc, wnd, item)¶
Returns the label size for a toolbar item.
- Parameters:
dc – a
wx.DCdevice context;wnd – a
wx.Windowderived window;item – an instance of
AuiToolBarItem.
- GetOrientation(self)¶
Returns the toolbar orientation.
- GetTextOrientation(self)¶
Returns the
AuiDefaultToolBarArttext orientation.See also
SetTextOrientationfor more details.
- GetToolSize(self, dc, wnd, item)¶
Returns the toolbar item size.
- Parameters:
dc – a
wx.DCdevice context;wnd – a
wx.Windowderived 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.DCdevice 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_TEXTShows the text in the toolbar buttons; by default only icons are shown
AUI_TB_NO_TOOLTIPSDon’t show tooltips on
AuiToolBaritemsAUI_TB_NO_AUTORESIZEDo not auto-resize the
AuiToolBarAUI_TB_GRIPPERShows a gripper on the
AuiToolBarAUI_TB_OVERFLOWThe
AuiToolBarcan contain overflow itemsAUI_TB_VERTICALThe
AuiToolBaris verticalAUI_TB_HORZ_LAYOUTShows the text and the icons alongside, not vertically stacked. This style must be used with
AUI_TB_TEXTAUI_TB_PLAIN_BACKGROUNDDon’t draw a gradient background on the toolbar
AUI_TB_HORZ_TEXTCombination of
AUI_TB_HORZ_LAYOUTandAUI_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_SIZESeparator size in
AuiToolBarAUI_TBART_GRIPPER_SIZEGripper size in
AuiToolBarAUI_TBART_OVERFLOW_SIZEOverflow button size in
AuiToolBarsize (integer) – the new size of the UI element.
- SetFont(self, font)¶
Sets the
AuiDefaultToolBarArtfont.- 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_CLOCKWISEorAUI_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_LEFTText in
AuiToolBaritems is aligned leftAUI_TBTOOL_TEXT_RIGHTText in
AuiToolBaritems is aligned rightAUI_TBTOOL_TEXT_TOPText in
AuiToolBaritems is aligned topAUI_TBTOOL_TEXT_BOTTOMText in
AuiToolBaritems is aligned bottom