.. wxPython Phoenix documentation

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

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

.. include:: headings.inc

.. currentmodule:: wx.lib.agw.flatmenu

.. highlight:: python



.. _wx.lib.agw.flatmenu.FlatToolbarItem:

==========================================================================================================================================
|phoenix_title|  **wx.lib.agw.flatmenu.FlatToolbarItem**
==========================================================================================================================================

This class represents a toolbar item.



|

|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>FlatToolbarItem</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.flatmenu.FlatToolbarItem_inheritance.png" alt="Inheritance diagram of FlatToolbarItem" 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.flatmenu.FlatToolbarItem.html" title="wx.lib.agw.flatmenu.FlatToolbarItem" alt="" coords="5,5,251,35"/> </map> 
   </p>

|


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

================================================================================ ================================================================================
:meth:`~wx.lib.agw.flatmenu.FlatToolbarItem.__init__`                            Default class constructor.
:meth:`~wx.lib.agw.flatmenu.FlatToolbarItem.Enable`                              Enables or disables the tool.
:meth:`~wx.lib.agw.flatmenu.FlatToolbarItem.GetBitmap`                           Returns the tool bitmap.
:meth:`~wx.lib.agw.flatmenu.FlatToolbarItem.GetCustomControl`                    Returns the associated custom control.
:meth:`~wx.lib.agw.flatmenu.FlatToolbarItem.GetDisabledBitmap`                   Returns the tool disabled bitmap.
:meth:`~wx.lib.agw.flatmenu.FlatToolbarItem.GetGroup`                            Returns group id for radio item, or -1 for other item types.
:meth:`~wx.lib.agw.flatmenu.FlatToolbarItem.GetId`                               Gets the tool id.
:meth:`~wx.lib.agw.flatmenu.FlatToolbarItem.GetLabel`                            Returns the tool label.
:meth:`~wx.lib.agw.flatmenu.FlatToolbarItem.GetLongHelp`                         Returns the tool long help string (displayed in the parent frame :class:`StatusBar`).
:meth:`~wx.lib.agw.flatmenu.FlatToolbarItem.GetShortHelp`                        Returns the tool short help string (displayed in the tool's tooltip).
:meth:`~wx.lib.agw.flatmenu.FlatToolbarItem.IsChecked`                           Same as :meth:`~FlatToolbarItem.IsSelected`. More intuitive for check items though.
:meth:`~wx.lib.agw.flatmenu.FlatToolbarItem.IsCheckItem`                         Returns ``True`` if the item is a radio item.
:meth:`~wx.lib.agw.flatmenu.FlatToolbarItem.IsCustomControl`                     Returns whether the tool is a custom control or not.
:meth:`~wx.lib.agw.flatmenu.FlatToolbarItem.IsEnabled`                           Returns whether the tool is enabled or not.
:meth:`~wx.lib.agw.flatmenu.FlatToolbarItem.IsRadioItem`                         Returns ``True`` if the item is a radio item.
:meth:`~wx.lib.agw.flatmenu.FlatToolbarItem.IsRegularItem`                       Returns whether the tool is a standard tool or not.
:meth:`~wx.lib.agw.flatmenu.FlatToolbarItem.IsSelected`                          Returns whether the tool is selected or checked.
:meth:`~wx.lib.agw.flatmenu.FlatToolbarItem.IsSeparator`                         Returns whether the tool is a separator or not.
:meth:`~wx.lib.agw.flatmenu.FlatToolbarItem.Select`                              Selects or checks a radio or check item.
:meth:`~wx.lib.agw.flatmenu.FlatToolbarItem.SetBitmap`                           Sets the tool bitmap.
:meth:`~wx.lib.agw.flatmenu.FlatToolbarItem.SetDisabledBitmap`                   Sets the tool disabled bitmap.
:meth:`~wx.lib.agw.flatmenu.FlatToolbarItem.SetGroup`                            Sets group id for a radio item, for other items does nothing.
:meth:`~wx.lib.agw.flatmenu.FlatToolbarItem.SetLabel`                            Sets the tool label.
:meth:`~wx.lib.agw.flatmenu.FlatToolbarItem.SetLongHelp`                         Sets the tool long help string (displayed in the parent frame :class:`StatusBar`).
:meth:`~wx.lib.agw.flatmenu.FlatToolbarItem.SetShortHelp`                        Sets the tool short help string (displayed in the tool's tooltip).
:meth:`~wx.lib.agw.flatmenu.FlatToolbarItem.Toggle`                              Toggles a check item.
================================================================================ ================================================================================


|


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


.. class:: FlatToolbarItem(object)

   This class represents a toolbar item.

   .. method:: __init__(self, controlType=None, id=wx.ID_ANY, label="", disabledBmp=wx.NullBitmap, kind=wx.ITEM_NORMAL, shortHelp="", longHelp="")

      Default class constructor.
      
      :param `controlType`: can be ``None`` for a toolbar separator, an instance
       of :class:`wx.Window` for a control or an instance of :class:`wx.Bitmap` for a standard
       toolbar tool;
      :param integer `id`: the toolbar tool id. If set to ``wx.ID_ANY``, a new id is
       automatically assigned;
      :param string `label`: the toolbar tool label;
      :param `disabledBmp`: the bitmap used when the tool is disabled. If the tool
       is a standard one (i.e., not a control or a separator), and `disabledBmp`
       is equal to :class:`NullBitmap`, the disabled bitmap is automatically generated
       by greing the normal one;
      :param integer `kind`: may be ``wx.ITEM_NORMAL`` for a normal button (default),
       ``wx.ITEM_CHECK`` for a checkable tool (such tool stays pressed after it had been
       toggled) or ``wx.ITEM_RADIO`` for a checkable tool which makes part of a radio
       group of tools each of which is automatically unchecked whenever another button
       in the group is checked;
      :param string `shortHelp`: a string used for the tool's tooltip;
      :param string `longHelp`: this string is shown in the :class:`StatusBar` (if any) of the
       parent frame when the mouse pointer is inside the tool.


   .. method:: Enable(self, enable=True)

      Enables or disables the tool.
      
      :param bool `enable`: ``True`` to enable the tool, ``False`` to disable it.


   .. method:: GetBitmap(self)

      Returns the tool bitmap. 


   .. method:: GetCustomControl(self)

      Returns the associated custom control. 


   .. method:: GetDisabledBitmap(self)

      Returns the tool disabled bitmap. 


   .. method:: GetGroup(self)

      Returns group id for radio item, or -1 for other item types. 


   .. method:: GetId(self)

      Gets the tool id. 


   .. method:: GetLabel(self)

      Returns the tool label. 


   .. method:: GetLongHelp(self)

      Returns the tool long help string (displayed in the parent frame :class:`StatusBar`). 


   .. method:: GetShortHelp(self)

      Returns the tool short help string (displayed in the tool's tooltip). 


   .. method:: IsChecked(self)

      Same as :meth:`~FlatToolbarItem.IsSelected`. More intuitive for check items though. 


   .. method:: IsCheckItem(self)

      Returns ``True`` if the item is a radio item. 


   .. method:: IsCustomControl(self)

      Returns whether the tool is a custom control or not. 


   .. method:: IsEnabled(self)

      Returns whether the tool is enabled or not. 


   .. method:: IsRadioItem(self)

      Returns ``True`` if the item is a radio item. 


   .. method:: IsRegularItem(self)

      Returns whether the tool is a standard tool or not. 


   .. method:: IsSelected(self)

      Returns whether the tool is selected or checked.


   .. method:: IsSeparator(self)

      Returns whether the tool is a separator or not. 


   .. method:: Select(self, select=True)

      Selects or checks a radio or check item.
      
      :param bool `select`: ``True`` to select or check a tool, ``False`` to unselect
       or uncheck it.


   .. method:: SetBitmap(self, bmp)

      Sets the tool bitmap.
      
      :param `bmp`: the new tool bitmap, a valid :class:`wx.Bitmap` object.


   .. method:: SetDisabledBitmap(self, bmp)

      Sets the tool disabled bitmap.
      
      :param `bmp`: the new tool disabled bitmap, a valid :class:`wx.Bitmap` object.


   .. method:: SetGroup(self, group)

      Sets group id for a radio item, for other items does nothing.
      
      :param `group`: an instance of :class:`FlatMenuItemGroup`.


   .. method:: SetLabel(self, label)

      Sets the tool label.
      
      :param string `label`: the new tool string.


   .. method:: SetLongHelp(self, help)

      Sets the tool long help string (displayed in the parent frame :class:`StatusBar`).
      
      :param string `help`: the new tool long help string.


   .. method:: SetShortHelp(self, help)

      Sets the tool short help string (displayed in the tool's tooltip).
      
      :param string `help`: the new tool short help string.


   .. method:: Toggle(self)

      Toggles a check item. 


