1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259
|
.. 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.
|