AGW Logo

agw_title AuiDefaultToolBarArt

Toolbar art provider code - a tab provider provides all drawing functionality to the AuiToolBar. This allows the AuiToolBar to have a plugable 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 SetArtProvider to make use this new tab art.

hierarchy Inheritance Diagram

Inheritance diagram for: AuiDefaultToolBarArt

Inheritance diagram of AuiDefaultToolBarArt


method_summary Methods Summary

__init__Default class constructor.
CloneClones the AuiToolBar art.
DrawBackgroundDraws a toolbar background with a gradient shading.
DrawButtonDraws a toolbar item button.
DrawControlLabelDraws a label for a toolbar control.
DrawDropDownButtonDraws a toolbar dropdown button.
DrawGripperDraws the toolbar gripper.
DrawLabelDraws a toolbar item label.
DrawOverflowButtonDraws the overflow button for the AuiToolBar.
DrawPlainBackgroundDraws a toolbar background with a plain colour.
DrawSeparatorDraws a toolbar separator.
GetAGWFlagsReturns the AuiDefaultToolBarArt flags. See SetAGWFlags for more
GetElementSizeReturns the size of a UI element in the AuiToolBar.
GetFontReturns the AuiDefaultToolBarArt font.
GetLabelSizeReturns the label size for a toolbar item.
GetOrientationReturns the toolbar orientation.
GetTextOrientationReturns the AuiDefaultToolBarArt text orientation. See
GetToolSizeReturns the toolbar item size.
GetToolsPositionReturns the bitmap and text rectangles for a toolbar item.
SetAGWFlagsSets the toolbar art flags.
SetDefaultColoursSets the default colours, which are calculated from the given base colour.
SetElementSizeSets the size of a UI element in the AuiToolBar.
SetFontSets the AuiDefaultToolBarArt font.
SetOrientationSets the toolbar tool orientation.
SetTextOrientationSets the text orientation.
ShowDropDownShows the drop down window menu for overflow items.

API Class API

class AuiDefaultToolBarArt(object)[source]

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



__init__()[source]

Default class constructor.



Clone()[source]

Clones the AuiToolBar art.



DrawBackground(dc, wnd, _rect, horizontal=True)[source]

Draws a toolbar background with a gradient shading.

Parameters:
  • dc – a wx.DC device context;
  • wnd – a wx.Window derived window;
  • _rect – the AuiToolBar rectangle;
  • horizontalTrue if the toolbar is horizontal, False if it is vertical.


DrawButton(dc, wnd, item, rect)[source]

Draws a toolbar item button.

Parameters:


DrawControlLabel(dc, wnd, item, rect)[source]

Draws a label for a toolbar control.

Parameters:


DrawDropDownButton(dc, wnd, item, rect)[source]

Draws a toolbar dropdown button.

Parameters:


DrawGripper(dc, wnd, rect)[source]

Draws the toolbar gripper.

Parameters:


DrawLabel(dc, wnd, item, rect)[source]

Draws a toolbar item label.

Parameters:


DrawOverflowButton(dc, wnd, rect, state)[source]

Draws the overflow button for the AuiToolBar.

Parameters:
  • dc – a wx.DC device context;

  • wnd – a wx.Window derived window;

  • rect – the AuiToolBar rectangle;
  • state – the overflow button state.


DrawPlainBackground(dc, wnd, _rect)[source]

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: put AuiToolBar within a wx.StaticBoxSizer that has a plain background).

Parameters:


DrawSeparator(dc, wnd, _rect)[source]

Draws a toolbar separator.

Parameters:


GetAGWFlags()[source]

Returns the AuiDefaultToolBarArt flags. See SetAGWFlags for more details.

See also

SetAGWFlags



GetElementSize(element_id)[source]

Returns the size of a UI element in the AuiToolBar.

Parameters:element_id – 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()[source]

Returns the AuiDefaultToolBarArt font.



GetLabelSize(dc, wnd, item)[source]

Returns the label size for a toolbar item.

Parameters:


GetOrientation()[source]

Returns the toolbar orientation.



GetTextOrientation()[source]

Returns the AuiDefaultToolBarArt text orientation. See SetTextOrientation for more details.



GetToolSize(dc, wnd, item)[source]

Returns the toolbar item size.

Parameters:


GetToolsPosition(dc, item, rect)[source]

Returns the bitmap and text rectangles for a toolbar item.

Parameters:
  • dc – a wx.DC device context;

  • item – an instance of AuiToolBarItem;
  • rect – the tool rect.


SetAGWFlags(agwFlags)[source]

Sets the toolbar art flags.

Parameters:agwFlags – 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 items
AUI_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 items
AUI_TB_VERTICAL The AuiToolBar is vertical
AUI_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 and AUI_TB_TEXT


SetDefaultColours(base_colour=None)[source]

Sets the default colours, which are calculated from the given base colour.

Parameters:base_colour – an instance of wx.Colour. If defaulted to None, a colour is generated accordingly to the platform and theme.


SetElementSize(element_id, size)[source]

Sets the size of a UI element in the AuiToolBar.

Parameters:
  • element_id – 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 – the new size of the UI element.


SetFont(font)[source]

Sets the AuiDefaultToolBarArt font.

Parameters:font – a wx.Font object.


SetOrientation(orientation)[source]

Sets the toolbar tool orientation.

Parameters:orientation – one of AUI_TBTOOL_HORIZONTAL, AUI_TBTOOL_VERT_CLOCKWISE or AUI_TBTOOL_VERT_COUNTERCLOCKWISE.


SetTextOrientation(orientation)[source]

Sets the text orientation.

Parameters:orientation – can be one of the following constants:


Orientation Switches Description
AUI_TBTOOL_TEXT_LEFT Text in AuiToolBar items is aligned left
AUI_TBTOOL_TEXT_RIGHT Text in AuiToolBar items is aligned right
AUI_TBTOOL_TEXT_TOP Text in AuiToolBar items is aligned top
AUI_TBTOOL_TEXT_BOTTOM Text in AuiToolBar items is aligned bottom


ShowDropDown(wnd, items)[source]

Shows the drop down window menu for overflow items.

Parameters:
  • wnd – an instance of wx.Window;

  • items – the overflow toolbar items (a Python list).
Tree

Table Of Contents

Previous topic

aui.auibar

Next topic

AuiToolBar