.. 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
.. _wx.ToolBarToolBase:
==========================================================================================================================================
|phoenix_title| **wx.ToolBarToolBase**
==========================================================================================================================================
A toolbar tool represents one item on the toolbar.
It has a unique id (except for the separators), 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.
Notice that the toolbar can `not` be modified by changing its tools via the (intentionally undocumented here) setter methods of this class, all the modifications must be done using the methods of :ref:`wx.ToolBar` itself.
|
|class_hierarchy| Class Hierarchy
=================================
.. raw:: html

Inheritance diagram for class
ToolBarToolBase:
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.ToolBarToolBase.__init__`
:meth:`~wx.ToolBarToolBase.Attach`
:meth:`~wx.ToolBarToolBase.CanBeToggled`
:meth:`~wx.ToolBarToolBase.Detach`
:meth:`~wx.ToolBarToolBase.Enable`
:meth:`~wx.ToolBarToolBase.GetBitmap`
:meth:`~wx.ToolBarToolBase.GetClientData`
:meth:`~wx.ToolBarToolBase.GetControl`
:meth:`~wx.ToolBarToolBase.GetDisabledBitmap`
:meth:`~wx.ToolBarToolBase.GetDisabledBitmapBundle` Return the bundle containing disabled tool bitmaps.
:meth:`~wx.ToolBarToolBase.GetDropdownMenu`
:meth:`~wx.ToolBarToolBase.GetId`
:meth:`~wx.ToolBarToolBase.GetKind`
:meth:`~wx.ToolBarToolBase.GetLabel`
:meth:`~wx.ToolBarToolBase.GetLongHelp`
:meth:`~wx.ToolBarToolBase.GetNormalBitmap`
:meth:`~wx.ToolBarToolBase.GetNormalBitmapBundle` Return the bundle containing normal tool bitmaps.
:meth:`~wx.ToolBarToolBase.GetShortHelp`
:meth:`~wx.ToolBarToolBase.GetStyle`
:meth:`~wx.ToolBarToolBase.GetToolBar` Return the toolbar this tool is a member of.
:meth:`~wx.ToolBarToolBase.IsButton`
:meth:`~wx.ToolBarToolBase.IsControl`
:meth:`~wx.ToolBarToolBase.IsEnabled`
:meth:`~wx.ToolBarToolBase.IsSeparator`
:meth:`~wx.ToolBarToolBase.IsStretchable`
:meth:`~wx.ToolBarToolBase.IsStretchableSpace`
:meth:`~wx.ToolBarToolBase.IsToggled`
:meth:`~wx.ToolBarToolBase.MakeStretchable`
:meth:`~wx.ToolBarToolBase.SetClientData`
:meth:`~wx.ToolBarToolBase.SetDisabledBitmap`
:meth:`~wx.ToolBarToolBase.SetDropdownMenu`
:meth:`~wx.ToolBarToolBase.SetLabel`
:meth:`~wx.ToolBarToolBase.SetLongHelp`
:meth:`~wx.ToolBarToolBase.SetNormalBitmap`
:meth:`~wx.ToolBarToolBase.SetShortHelp`
:meth:`~wx.ToolBarToolBase.SetToggle`
:meth:`~wx.ToolBarToolBase.Toggle`
================================================================================ ================================================================================
|
|property_summary| Properties Summary
=====================================
================================================================================ ================================================================================
:attr:`~wx.ToolBarToolBase.Bitmap` See :meth:`~wx.ToolBarToolBase.GetBitmap`
:attr:`~wx.ToolBarToolBase.ClientData` See :meth:`~wx.ToolBarToolBase.GetClientData` and :meth:`~wx.ToolBarToolBase.SetClientData`
:attr:`~wx.ToolBarToolBase.Control` See :meth:`~wx.ToolBarToolBase.GetControl`
:attr:`~wx.ToolBarToolBase.DisabledBitmap` See :meth:`~wx.ToolBarToolBase.GetDisabledBitmap` and :meth:`~wx.ToolBarToolBase.SetDisabledBitmap`
:attr:`~wx.ToolBarToolBase.DisabledBitmapBundle` See :meth:`~wx.ToolBarToolBase.GetDisabledBitmapBundle`
:attr:`~wx.ToolBarToolBase.DropdownMenu` See :meth:`~wx.ToolBarToolBase.GetDropdownMenu` and :meth:`~wx.ToolBarToolBase.SetDropdownMenu`
:attr:`~wx.ToolBarToolBase.Id` See :meth:`~wx.ToolBarToolBase.GetId`
:attr:`~wx.ToolBarToolBase.Kind` See :meth:`~wx.ToolBarToolBase.GetKind`
:attr:`~wx.ToolBarToolBase.Label` See :meth:`~wx.ToolBarToolBase.GetLabel` and :meth:`~wx.ToolBarToolBase.SetLabel`
:attr:`~wx.ToolBarToolBase.LongHelp` See :meth:`~wx.ToolBarToolBase.GetLongHelp` and :meth:`~wx.ToolBarToolBase.SetLongHelp`
:attr:`~wx.ToolBarToolBase.NormalBitmap` See :meth:`~wx.ToolBarToolBase.GetNormalBitmap` and :meth:`~wx.ToolBarToolBase.SetNormalBitmap`
:attr:`~wx.ToolBarToolBase.NormalBitmapBundle` See :meth:`~wx.ToolBarToolBase.GetNormalBitmapBundle`
:attr:`~wx.ToolBarToolBase.ShortHelp` See :meth:`~wx.ToolBarToolBase.GetShortHelp` and :meth:`~wx.ToolBarToolBase.SetShortHelp`
:attr:`~wx.ToolBarToolBase.Style` See :meth:`~wx.ToolBarToolBase.GetStyle`
:attr:`~wx.ToolBarToolBase.ToolBar` See :meth:`~wx.ToolBarToolBase.GetToolBar`
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: wx.ToolBarToolBase(Object)
**Possible constructors**::
ToolBarToolBase(tbar: Optional[ToolBar]=None, toolid: int=ID_SEPARATOR,
label: str='', bmpNormal: BitmapBundle=NullBitmap, bmpDisabled:
BitmapBundle=NullBitmap, kind: ItemKind=ITEM_NORMAL, clientData:
Optional[PyUserData]=None, shortHelpString: str='', longHelpString:
str='') -> None
ToolBarToolBase(tbar : ToolBar, control : Control, label : str) -> None
A toolbar tool represents one item on the toolbar.
.. method:: __init__(self, *args, **kw)
|overload| **Overloaded Implementations:**
:html:`
`
**__init__** `(self, tbar: Optional[ToolBar]=None, toolid: int=ID_SEPARATOR, label: str='', bmpNormal: BitmapBundle=NullBitmap, bmpDisabled: BitmapBundle=NullBitmap, kind: ItemKind=ITEM_NORMAL, clientData: Optional[PyUserData]=None, shortHelpString: str='', longHelpString: str='')`
:param `tbar`:
:type `tbar`: wx.ToolBar
:param `toolid`:
:type `toolid`: int
:param `label`:
:type `label`: string
:param `bmpNormal`:
:type `bmpNormal`: wx.BitmapBundle
:param `bmpDisabled`:
:type `bmpDisabled`: wx.BitmapBundle
:param `kind`:
:type `kind`: wx.ItemKind
:param `clientData`:
:type `clientData`: PyUserData
:param `shortHelpString`:
:type `shortHelpString`: string
:param `longHelpString`:
:type `longHelpString`: string
:rtype: `None`
:html:`
`
**__init__** `(self, tbar : ToolBar, control : Control, label : str)`
:param `tbar`:
:type `tbar`: wx.ToolBar
:param `control`:
:type `control`: wx.Control
:param `label`:
:type `label`: string
:rtype: `None`
:html:`
`
.. method:: Attach(self, tbar : ToolBar)
:param `tbar`:
:type `tbar`: wx.ToolBar
:rtype: `None`
.. method:: CanBeToggled(self)
:rtype: `bool`
.. method:: Detach(self)
:rtype: `None`
.. method:: Enable(self, enable : bool)
:param `enable`:
:type `enable`: bool
:rtype: `bool`
.. method:: GetBitmap(self)
:rtype: :ref:`wx.Bitmap`
.. method:: GetClientData(self)
:rtype: `PyUserData`
.. method:: GetControl(self)
:rtype: :ref:`wx.Control`
.. method:: GetDisabledBitmap(self)
:rtype: :ref:`wx.Bitmap`
.. method:: GetDisabledBitmapBundle(self)
Return the bundle containing disabled tool bitmaps.
This bundle may be invalid if the tool doesn't show a bitmap or doesn't have a specific disabled bitmap creates one automatically from the normal bitmap.
:rtype: :ref:`wx.BitmapBundle`
.. versionadded:: 4.1/wxWidgets-3.1.6
.. method:: GetDropdownMenu(self)
:rtype: :ref:`wx.Menu`
.. method:: GetId(self)
:rtype: `int`
.. method:: GetKind(self)
:rtype: :ref:`wx.ItemKind`
.. method:: GetLabel(self)
:rtype: `str`
.. method:: GetLongHelp(self)
:rtype: `str`
.. method:: GetNormalBitmap(self)
:rtype: :ref:`wx.Bitmap`
.. method:: GetNormalBitmapBundle(self)
Return the bundle containing normal tool bitmaps.
This bundle may be invalid if the tool doesn't show a bitmap.
:rtype: :ref:`wx.BitmapBundle`
.. versionadded:: 4.1/wxWidgets-3.1.6
.. method:: GetShortHelp(self)
:rtype: `str`
.. method:: GetStyle(self)
:rtype: `int`
.. method:: GetToolBar(self)
Return the toolbar this tool is a member of.
:rtype: :ref:`wx.ToolBar`
.. method:: IsButton(self)
:rtype: `bool`
.. method:: IsControl(self)
:rtype: `bool`
.. method:: IsEnabled(self)
:rtype: `bool`
.. method:: IsSeparator(self)
:rtype: `bool`
.. method:: IsStretchable(self)
:rtype: `bool`
.. method:: IsStretchableSpace(self)
:rtype: `bool`
.. method:: IsToggled(self)
:rtype: `bool`
.. method:: MakeStretchable(self)
:rtype: `None`
.. method:: SetClientData(self, clientData : PyUserData)
:param `clientData`:
:type `clientData`: PyUserData
:rtype: `None`
.. method:: SetDisabledBitmap(self, bmp : BitmapBundle)
:param `bmp`:
:type `bmp`: wx.BitmapBundle
:rtype: `None`
.. method:: SetDropdownMenu(self, menu : Menu)
:param `menu`:
:type `menu`: wx.Menu
:rtype: `None`
.. method:: SetLabel(self, label : str)
:param `label`:
:type `label`: string
:rtype: `None`
.. method:: SetLongHelp(self, help : str)
:param `help`:
:type `help`: string
:rtype: `bool`
.. method:: SetNormalBitmap(self, bmp : BitmapBundle)
:param `bmp`:
:type `bmp`: wx.BitmapBundle
:rtype: `None`
.. method:: SetShortHelp(self, help : str)
:param `help`:
:type `help`: string
:rtype: `bool`
.. method:: SetToggle(self, toggle : bool)
:param `toggle`:
:type `toggle`: bool
:rtype: `bool`
.. method:: Toggle(self, *args, **kw)
|overload| **Overloaded Implementations:**
:html:`
`
**Toggle** `(self, toggle : bool)`
:param `toggle`:
:type `toggle`: bool
:rtype: `bool`
:html:`
`
**Toggle** `(self)`
:rtype: `None`
:html:`
`
.. attribute:: Bitmap
See :meth:`~wx.ToolBarToolBase.GetBitmap`
.. attribute:: ClientData
See :meth:`~wx.ToolBarToolBase.GetClientData` and :meth:`~wx.ToolBarToolBase.SetClientData`
.. attribute:: Control
See :meth:`~wx.ToolBarToolBase.GetControl`
.. attribute:: DisabledBitmap
See :meth:`~wx.ToolBarToolBase.GetDisabledBitmap` and :meth:`~wx.ToolBarToolBase.SetDisabledBitmap`
.. attribute:: DisabledBitmapBundle
See :meth:`~wx.ToolBarToolBase.GetDisabledBitmapBundle`
.. attribute:: DropdownMenu
See :meth:`~wx.ToolBarToolBase.GetDropdownMenu` and :meth:`~wx.ToolBarToolBase.SetDropdownMenu`
.. attribute:: Id
See :meth:`~wx.ToolBarToolBase.GetId`
.. attribute:: Kind
See :meth:`~wx.ToolBarToolBase.GetKind`
.. attribute:: Label
See :meth:`~wx.ToolBarToolBase.GetLabel` and :meth:`~wx.ToolBarToolBase.SetLabel`
.. attribute:: LongHelp
See :meth:`~wx.ToolBarToolBase.GetLongHelp` and :meth:`~wx.ToolBarToolBase.SetLongHelp`
.. attribute:: NormalBitmap
See :meth:`~wx.ToolBarToolBase.GetNormalBitmap` and :meth:`~wx.ToolBarToolBase.SetNormalBitmap`
.. attribute:: NormalBitmapBundle
See :meth:`~wx.ToolBarToolBase.GetNormalBitmapBundle`
.. attribute:: ShortHelp
See :meth:`~wx.ToolBarToolBase.GetShortHelp` and :meth:`~wx.ToolBarToolBase.SetShortHelp`
.. attribute:: Style
See :meth:`~wx.ToolBarToolBase.GetStyle`
.. attribute:: ToolBar
See :meth:`~wx.ToolBarToolBase.GetToolBar`