.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2017 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc

.. currentmodule:: wx.lib.agw.aui.auibar

.. highlight:: python



.. _wx.lib.agw.aui.auibar.AuiToolBarItem:

==========================================================================================================================================
|phoenix_title|  **wx.lib.agw.aui.auibar.AuiToolBarItem**
==========================================================================================================================================

AuiToolBarItem is a toolbar element.

It has a unique id (except for the separators which always have id = -1), the
style (telling whether it is a normal button, separator or a control), the
state (toggled or not, enabled or not) and short and long help strings. The
default implementations use the short help string for the tooltip text which
is popped up when the mouse pointer enters the tool and the long help string
for the applications status bar.



|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>AuiToolBarItem</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.lib.agw.aui.auibar.AuiToolBarItem_inheritance.png" alt="Inheritance diagram of AuiToolBarItem" usemap="#dummy" class="inheritance"/></center>
   </div>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.lib.agw.aui.auibar.AuiToolBarItem.html" title="wx.lib.agw.aui.auibar.AuiToolBarItem" alt="" coords="5,5,253,35"/> </map> 
   </p>

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.__init__`                           Default class constructor.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.Assign`                             Assigns the properties of the :class:`AuiToolBarItem` `c` to `self`.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.GetAlignment`                       Returns the toolbar item alignment.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.GetBitmap`                          Returns the toolbar item bitmap.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.GetDisabledBitmap`                  Returns the toolbar item disabled bitmap.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.GetHoverBitmap`                     Returns the toolbar item hover bitmap.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.GetId`                              Returns the toolbar item identifier.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.GetKind`                            Returns the toolbar item kind.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.GetLabel`                           Returns the toolbar item label.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.GetLongHelp`                        Returns the long help string for the :class:`AuiToolBarItem`.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.GetMinSize`                         Returns the toolbar item minimum size.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.GetOrientation`                     Returns the toolbar tool orientation.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.GetProportion`                      Returns the :class:`AuiToolBarItem` proportion in the toolbar.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.GetRotatedBitmap`                   Returns the correct bitmap depending on the tool orientation.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.GetShortHelp`                       Returns the short help string for the :class:`AuiToolBarItem`.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.GetSizerItem`                       Returns the associated sizer item.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.GetSpacerPixels`                    Returns the number of pixels for a toolbar item with kind = ``ITEM_SEPARATOR``.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.GetState`                           Returns the toolbar item state.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.GetUserData`                        Returns the associated user data.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.GetWindow`                          Returns window associated to the toolbar item.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.HasDropDown`                        Returns whether the toolbar item has an associated dropdown menu or not.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.IsActive`                           Returns whether the toolbar item is active or not.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.IsSticky`                           Returns whether the toolbar item has a sticky behaviour or not.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.SetActive`                          Activates/deactivates the toolbar item.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.SetAlignment`                       Sets the toolbar item alignment.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.SetBitmap`                          Sets the toolbar item bitmap.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.SetDisabledBitmap`                  Sets the toolbar item disabled bitmap.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.SetHasDropDown`                     Sets whether the toolbar item has an associated dropdown menu.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.SetHoverBitmap`                     Sets the toolbar item hover bitmap.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.SetId`                              Sets the toolbar item identifier.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.SetKind`                            Sets the :class:`AuiToolBarItem` kind.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.SetLabel`                           Sets the toolbar item label.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.SetLongHelp`                        Sets the long help string for the toolbar item. This string is shown in the
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.SetMinSize`                         Sets the toolbar item minimum size.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.SetOrientation`                     Sets the toolbar tool orientation.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.SetProportion`                      Sets the :class:`AuiToolBarItem` proportion in the toolbar.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.SetShortHelp`                       Sets the short help string for the :class:`AuiToolBarItem`, to be displayed in a
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.SetSizerItem`                       Associates a sizer item to this toolbar item.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.SetSpacerPixels`                    Sets the number of pixels for a toolbar item with kind = ``ITEM_SEPARATOR``.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.SetState`                           Sets the toolbar item state.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.SetSticky`                          Sets whether the toolbar item is sticky (permanent highlight after mouse enter)
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.SetUserData`                        Associates some kind of user data to the toolbar item.
:meth:`~wx.lib.agw.aui.auibar.AuiToolBarItem.SetWindow`                          Assigns a window to the toolbar item.
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: AuiToolBarItem(object)

   AuiToolBarItem is a toolbar element.
   
   It has a unique id (except for the separators which always have id = -1), the
   style (telling whether it is a normal button, separator or a control), the
   state (toggled or not, enabled or not) and short and long help strings. The
   default implementations use the short help string for the tooltip text which
   is popped up when the mouse pointer enters the tool and the long help string
   for the applications status bar.

   .. method:: __init__(self, item=None)

      Default class constructor.
      
      :param `item`: another instance of :class:`AuiToolBarItem`.


   .. method:: Assign(self, c)

      Assigns the properties of the :class:`AuiToolBarItem` `c` to `self`.
      
      :param `c`: another instance of :class:`AuiToolBarItem`.


   .. method:: GetAlignment(self)

      Returns the toolbar item alignment. 


   .. method:: GetBitmap(self)

      Returns the toolbar item bitmap. 


   .. method:: GetDisabledBitmap(self)

      Returns the toolbar item disabled bitmap. 


   .. method:: GetHoverBitmap(self)

      Returns the toolbar item hover bitmap. 


   .. method:: GetId(self)

      Returns the toolbar item identifier. 


   .. method:: GetKind(self)

      Returns the toolbar item kind.
      
      See :meth:`SetKind` for more details.


   .. method:: GetLabel(self)

      Returns the toolbar item label. 


   .. method:: GetLongHelp(self)

      Returns the long help string for the :class:`AuiToolBarItem`. 


   .. method:: GetMinSize(self)

      Returns the toolbar item minimum size. 


   .. method:: GetOrientation(self)

      Returns the toolbar tool orientation. 


   .. method:: GetProportion(self)

      Returns the :class:`AuiToolBarItem` proportion in the toolbar. 


   .. method:: GetRotatedBitmap(self, disabled)

      Returns the correct bitmap depending on the tool orientation.
      
      :param bool `disabled`: whether to return the disabled bitmap or not.


   .. method:: GetShortHelp(self)

      Returns the short help string for the :class:`AuiToolBarItem`. 


   .. method:: GetSizerItem(self)

      Returns the associated sizer item. 


   .. method:: GetSpacerPixels(self)

      Returns the number of pixels for a toolbar item with kind = ``ITEM_SEPARATOR``. 


   .. method:: GetState(self)

      Returns the toolbar item state.
      
      :see: :meth:`SetState` for more details.


   .. method:: GetUserData(self)

      Returns the associated user data. 


   .. method:: GetWindow(self)

      Returns window associated to the toolbar item. 


   .. method:: HasDropDown(self)

      Returns whether the toolbar item has an associated dropdown menu or not. 


   .. method:: IsActive(self)

      Returns whether the toolbar item is active or not. 


   .. method:: IsSticky(self)

      Returns whether the toolbar item has a sticky behaviour or not. 


   .. method:: SetActive(self, b)

      Activates/deactivates the toolbar item.
      
      :param bool `b`: ``True`` to activate the item, ``False`` to deactivate it.


   .. method:: SetAlignment(self, align)

      Sets the toolbar item alignment.
      
      :param integer `align`: the item alignment, which can be one of the available :class:`wx.Sizer`
       alignments.


   .. method:: SetBitmap(self, bmp)

      Sets the toolbar item bitmap.
      
      :param wx.Bitmap `bmp`: the image associated with this :class:`AuiToolBarItem`.


   .. method:: SetDisabledBitmap(self, bmp)

      Sets the toolbar item disabled bitmap.
      
      :param wx.Bitmap `bmp`: the disabled image associated with this :class:`AuiToolBarItem`.


   .. method:: SetHasDropDown(self, b)

      Sets whether the toolbar item has an associated dropdown menu.
      
      :param bool `b`: ``True`` to set a dropdown menu, ``False`` otherwise.


   .. method:: SetHoverBitmap(self, bmp)

      Sets the toolbar item hover bitmap.
      
      :param wx.Bitmap `bmp`: the hover image associated with this :class:`AuiToolBarItem`.


   .. method:: SetId(self, new_id)

      Sets the toolbar item identifier.
      
      :param integer `new_id`: the new tool id.


   .. method:: SetKind(self, new_kind)

      Sets the :class:`AuiToolBarItem` kind.
      
      :param integer `new_kind`: can be one of the following items:
      
       ========================  =============================
       Item Kind                 Description
       ========================  =============================
       ``ITEM_CONTROL``          The item in the :class:`AuiToolBar` is a control
       ``ITEM_LABEL``            The item in the :class:`AuiToolBar` is a text label
       ``ITEM_SPACER``           The item in the :class:`AuiToolBar` is a spacer
       ``ITEM_SEPARATOR``        The item in the :class:`AuiToolBar` is a separator
       ``ITEM_CHECK``            The item in the :class:`AuiToolBar` is a toolbar check item
       ``ITEM_NORMAL``           The item in the :class:`AuiToolBar` is a standard toolbar item
       ``ITEM_RADIO``            The item in the :class:`AuiToolBar` is a toolbar radio item
       ========================  =============================


   .. method:: SetLabel(self, s)

      Sets the toolbar item label.
      
      :param string `s`: the toolbar item label.


   .. method:: SetLongHelp(self, s)

      Sets the long help string for the toolbar item. This string is shown in the
      statusbar (if any) of the parent frame when the mouse pointer is inside the
      tool.
      
      :param string `s`: the tool long help string.


   .. method:: SetMinSize(self, s)

      Sets the toolbar item minimum size.
      
      :param wx.Size `s`: the toolbar item minimum size.


   .. method:: SetOrientation(self, a)

      Sets the toolbar tool orientation.
      
      :param integer `a`: one of ``AUI_TBTOOL_HORIZONTAL``, ``AUI_TBTOOL_VERT_CLOCKWISE`` or
       ``AUI_TBTOOL_VERT_COUNTERCLOCKWISE``.


   .. method:: SetProportion(self, p)

      Sets the :class:`AuiToolBarItem` proportion in the toolbar.
      
      :param integer `p`: the item proportion.


   .. method:: SetShortHelp(self, s)

      Sets the short help string for the :class:`AuiToolBarItem`, to be displayed in a
      :class:`ToolTip` when the mouse hover over the toolbar item.
      
      :param string `s`: the tool short help string.


   .. method:: SetSizerItem(self, s)

      Associates a sizer item to this toolbar item.
      
      :param `s`: an instance of :class:`wx.SizerItem`.


   .. method:: SetSpacerPixels(self, s)

      Sets the number of pixels for a toolbar item with kind = ``ITEM_SEPARATOR``.
      
      :param integer `s`: number of pixels.


   .. method:: SetState(self, new_state)

      Sets the toolbar item state.
      
      :param `new_state`: can be one of the following states:
      
       ============================================  ======================================
       Button State Constant                         Description
       ============================================  ======================================
       ``AUI_BUTTON_STATE_NORMAL``                   Normal button state
       ``AUI_BUTTON_STATE_HOVER``                    Hovered button state
       ``AUI_BUTTON_STATE_PRESSED``                  Pressed button state
       ``AUI_BUTTON_STATE_DISABLED``                 Disabled button state
       ``AUI_BUTTON_STATE_HIDDEN``                   Hidden button state
       ``AUI_BUTTON_STATE_CHECKED``                  Checked button state
       ============================================  ======================================


   .. method:: SetSticky(self, b)

      Sets whether the toolbar item is sticky (permanent highlight after mouse enter)
      or not.
      
      :param bool `b`: ``True`` to set the item as sticky, ``False`` otherwise.


   .. method:: SetUserData(self, data)

      Associates some kind of user data to the toolbar item.
      
      :param PyObject `data`: a Python object.
      
      :note: The user data can be any Python object.


   .. method:: SetWindow(self, w)

      Assigns a window to the toolbar item.
      
      :param wx.Window `w`: associate this window `w` to the :class:`AuiToolBarItem`.


