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 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604
|
.. 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.ribbon.buttonbar
.. highlight:: python
.. _wx.lib.agw.ribbon.buttonbar.RibbonButtonBar:
==========================================================================================================================================
|phoenix_title| **wx.lib.agw.ribbon.buttonbar.RibbonButtonBar**
==========================================================================================================================================
A ribbon button bar is similar to a traditional toolbar.
|
|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>RibbonButtonBar</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.ribbon.buttonbar.RibbonButtonBar_inheritance.png" alt="Inheritance diagram of RibbonButtonBar" usemap="#dummy" class="inheritance"/></center>
<script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
<map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.html" title="wx.lib.agw.ribbon.buttonbar.RibbonButtonBar" alt="" coords="5,469,321,499"/> <area shape="rect" id="node2" href="wx.lib.agw.ribbon.control.RibbonControl.html" title="wx.lib.agw.ribbon.control.RibbonControl" alt="" coords="23,392,304,421"/> <area shape="rect" id="node3" href="wx.Control.html" title="wx.Control" alt="" coords="117,315,209,344"/> <area shape="rect" id="node4" href="wx.Window.html" title="wx.Window" alt="" coords="115,237,212,267"/> <area shape="rect" id="node5" href="wx.WindowBase.html" title="wx.WindowBase" alt="" coords="99,160,228,189"/> <area shape="rect" id="node6" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="105,83,222,112"/> <area shape="rect" id="node7" href="wx.Object.html" title="wx.Object" alt="" coords="60,5,147,35"/> <area shape="rect" id="node8" href="wx.Trackable.html" title="wx.Trackable" alt="" coords="171,5,278,35"/> </map>
</p>
</div>
|
|appearance| Control Appearance
===============================
|
.. figure:: _static/images/widgets/fullsize/wxmsw/wx.lib.agw.ribbon.buttonbar.ribbonbuttonbar.png
:alt: wxMSW
:figclass: floatleft
**wxMSW**
.. figure:: _static/images/widgets/fullsize/wxmac/../no_appearance.png
:alt: wxMAC
:figclass: floatright
**wxMAC**
.. figure:: _static/images/widgets/fullsize/wxgtk/wx.lib.agw.ribbon.buttonbar.ribbonbuttonbar.png
:alt: wxGTK
:figclass: floatcenter
**wxGTK**
|
|super_classes| Known Superclasses
==================================
:class:`wx.lib.agw.ribbon.control.RibbonControl`
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.__init__` Default class constructor.
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.AddButton` Add a button to the button bar.
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.AddDropdownButton` Add a dropdown button to the button bar (simple version).
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.AddHybridButton` Add a hybrid button to the button bar (simple version).
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.AddSimpleButton` Add a button to the button bar (simple version).
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.AddToggleButton` Add a toggle button to the button bar.
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.ClearButtons` Delete all buttons from the button bar.
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.CommonInit` Common initialization procedures.
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.DeleteButton` Delete a single button from the button bar.
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.DoGetBestSize` Gets the size which best suits the window: for a control, it would be the
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.DoGetNextLargerSize` Implementation of :meth:`RibbonControl.GetNextLargerSize() <lib.agw.ribbon.control.RibbonControl.GetNextLargerSize>`.
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.DoGetNextSmallerSize` Implementation of :meth:`RibbonControl.GetNextSmallerSize() <lib.agw.ribbon.control.RibbonControl.GetNextSmallerSize>`.
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.EnableButton` Enable or disable a single button on the bar.
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.FetchButtonSizeInfo`
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.GetButtonCount` Returns the number of buttons in this :class:`RibbonButtonBar`.
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.GetDefaultBorder` Returns the default border style for :class:`RibbonButtonBar`.
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.GetMinSize` Returns the minimum size of the window, an indication to the sizer layout mechanism
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.InsertButton` Inserts a button in the button bar at the position specified by `pos`.
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.InsertDropdownButton` Inserts a dropdown button in the button bar at the position specified by `pos`.
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.InsertHybridButton` Inserts a hybrid button in the button bar at the position specified by `pos`.
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.InsertToggleButton` Inserts a toggle button in the button bar at the position specified by `pos`.
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.IsButtonEnabled` Returns whether a button in the bar is enabled or not.
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.IsSizingContinuous` Returns ``True`` if this window can take any size (greater than its minimum size),
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.MakeDisabledBitmap` Converts the `original` bitmap into a visually-looking disabled one.
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.MakeLayouts`
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.MakeResizedBitmap` Resize and scale the `original` bitmap to the dimensions specified in `size`.
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.OnEraseBackground` Handles the ``wx.EVT_ERASE_BACKGROUND`` event for :class:`RibbonButtonBar`.
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.OnMouseDown` Handles the ``wx.EVT_LEFT_DOWN`` event for :class:`RibbonButtonBar`.
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.OnMouseEnter` Handles the ``wx.EVT_ENTER_WINDOW`` event for :class:`RibbonButtonBar`.
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.OnMouseLeave` Handles the ``wx.EVT_LEAVE_WINDOW`` event for :class:`RibbonButtonBar`.
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.OnMouseMove` Handles the ``wx.EVT_MOTION`` event for :class:`RibbonButtonBar`.
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.OnMouseUp` Handles the ``wx.EVT_LEFT_UP`` event for :class:`RibbonButtonBar`.
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.OnPaint` Handles the ``wx.EVT_PAINT`` event for :class:`RibbonButtonBar`.
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.OnSize` Handles the ``wx.EVT_SIZE`` event for :class:`RibbonButtonBar`.
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.Realize` Calculate button layouts and positions.
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.SetArtProvider` Set the art provider to be used.
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.ToggleButton` Toggles/untoggles a :class:`RibbonButtonBar` toggle button.
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.TryCollapseLayout`
:meth:`~wx.lib.agw.ribbon.buttonbar.RibbonButtonBar.UpdateWindowUI` This function sends one or more :class:`UpdateUIEvent` to the window.
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: RibbonButtonBar(RibbonControl)
A ribbon button bar is similar to a traditional toolbar.
.. method:: __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, agwStyle=0)
Default class constructor.
:param `parent`: pointer to a parent window, typically a :class:`~wx.lib.agw.ribbon.panel.RibbonPanel`;
:type `parent`: :class:`wx.Window`
:param integer `id`: window identifier. If ``wx.ID_ANY``, will automatically create
an identifier;
:param `pos`: window position. ``wx.DefaultPosition`` indicates that wxPython
should generate a default position for the window;
:type `pos`: tuple or :class:`wx.Point`
:param `size`: window size. ``wx.DefaultSize`` indicates that wxPython should
generate a default size for the window. If no suitable size can be found, the
window will be sized to 20x20 pixels so that the window is visible but obviously
not correctly sized;
:type `size`: tuple or :class:`wx.Size`
:param integer `agwStyle`: the AGW-specific window style, currently unused.
.. method:: AddButton(self, button_id, label, bitmap, bitmap_small=wx.NullBitmap, bitmap_disabled=wx.NullBitmap, bitmap_small_disabled=wx.NullBitmap, kind=RIBBON_BUTTON_NORMAL, help_string="", client_data=None)
Add a button to the button bar.
:param integer `button_id`: id of the new button (used for event callbacks);
:param string `label`: label of the new button;
:param `bitmap`: large bitmap of the new button, an instance of :class:`wx.Bitmap`. Must be the same size as
all other large bitmaps used on the button bar;
:param `bitmap_small`: small bitmap of the new button, an instance of :class:`wx.Bitmap`. If left as :class:`NullBitmap`,
then a small bitmap will be automatically generated. Must be the same size
as all other small bitmaps used on the button bar;
:param `bitmap_disabled`: large bitmap of the new button when it is disabled, an instance of :class:`wx.Bitmap`.
If left as :class:`NullBitmap`, then a bitmap will be automatically generated from `bitmap`;
:param `bitmap_small_disabled`: small bitmap of the new button when it is disabled, an instance of :class:`wx.Bitmap`.
If left as :class:`NullBitmap`, then a bitmap will be automatically generated from `bitmap_small`;
:param integer `kind`: the kind of button to add, one of the following values:
========================================== =========== ==========================================
Button Kind Hex Value Description
========================================== =========== ==========================================
``RIBBON_BUTTON_NORMAL`` 0x1 Normal button or tool with a clickable area which causes some generic action.
``RIBBON_BUTTON_DROPDOWN`` 0x2 Dropdown button or tool with a clickable area which typically causes a dropdown menu.
``RIBBON_BUTTON_HYBRID`` 0x3 Button or tool with two clickable areas - one which causes a dropdown menu, and one which causes a generic action.
``RIBBON_BUTTON_TOGGLE`` 0x4 Normal button or tool with a clickable area which toggles the button between a pressed and unpressed state.
========================================== =========== ==========================================
:param string `help_string`: the UI help string to associate with the new button;
:param object `client_data`: client data to associate with the new button (any Python object).
:returns: An opaque pointer which can be used only with other button bar methods.
:see: :meth:`~RibbonButtonBar.InsertButton`, :meth:`~RibbonButtonBar.AddDropdownButton`, :meth:`~RibbonButtonBar.AddHybridButton`
.. method:: AddDropdownButton(self, button_id, label, bitmap, help_string="")
Add a dropdown button to the button bar (simple version).
:param integer `button_id`: id of the new button (used for event callbacks);
:param string `label`: label of the new button;
:param `bitmap`: large bitmap of the new button, an instance of :class:`wx.Bitmap`. Must be the same size as
all other large bitmaps used on the button bar;
:param string `help_string`: the UI help string to associate with the new button.
:returns: An opaque pointer which can be used only with other button bar methods.
:see: :meth:`~RibbonButtonBar.AddButton`, :meth:`~RibbonButtonBar.InsertDropdownButton`, :meth:`~RibbonButtonBar.InsertButton`
.. method:: AddHybridButton(self, button_id, label, bitmap, help_string="")
Add a hybrid button to the button bar (simple version).
:param integer `button_id`: id of the new button (used for event callbacks);
:param string `label`: label of the new button;
:param `bitmap`: large bitmap of the new button, an instance of :class:`wx.Bitmap`. Must be the same size as
all other large bitmaps used on the button bar;
:param string `help_string`: the UI help string to associate with the new button.
:returns: An opaque pointer which can be used only with other button bar methods.
:see: :meth:`~RibbonButtonBar.AddButton`, :meth:`~RibbonButtonBar.InsertButton`, :meth:`~RibbonButtonBar.InsertHybridButton`
.. method:: AddSimpleButton(self, button_id, label, bitmap, help_string, kind=RIBBON_BUTTON_NORMAL)
Add a button to the button bar (simple version).
:param integer `button_id`: id of the new button (used for event callbacks);
:param string `label`: label of the new button;
:param `bitmap`: large bitmap of the new button, an instance of :class:`wx.Bitmap`. Must be the same size as
all other large bitmaps used on the button bar;
:param string `help_string`: the UI help string to associate with the new button;
:param integer `kind`: the kind of button to add.
:returns: An opaque pointer which can be used only with other button bar methods.
:see: :meth:`~RibbonButtonBar.AddButton` for a list of valid button `kind` values.
.. method:: AddToggleButton(self, button_id, label, bitmap, help_string="")
Add a toggle button to the button bar.
:param integer `button_id`: id of the new button (used for event callbacks);
:param string `label`: label of the new button;
:param `bitmap`: large bitmap of the new button, an instance of :class:`wx.Bitmap`. Must be the same size as
all other large bitmaps used on the button bar;
:param string `help_string`: the UI help string to associate with the new button.
:returns: An opaque pointer which can be used only with other button bar methods.
:see: :meth:`~RibbonButtonBar.AddButton`, :meth:`~RibbonButtonBar.InsertButton`, :meth:`~RibbonButtonBar.InsertToggleButton`
.. method:: ClearButtons(self)
Delete all buttons from the button bar.
:see: :meth:`~RibbonButtonBar.DeleteButton`
.. method:: CommonInit(self, agwStyle)
Common initialization procedures.
:param integer `agwStyle`: the AGW-specific window style, currently unused.
.. method:: DeleteButton(self, button_id)
Delete a single button from the button bar.
:param integer `button_id`: id of the button to delete.
:return: ``True`` if the button has been found and successfully deleted, ``False`` otherwise.
:see: :meth:`~RibbonButtonBar.ClearButtons`
.. method:: DoGetBestSize(self)
Gets the size which best suits the window: for a control, it would be the
minimal size which doesn't truncate the control, for a panel - the same size
as it would have after a call to `Fit()`.
:return: An instance of :class:`wx.Size`.
:note: Overridden from :class:`wx.Control`.
.. method:: DoGetNextLargerSize(self, direction, _result)
Implementation of :meth:`RibbonControl.GetNextLargerSize() <lib.agw.ribbon.control.RibbonControl.GetNextLargerSize>`.
Controls which have non-continuous sizing must override this virtual function
rather than :meth:`RibbonControl.GetNextLargerSize() <lib.agw.ribbon.control.RibbonControl.GetNextLargerSize>`.
:return: An instance of :class:`wx.Size`.
.. method:: DoGetNextSmallerSize(self, direction, _result)
Implementation of :meth:`RibbonControl.GetNextSmallerSize() <lib.agw.ribbon.control.RibbonControl.GetNextSmallerSize>`.
Controls which have non-continuous sizing must override this virtual function
rather than :meth:`RibbonControl.GetNextSmallerSize() <lib.agw.ribbon.control.RibbonControl.GetNextSmallerSize>`.
:return: An instance of :class:`wx.Size`.
.. method:: EnableButton(self, button_id, enable=True)
Enable or disable a single button on the bar.
:param integer `button_id`: id of the button to enable or disable;
:param bool `enable`: ``True`` to enable the button, ``False`` to disable it.
:raise: `Exception` when the input `button_id` could not be associated
with a :class:`RibbonButtonBar` button.
.. method:: FetchButtonSizeInfo(self, button, size, dc)
.. method:: GetButtonCount(self)
Returns the number of buttons in this :class:`RibbonButtonBar`.
.. versionadded:: 0.9.5
.. method:: GetDefaultBorder(self)
Returns the default border style for :class:`RibbonButtonBar`.
.. method:: GetMinSize(self)
Returns the minimum size of the window, an indication to the sizer layout mechanism
that this is the minimum required size.
This method normally just returns the value set by `SetMinSize`, but it can be
overridden to do the calculation on demand.
:return: An instance of :class:`wx.Size`.
.. method:: InsertButton(self, pos, button_id, label, bitmap, bitmap_small=wx.NullBitmap, bitmap_disabled=wx.NullBitmap, bitmap_small_disabled=wx.NullBitmap, kind=RIBBON_BUTTON_NORMAL, help_string="", client_data=None)
Inserts a button in the button bar at the position specified by `pos`.
:param integer `pos`: the position at which the new button must be inserted (zero-based);
:param integer `button_id`: id of the new button (used for event callbacks);
:param string `label`: label of the new button;
:param `bitmap`: large bitmap of the new button, an instance of :class:`wx.Bitmap`. Must be the same size as
all other large bitmaps used on the button bar;
:param `bitmap_small`: small bitmap of the new button, an instance of :class:`wx.Bitmap`. If left as :class:`NullBitmap`,
then a small bitmap will be automatically generated. Must be the same size
as all other small bitmaps used on the button bar;
:param `bitmap_disabled`: large bitmap of the new button when it is disabled, an instance of :class:`wx.Bitmap`.
If left as :class:`NullBitmap`, then a bitmap will be automatically generated from `bitmap`;
:param `bitmap_small_disabled`: small bitmap of the new button when it is disabled, an instance of :class:`wx.Bitmap`.
If left as :class:`NullBitmap`, then a bitmap will be automatically generated from `bitmap_small`;
:param integer `kind`: the kind of button to add;
:param string `help_string`: the UI help string to associate with the new button;
:param object `client_data`: client data to associate with the new button.
:returns: An opaque pointer which can be used only with other button bar methods.
:raise: `Exception` if both `bitmap` and `bitmap_small` are invalid or if the input `help_string` is not
a valid Python `basestring`.
:see: :meth:`~RibbonButtonBar.AddDropdownButton`, :meth:`~RibbonButtonBar.AddHybridButton` and :meth:`~RibbonButtonBar.AddButton` for a list of valid button `kind` values.
.. versionadded:: 0.9.5
.. method:: InsertDropdownButton(self, pos, button_id, label, bitmap, help_string="")
Inserts a dropdown button in the button bar at the position specified by `pos`.
:param integer `pos`: the position at which the new button must be inserted (zero-based);
:param integer `button_id`: id of the new button (used for event callbacks);
:param string `label`: label of the new button;
:param `bitmap`: large bitmap of the new button, an instance of :class:`wx.Bitmap`. Must be the same size as
all other large bitmaps used on the button bar;
:param string `help_string`: the UI help string to associate with the new button.
:returns: An opaque pointer which can be used only with other button bar methods.
:see: :meth:`~RibbonButtonBar.AddButton`, :meth:`~RibbonButtonBar.InsertButton`, :meth:`~RibbonButtonBar.AddDropdownButton`
.. versionadded:: 0.9.5
.. method:: InsertHybridButton(self, pos, button_id, label, bitmap, help_string="")
Inserts a hybrid button in the button bar at the position specified by `pos`.
:param integer `pos`: the position at which the new button must be inserted (zero-based);
:param integer `button_id`: id of the new button (used for event callbacks);
:param string `label`: label of the new button;
:param `bitmap`: large bitmap of the new button, an instance of :class:`wx.Bitmap`. Must be the same size as
all other large bitmaps used on the button bar;
:param string `help_string`: the UI help string to associate with the new button.
:returns: An opaque pointer which can be used only with other button bar methods.
:see: :meth:`~RibbonButtonBar.AddButton`, :meth:`~RibbonButtonBar.InsertButton`, :meth:`~RibbonButtonBar.AddHybridButton`
.. versionadded:: 0.9.5
.. method:: InsertToggleButton(self, pos, button_id, label, bitmap, help_string="")
Inserts a toggle button in the button bar at the position specified by `pos`.
:param integer `pos`: the position at which the new button must be inserted (zero-based);
:param integer `button_id`: id of the new button (used for event callbacks);
:param string `label`: label of the new button;
:param `bitmap`: large bitmap of the new button, an instance of :class:`wx.Bitmap`. Must be the same size as
all other large bitmaps used on the button bar;
:param string `help_string`: the UI help string to associate with the new button.
:returns: An opaque pointer which can be used only with other button bar methods.
:see: :meth:`~RibbonButtonBar.AddButton`, :meth:`~RibbonButtonBar.InsertButton`, :meth:`~RibbonButtonBar.AddToggleButton`
.. versionadded:: 0.9.5
.. method:: IsButtonEnabled(self, button_id)
Returns whether a button in the bar is enabled or not.
:param integer `button_id`: id of the button to check.
:return: ``True`` if the button is enabled, ``False`` otherwise.
:raise: `Exception` when the input `button_id` could not be associated
with a :class:`RibbonButtonBar` button.
.. method:: IsSizingContinuous(self)
Returns ``True`` if this window can take any size (greater than its minimum size),
``False`` if it can only take certain sizes.
:see: :meth:`RibbonControl.GetNextSmallerSize() <lib.agw.ribbon.control.RibbonControl.GetNextSmallerSize>`,
:meth:`RibbonControl.GetNextLargerSize() <lib.agw.ribbon.control.RibbonControl.GetNextLargerSize>`
.. method:: MakeDisabledBitmap(self, original)
Converts the `original` bitmap into a visually-looking disabled one.
:param `original`: the original bitmap, an instance of :class:`wx.Bitmap`.
:return: A visually-looking disabled representation of the input bitmap.
.. method:: MakeLayouts(self)
.. method:: MakeResizedBitmap(self, original, size)
Resize and scale the `original` bitmap to the dimensions specified in `size`.
:param `original`: the original bitmap, an instance of :class:`wx.Bitmap`;
:param `size`: the size to which the input bitmap must be rescaled, an instance of :class:`wx.Size`.
:return: A scaled representation of the input bitmap.
.. method:: OnEraseBackground(self, event)
Handles the ``wx.EVT_ERASE_BACKGROUND`` event for :class:`RibbonButtonBar`.
:param `event`: a :class:`EraseEvent` event to be processed.
.. method:: OnMouseDown(self, event)
Handles the ``wx.EVT_LEFT_DOWN`` event for :class:`RibbonButtonBar`.
:param `event`: a :class:`MouseEvent` event to be processed.
.. method:: OnMouseEnter(self, event)
Handles the ``wx.EVT_ENTER_WINDOW`` event for :class:`RibbonButtonBar`.
:param `event`: a :class:`MouseEvent` event to be processed.
.. method:: OnMouseLeave(self, event)
Handles the ``wx.EVT_LEAVE_WINDOW`` event for :class:`RibbonButtonBar`.
:param `event`: a :class:`MouseEvent` event to be processed.
.. method:: OnMouseMove(self, event)
Handles the ``wx.EVT_MOTION`` event for :class:`RibbonButtonBar`.
:param `event`: a :class:`MouseEvent` event to be processed.
.. method:: OnMouseUp(self, event)
Handles the ``wx.EVT_LEFT_UP`` event for :class:`RibbonButtonBar`.
:param `event`: a :class:`MouseEvent` event to be processed.
.. method:: OnPaint(self, event)
Handles the ``wx.EVT_PAINT`` event for :class:`RibbonButtonBar`.
:param `event`: a :class:`PaintEvent` event to be processed.
.. method:: OnSize(self, event)
Handles the ``wx.EVT_SIZE`` event for :class:`RibbonButtonBar`.
:param `event`: a :class:`wx.SizeEvent` event to be processed.
.. method:: Realize(self)
Calculate button layouts and positions.
Must be called after buttons are added to the button bar, as otherwise the newly
added buttons will not be displayed. In normal situations, it will be called
automatically when :meth:`RibbonBar.Realize() <lib.agw.ribbon.bar.RibbonBar.Realize>` is called.
:note: Reimplemented from :class:`~wx.lib.agw.ribbon.control.RibbonControl`.
.. method:: SetArtProvider(self, art)
Set the art provider to be used.
In many cases, setting the art provider will also set the art provider on all
child windows which extend :class:`~wx.lib.agw.ribbon.control.RibbonControl`. In most cases, controls will not
take ownership of the given pointer, with the notable exception being
:meth:`RibbonBar.SetArtProvider() <lib.agw.ribbon.bar.RibbonBar.SetArtProvider>`.
:param `art`: an art provider.
.. method:: ToggleButton(self, button_id, checked=True)
Toggles/untoggles a :class:`RibbonButtonBar` toggle button.
:param integer `button_id`: id of the button to be toggles/untoggled;
:param bool `checked`: ``True`` to toggle the button, ``False`` to untoggle it.
:raise: `Exception` when the input `button_id` could not be associated
with a :class:`RibbonButtonBar` button.
.. method:: TryCollapseLayout(self, original, first_btn, last_button=None)
.. method:: UpdateWindowUI(self, flags)
This function sends one or more :class:`UpdateUIEvent` to the window.
The particular implementation depends on the window; for example a :class:`ToolBar` will
send an update UI event for each toolbar button, and a :class:`wx.Frame` will send an
update UI event for each menubar menu item.
You can call this function from your application to ensure that your UI is up-to-date
at this point (as far as your :class:`UpdateUIEvent` handlers are concerned). This may be
necessary if you have called :meth:`UpdateUIEvent.SetMode` or :meth:`UpdateUIEvent.SetUpdateInterval`
to limit the overhead that wxWidgets incurs by sending update UI events in idle time.
:param integer `flags`: should be a bitlist of one or more of ``wx.UPDATE_UI_NONE``,
``wx.UPDATE_UI_RECURSE`` or ``wx.UPDATE_UI_FROMIDLE``.
If you are calling this function from an `OnInternalIdle` or `OnIdle` function, make sure
you pass the ``wx.UPDATE_UI_FROMIDLE`` flag, since this tells the window to only update
the UI elements that need to be updated in idle time. Some windows update their elements
only when necessary, for example when a menu is about to be shown. The following is an
example of how to call :meth:`~RibbonButtonBar.UpdateWindowUI` from an idle function::
def OnInternalIdle(self):
if wx.UpdateUIEvent.CanUpdate(self):
self.UpdateWindowUI(wx.UPDATE_UI_FROMIDLE)
.. versionadded:: 0.9.5
|