.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2020 by Total Control Software
License: wxWindows License
.. include:: headings.inc
.. currentmodule:: wx.lib.agw.aui.auibar
.. highlight:: python
.. _wx.lib.agw.aui.auibar.AuiDefaultToolBarArt:
==========================================================================================================================================
|phoenix_title| **wx.lib.agw.aui.auibar.AuiDefaultToolBarArt**
==========================================================================================================================================
Toolbar art provider code - a tab provider provides all drawing functionality to the :class:`AuiToolBar`.
This allows the :class:`AuiToolBar` to have a pluggable look-and-feel.
By default, a :class:`AuiToolBar` uses an instance of this class called :class:`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 :meth:`AuiToolBar.SetArtProvider` to make use this new tab art.
|
|class_hierarchy| Class Hierarchy
=================================
.. raw:: html

Inheritance diagram for class
AuiDefaultToolBarArt:
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.lib.agw.aui.auibar.AuiDefaultToolBarArt.__init__` Default class constructor.
:meth:`~wx.lib.agw.aui.auibar.AuiDefaultToolBarArt.Clone` Clones the :class:`AuiDefaultToolBarArt` art.
:meth:`~wx.lib.agw.aui.auibar.AuiDefaultToolBarArt.DrawBackground` Draws a toolbar background with a gradient shading.
:meth:`~wx.lib.agw.aui.auibar.AuiDefaultToolBarArt.DrawButton` Draws a toolbar item button.
:meth:`~wx.lib.agw.aui.auibar.AuiDefaultToolBarArt.DrawControlLabel` Draws a label for a toolbar control.
:meth:`~wx.lib.agw.aui.auibar.AuiDefaultToolBarArt.DrawDropDownButton` Draws a toolbar dropdown button.
:meth:`~wx.lib.agw.aui.auibar.AuiDefaultToolBarArt.DrawGripper` Draws the toolbar gripper.
:meth:`~wx.lib.agw.aui.auibar.AuiDefaultToolBarArt.DrawLabel` Draws a toolbar item label.
:meth:`~wx.lib.agw.aui.auibar.AuiDefaultToolBarArt.DrawOverflowButton` Draws the overflow button for the :class:`AuiToolBar`.
:meth:`~wx.lib.agw.aui.auibar.AuiDefaultToolBarArt.DrawPlainBackground` Draws a toolbar background with a plain colour.
:meth:`~wx.lib.agw.aui.auibar.AuiDefaultToolBarArt.DrawSeparator` Draws a toolbar separator.
:meth:`~wx.lib.agw.aui.auibar.AuiDefaultToolBarArt.GetAGWFlags` Returns the :class:`AuiDefaultToolBarArt` flags.
:meth:`~wx.lib.agw.aui.auibar.AuiDefaultToolBarArt.GetElementSize` Returns the size of a UI element in the :class:`AuiToolBar`.
:meth:`~wx.lib.agw.aui.auibar.AuiDefaultToolBarArt.GetFont` Returns the :class:`AuiDefaultToolBarArt` font.
:meth:`~wx.lib.agw.aui.auibar.AuiDefaultToolBarArt.GetLabelSize` Returns the label size for a toolbar item.
:meth:`~wx.lib.agw.aui.auibar.AuiDefaultToolBarArt.GetOrientation` Returns the toolbar orientation.
:meth:`~wx.lib.agw.aui.auibar.AuiDefaultToolBarArt.GetTextOrientation` Returns the :class:`AuiDefaultToolBarArt` text orientation.
:meth:`~wx.lib.agw.aui.auibar.AuiDefaultToolBarArt.GetToolSize` Returns the toolbar item size.
:meth:`~wx.lib.agw.aui.auibar.AuiDefaultToolBarArt.GetToolsPosition` Returns the bitmap and text rectangles for a toolbar item.
:meth:`~wx.lib.agw.aui.auibar.AuiDefaultToolBarArt.SetAGWFlags` Sets the toolbar art flags.
:meth:`~wx.lib.agw.aui.auibar.AuiDefaultToolBarArt.SetDefaultColours` Sets the default colours, which are calculated from the given base colour.
:meth:`~wx.lib.agw.aui.auibar.AuiDefaultToolBarArt.SetElementSize` Sets the size of a UI element in the :class:`AuiToolBar`.
:meth:`~wx.lib.agw.aui.auibar.AuiDefaultToolBarArt.SetFont` Sets the :class:`AuiDefaultToolBarArt` font.
:meth:`~wx.lib.agw.aui.auibar.AuiDefaultToolBarArt.SetOrientation` Sets the toolbar tool orientation.
:meth:`~wx.lib.agw.aui.auibar.AuiDefaultToolBarArt.SetTextOrientation` Sets the text orientation.
:meth:`~wx.lib.agw.aui.auibar.AuiDefaultToolBarArt.ShowDropDown` Shows the drop down window menu for overflow items.
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: AuiDefaultToolBarArt(object)
Toolbar art provider code - a tab provider provides all drawing functionality to the :class:`AuiToolBar`.
This allows the :class:`AuiToolBar` to have a pluggable look-and-feel.
By default, a :class:`AuiToolBar` uses an instance of this class called :class:`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 :meth:`AuiToolBar.SetArtProvider` to make use this new tab art.
.. method:: __init__(self)
Default class constructor.
.. method:: Clone(self)
Clones the :class:`AuiDefaultToolBarArt` art.
.. method:: DrawBackground(self, dc, wnd, _rect, horizontal=True)
Draws a toolbar background with a gradient shading.
:param `dc`: a :class:`wx.DC` device context;
:param `wnd`: a :class:`wx.Window` derived window;
:param wx.Rect `_rect`: the :class:`AuiToolBarItem` rectangle;
:param bool `horizontal`: ``True`` if the toolbar is horizontal, ``False`` if it is vertical.
.. method:: DrawButton(self, dc, wnd, item, rect)
Draws a toolbar item button.
:param `dc`: a :class:`wx.DC` device context;
:param `wnd`: a :class:`wx.Window` derived window;
:param `item`: an instance of :class:`AuiToolBarItem`;
:param wx.Rect `rect`: the :class:`AuiToolBarItem` rectangle.
.. method:: DrawControlLabel(self, dc, wnd, item, rect)
Draws a label for a toolbar control.
:param `dc`: a :class:`wx.DC` device context;
:param `wnd`: a :class:`wx.Window` derived window;
:param `item`: an instance of :class:`AuiToolBarItem`;
:param wx.Rect `rect`: the :class:`AuiToolBarItem` rectangle.
.. method:: DrawDropDownButton(self, dc, wnd, item, rect)
Draws a toolbar dropdown button.
:param `dc`: a :class:`wx.DC` device context;
:param `wnd`: a :class:`wx.Window` derived window;
:param `item`: an instance of :class:`AuiToolBarItem`;
:param wx.Rect `rect`: the :class:`AuiToolBarItem` rectangle.
.. method:: DrawGripper(self, dc, wnd, rect)
Draws the toolbar gripper.
:param `dc`: a :class:`wx.DC` device context;
:param `wnd`: a :class:`wx.Window` derived window;
:param wx.Rect `rect`: the :class:`AuiToolBarItem` rectangle.
.. method:: DrawLabel(self, dc, wnd, item, rect)
Draws a toolbar item label.
:param `dc`: a :class:`wx.DC` device context;
:param `wnd`: a :class:`wx.Window` derived window;
:param `item`: an instance of :class:`AuiToolBarItem`;
:param wx.Rect `rect`: the :class:`AuiToolBarItem` rectangle.
.. method:: DrawOverflowButton(self, dc, wnd, rect, state)
Draws the overflow button for the :class:`AuiToolBar`.
:param `dc`: a :class:`wx.DC` device context;
:param `wnd`: a :class:`wx.Window` derived window;
:param wx.Rect `rect`: the :class:`AuiToolBarItem` rectangle;
:param integer `state`: the overflow button state.
.. method:: DrawPlainBackground(self, dc, wnd, _rect)
Draws a toolbar background with a plain colour.
This method contrasts with the default behaviour of the :class:`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 :class:`AuiToolBar` within a :class:`StaticBoxSizer` that has a plain background).
:param `dc`: a :class:`wx.DC` device context;
:param `wnd`: a :class:`wx.Window` derived window;
:param wx.Rect `_rect`: the :class:`AuiToolBarItem` rectangle.
.. method:: DrawSeparator(self, dc, wnd, _rect)
Draws a toolbar separator.
:param `dc`: a :class:`wx.DC` device context;
:param `wnd`: a :class:`wx.Window` derived window;
:param wx.Rect `_rect`: the :class:`AuiToolBarItem` rectangle.
.. method:: GetAGWFlags(self)
Returns the :class:`AuiDefaultToolBarArt` flags.
.. seealso:: :meth:`~AuiDefaultToolBarArt.SetAGWFlags` for more details.
.. method:: GetElementSize(self, element_id)
Returns the size of a UI element in the :class:`AuiToolBar`.
:param integer `element_id`: can be one of the following:
==================================== ==================================
Element Identifier Description
==================================== ==================================
``AUI_TBART_SEPARATOR_SIZE`` Separator size in :class:`AuiToolBar`
``AUI_TBART_GRIPPER_SIZE`` Gripper size in :class:`AuiToolBar`
``AUI_TBART_OVERFLOW_SIZE`` Overflow button size in :class:`AuiToolBar`
==================================== ==================================
.. method:: GetFont(self)
Returns the :class:`AuiDefaultToolBarArt` font.
.. method:: GetLabelSize(self, dc, wnd, item)
Returns the label size for a toolbar item.
:param `dc`: a :class:`wx.DC` device context;
:param `wnd`: a :class:`wx.Window` derived window;
:param `item`: an instance of :class:`AuiToolBarItem`.
.. method:: GetOrientation(self)
Returns the toolbar orientation.
.. method:: GetTextOrientation(self)
Returns the :class:`AuiDefaultToolBarArt` text orientation.
.. seealso:: :meth:`~AuiDefaultToolBarArt.SetTextOrientation` for more details.
.. method:: GetToolSize(self, dc, wnd, item)
Returns the toolbar item size.
:param `dc`: a :class:`wx.DC` device context;
:param `wnd`: a :class:`wx.Window` derived window;
:param `item`: an instance of :class:`AuiToolBarItem`.
.. method:: GetToolsPosition(self, dc, item, rect)
Returns the bitmap and text rectangles for a toolbar item.
:param `dc`: a :class:`wx.DC` device context;
:param `item`: an instance of :class:`AuiToolBarItem`;
:param wx.Rect `rect`: the tool rectangle.
.. method:: SetAGWFlags(self, agwFlags)
Sets the toolbar art flags.
:param integer `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 :class:`AuiToolBar` items
``AUI_TB_NO_AUTORESIZE`` Do not auto-resize the :class:`AuiToolBar`
``AUI_TB_GRIPPER`` Shows a gripper on the :class:`AuiToolBar`
``AUI_TB_OVERFLOW`` The :class:`AuiToolBar` can contain overflow items
``AUI_TB_VERTICAL`` The :class:`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``
==================================== ==================================
.. method:: SetDefaultColours(self, base_colour=None)
Sets the default colours, which are calculated from the given base colour.
:param `base_colour`: an instance of :class:`wx.Colour`. If defaulted to ``None``, a colour
is generated accordingly to the platform and theme.
.. method:: SetElementSize(self, element_id, size)
Sets the size of a UI element in the :class:`AuiToolBar`.
:param integer `element_id`: can be one of the following:
==================================== ==================================
Element Identifier Description
==================================== ==================================
``AUI_TBART_SEPARATOR_SIZE`` Separator size in :class:`AuiToolBar`
``AUI_TBART_GRIPPER_SIZE`` Gripper size in :class:`AuiToolBar`
``AUI_TBART_OVERFLOW_SIZE`` Overflow button size in :class:`AuiToolBar`
==================================== ==================================
:param integer `size`: the new size of the UI element.
.. method:: SetFont(self, font)
Sets the :class:`AuiDefaultToolBarArt` font.
:param wx.Font `font`: the font used for displaying toolbar item labels.
.. method:: SetOrientation(self, orientation)
Sets the toolbar tool orientation.
:param integer `orientation`: one of ``AUI_TBTOOL_HORIZONTAL``, ``AUI_TBTOOL_VERT_CLOCKWISE`` or
``AUI_TBTOOL_VERT_COUNTERCLOCKWISE``.
.. method:: SetTextOrientation(self, orientation)
Sets the text orientation.
:param integer `orientation`: can be one of the following constants:
==================================== ==================================
Orientation Switches Description
==================================== ==================================
``AUI_TBTOOL_TEXT_LEFT`` Text in :class:`AuiToolBar` items is aligned left
``AUI_TBTOOL_TEXT_RIGHT`` Text in :class:`AuiToolBar` items is aligned right
``AUI_TBTOOL_TEXT_TOP`` Text in :class:`AuiToolBar` items is aligned top
``AUI_TBTOOL_TEXT_BOTTOM`` Text in :class:`AuiToolBar` items is aligned bottom
==================================== ==================================
.. method:: ShowDropDown(self, wnd, items)
Shows the drop down window menu for overflow items.
:param `wnd`: an instance of :class:`wx.Window`;
:param list `items`: a list of the overflow toolbar items.