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 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721
|
.. 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.genericmessagedialog
.. highlight:: python
.. _wx.lib.agw.genericmessagedialog.GenericMessageDialog:
==========================================================================================================================================
|phoenix_title| **wx.lib.agw.genericmessagedialog.GenericMessageDialog**
==========================================================================================================================================
Main class implementation, :class:`GenericMessageDialog` is a possible replacement
for the standard :class:`MessageDialog`.
|
|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>GenericMessageDialog</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.genericmessagedialog.GenericMessageDialog_inheritance.png" alt="Inheritance diagram of GenericMessageDialog" 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.Trackable.html" title="wx.Trackable" alt="" coords="88,5,189,35"/> <area shape="rect" id="node2" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="140,83,251,112"/> <area shape="rect" id="node4" href="wx.WindowBase.html" title="wx.WindowBase" alt="" coords="135,160,256,189"/> <area shape="rect" id="node3" href="wx.Object.html" title="wx.Object" alt="" coords="213,5,295,35"/> <area shape="rect" id="node7" href="wx.Window.html" title="wx.Window" alt="" coords="151,237,240,267"/> <area shape="rect" id="node5" href="wx.lib.agw.genericmessagedialog.GenericMessageDialog.html" title="wx.lib.agw.genericmessagedialog.GenericMessageDialog" alt="" coords="5,547,387,576"/> <area shape="rect" id="node6" href="wx.Dialog.html" title="wx.Dialog" alt="" coords="155,469,236,499"/> <area shape="rect" id="node9" href="wx.NonOwnedWindow.html" title="wx.NonOwnedWindow" alt="" coords="117,315,275,344"/> <area shape="rect" id="node8" href="wx.TopLevelWindow.html" title="wx.TopLevelWindow" alt="" coords="125,392,267,421"/> </map>
</p>
|
|appearance| Control Appearance
===============================
|
.. figure:: _static/images/widgets/fullsize/wxmsw/wx.lib.agw.genericmessagedialog.genericmessagedialog.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/../no_appearance.png
:alt: wxGTK
:figclass: floatcenter
**wxGTK**
|
|super_classes| Known Superclasses
==================================
:class:`wx.Dialog`
|
|method_summary| Methods Summary
================================
======================================================================================== ================================================================================
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.__init__` Default class constructor. Use :meth:`~GenericMessageDialog.ShowModal` to show the dialog.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.CreateButtonSizer` Creates a sizer with standard buttons.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.CreateMessageDialog` Actually creates the :class:`GenericMessageDialog`, just before showing it on screen.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.CreateSeparatedButtonSizer` Creates a sizer with standard buttons using :meth:`~GenericMessageDialog.CreateButtonSizer` separated
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.CreateStdDialogButtonSizer` Creates a :class:`StdDialogButtonSizer` with standard buttons.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.EndDialog` Ends the :class:`GenericMessageDialog` life. This will be done differently depending on
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.GetCaption` Returns the main caption (the title) for :class:`GenericMessageDialog`.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.GetCustomCancelBitmap` If a custom icon been used for the ``Cancel`` button, this method will return
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.GetCustomCancelLabel` If a custom label has been used for the ``Cancel`` button, this method will return
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.GetCustomHelpBitmap` If a custom icon has been used for the ``Help`` button, this method will return
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.GetCustomHelpLabel` If a custom label has been used for the ``Help`` button, this method will return
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.GetCustomNoBitmap` If a custom icon has been used for the ``No`` button, this method will return
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.GetCustomNoLabel` If a custom label has been used for the ``No`` button, this method will return
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.GetCustomOKBitmap` If a custom icon has been used for the ``OK`` button, this method will return
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.GetCustomOKLabel` If a custom label has been used for the ``OK`` button, this method will return
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.GetCustomYesBitmap` If a custom icon has been used for the ``Yes`` button, this method will return
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.GetCustomYesLabel` If a custom label has been used for the ``Yes`` button, this method will return
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.GetDefaultCancelBitmap` Returns the default icon for the ``Cancel`` button.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.GetDefaultCancelLabel` Returns the default label for the ``Cancel`` button.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.GetDefaultHelpBitmap` Returns the default icon for the ``Help`` button.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.GetDefaultHelpLabel` Returns the default label for the ``Help`` button.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.GetDefaultNoBitmap` Returns the default icon for the ``No`` button.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.GetDefaultNoLabel` Returns the default label for the ``No`` button.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.GetDefaultOKBitmap` Returns the default icon for the ``OK`` button.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.GetDefaultOKLabel` Returns the default label for the ``OK`` button.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.GetDefaultYesBitmap` Returns the default icon for the ``Yes`` button.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.GetDefaultYesLabel` Returns the default label for the ``Yes`` button.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.GetExtendedMessage` Returns a string representing the extended :class:`GenericMessageDialog` message.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.GetFullMessage` Returns a string representing the combination of the main :class:`GenericMessageDialog`
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.GetMessage` Returns a string representing the main :class:`GenericMessageDialog` message.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.GetMessageDialogStyle` Returns the AGW-specific window style for :class:`GenericMessageDialog`.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.HasCustomBitmaps` Returns ``True`` if any of the buttons have a non-default icons.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.HasCustomLabels` Returns ``True`` if any of the buttons have a non-default label.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.OnCancel` :class:`GenericMessageDialog` had received a ``wx.ID_CANCEL`` answer.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.OnHelp` :class:`GenericMessageDialog` had received a ``wx.ID_HELP`` answer.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.OnKeyDown` Handles the ``wx.EVT_KEY_DOWN`` event for :class:`GenericMessageDialog`.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.OnNavigation` Handles the ``wx.EVT_NAVIGATION_KEY`` event for :class:`GenericMessageDialog`.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.OnNo` :class:`GenericMessageDialog` had received a ``wx.ID_NO`` answer.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.OnOk` :class:`GenericMessageDialog` had received a ``wx.ID_OK`` answer.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.OnYes` :class:`GenericMessageDialog` had received a ``wx.ID_YES`` answer.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.SetExtendedMessage` Sets the extended message for the dialog: this message is usually an extension of the
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.SetHelpBitmap` Overrides the default icon of the ``Help`` button.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.SetHelpLabel` Overrides the default label of the ``Help`` button.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.SetMessage` Sets the message shown by the dialog.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.SetOKBitmap` Overrides the default icon of the ``OK`` button.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.SetOKCancelBitmaps` Overrides the default icons of the ``OK`` and ``Cancel`` buttons.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.SetOKCancelLabels` Overrides the default labels of the ``OK`` and ``Cancel`` buttons.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.SetOKLabel` Overrides the default label of the ``OK`` button.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.SetYesNoBitmaps` Overrides the default icons of the ``Yes`` and ``No`` buttons.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.SetYesNoCancelBitmaps` Overrides the default icons of the ``Yes`` and ``No`` buttons.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.SetYesNoCancelLabels` Overrides the default labels of the ``Yes`` and ``No`` buttons.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.SetYesNoLabels` Overrides the default labels of the ``Yes`` and ``No`` buttons.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.ShowModal` Shows the dialog, returning one of ``wx.ID_OK``, ``wx.ID_CANCEL``, ``wx.ID_YES``,
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.SwitchFocus` Switch focus between buttons.
:meth:`~wx.lib.agw.genericmessagedialog.GenericMessageDialog.WrapMessage` Wraps the input message to multi lines so that the resulting new message
======================================================================================== ================================================================================
|
|api| Class API
===============
.. class:: GenericMessageDialog(wx.Dialog)
Main class implementation, :class:`GenericMessageDialog` is a possible replacement
for the standard :class:`MessageDialog`.
.. method:: __init__(self, parent, message, caption, agwStyle, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_DIALOG_STYLE|wx.WANTS_CHARS, wrap=-1)
Default class constructor. Use :meth:`~GenericMessageDialog.ShowModal` to show the dialog.
:param `parent`: the :class:`GenericMessageDialog` parent (if any);
:param `message`: the message in the main body of the dialog;
:param `caption`: the dialog title;
:param `agwStyle`: the AGW-specific dialog style; it can be one of the
following bits:
=========================== =========== ==================================================
Window Styles Hex Value Description
=========================== =========== ==================================================
``GMD_DEFAULT`` 0 Uses normal generic buttons
``GMD_USE_AQUABUTTONS`` 0x20 Uses :class:`~wx.lib.agw.aquabutton.AquaButton` buttons instead of generic buttons.
``GMD_USE_GRADIENTBUTTONS`` 0x40 Uses :class:`~wx.lib.agw.gradientbutton.GradientButton` buttons instead of generic buttons.
=========================== =========== ==================================================
The styles above are mutually exclusive. The style chosen above can be combined with a
bitlist containing flags chosen from the following:
=========================== =========== ==================================================
Window Styles Hex Value Description
=========================== =========== ==================================================
``wx.OK`` 0x4 Shows an ``OK`` button.
``wx.CANCEL`` 0x10 Shows a ``Cancel`` button.
``wx.YES_NO`` 0xA Show ``Yes`` and ``No`` buttons.
``wx.YES_DEFAULT`` 0x0 Used with ``wx.YES_NO``, makes ``Yes`` button the default - which is the default behaviour.
``wx.NO_DEFAULT`` 0x80 Used with ``wx.YES_NO``, makes ``No`` button the default.
``wx.ICON_EXCLAMATION`` 0x100 Shows an exclamation mark icon.
``wx.ICON_HAND`` 0x200 Shows an error icon.
``wx.ICON_ERROR`` 0x200 Shows an error icon - the same as ``wx.ICON_HAND``.
``wx.ICON_QUESTION`` 0x400 Shows a question mark icon.
``wx.ICON_INFORMATION`` 0x800 Shows an information icon.
=========================== =========== ==================================================
:param `pos`: the dialog position on screen;
:param `size`: the dialog size;
:param `style`: the underlying :class:`Dialog` style;
:param `wrap`: if set greater than zero, wraps the string in `message` so that
every line is at most `wrap` pixels long.
:note: Notice that not all styles are compatible: only one of ``wx.OK`` and ``wx.YES_NO`` may be
specified (and one of them must be specified) and at most one default button style can be used
and it is only valid if the corresponding button is shown in the message box.
.. method:: CreateButtonSizer(self, flags)
Creates a sizer with standard buttons.
:param `flags`: a bit list of the following flags:
================= ========= ==========================
Flags Hex Value Description
================= ========= ==========================
``wx.YES`` 0x2 Show a ``Yes`` button
``wx.OK`` 0x4 Show an ``OK`` button
``wx.NO`` 0x8 Show a ``No`` button
``wx.CANCEL`` 0x10 Show a ``Cancel`` button
``wx.NO_DEFAULT`` 0x80 Used with ``wx.YES`` and ``wx.NO``, makes ``No`` button the default
``wx.HELP`` 0x8000 Show a ``Help`` button
================= ========= ==========================
:note: The sizer lays out the buttons in a manner appropriate to the platform.
.. method:: CreateMessageDialog(self)
Actually creates the :class:`GenericMessageDialog`, just before showing it on screen.
.. method:: CreateSeparatedButtonSizer(self, flags)
Creates a sizer with standard buttons using :meth:`~GenericMessageDialog.CreateButtonSizer` separated
from the rest of the dialog contents by a horizontal :class:`StaticLine`.
:param `flags`: the button sizer flags.
:see: :meth:`~GenericMessageDialog.CreateButtonSizer` for a list of valid flags.
.. method:: CreateStdDialogButtonSizer(self, flags)
Creates a :class:`StdDialogButtonSizer` with standard buttons.
:param `flags`: the button sizer flags.
:see: :meth:`~GenericMessageDialog.CreateButtonSizer` for a list of valid flags.
:note: The sizer lays out the buttons in a manner appropriate to the platform.
.. method:: EndDialog(self, rc)
Ends the :class:`GenericMessageDialog` life. This will be done differently depending on
the dialog modal/non-modal behaviour.
:param `rc`: one of the ``wx.ID_YES``, ``wx.ID_NO``, ``wx.ID_OK``, ``wx.ID_CANCEL`` constants.
:note: the `rc` parameter is unused if the dialog is not modal.
.. method:: GetCaption(self)
Returns the main caption (the title) for :class:`GenericMessageDialog`.
.. versionadded:: 0.9.3
.. method:: GetCustomCancelBitmap(self)
If a custom icon been used for the ``Cancel`` button, this method will return
it as an instance of :class:`wx.Bitmap`. Otherwise, the default one (as defined in
:meth:`~GenericMessageDialog.GetDefaultCancelBitmap`) is returned.
.. versionadded:: 0.9.3
.. method:: GetCustomCancelLabel(self)
If a custom label has been used for the ``Cancel`` button, this method will return
it as a string. Otherwise, the default one (as defined in :meth:`~GenericMessageDialog.GetDefaultCancelLabel`)
is returned.
.. versionadded:: 0.9.3
.. method:: GetCustomHelpBitmap(self)
If a custom icon has been used for the ``Help`` button, this method will return
it as an instance of :class:`wx.Bitmap`. Otherwise, the default one (as defined in
:meth:`~GenericMessageDialog.GetDefaultHelpBitmap`) is returned.
.. versionadded:: 0.9.3
.. method:: GetCustomHelpLabel(self)
If a custom label has been used for the ``Help`` button, this method will return
it as a string. Otherwise, the default one (as defined in :meth:`~GenericMessageDialog.GetDefaultHelpLabel`)
is returned.
.. versionadded:: 0.9.3
.. method:: GetCustomNoBitmap(self)
If a custom icon has been used for the ``No`` button, this method will return
it as an instance of :class:`wx.Bitmap`. Otherwise, the default one (as defined in
:meth:`~GenericMessageDialog.GetDefaultNoBitmap`) is returned.
.. versionadded:: 0.9.3
.. method:: GetCustomNoLabel(self)
If a custom label has been used for the ``No`` button, this method will return
it as a string. Otherwise, the default one (as defined in :meth:`~GenericMessageDialog.GetDefaultNoLabel`)
is returned.
.. versionadded:: 0.9.3
.. method:: GetCustomOKBitmap(self)
If a custom icon has been used for the ``OK`` button, this method will return
it as an instance of :class:`wx.Bitmap`. Otherwise, the default one (as defined in
:meth:`~GenericMessageDialog.GetDefaultOKBitmap`) is returned.
.. versionadded:: 0.9.3
.. method:: GetCustomOKLabel(self)
If a custom label has been used for the ``OK`` button, this method will return
it as a string. Otherwise, the default one (as defined in :meth:`~GenericMessageDialog.GetDefaultOKLabel`)
is returned.
.. versionadded:: 0.9.3
.. method:: GetCustomYesBitmap(self)
If a custom icon has been used for the ``Yes`` button, this method will return
it as an instance of :class:`wx.Bitmap`. Otherwise, the default one (as defined in
:meth:`~GenericMessageDialog.GetDefaultYesBitmap`) is returned.
.. versionadded:: 0.9.3
.. method:: GetCustomYesLabel(self)
If a custom label has been used for the ``Yes`` button, this method will return
it as a string. Otherwise, the default one (as defined in :meth:`~GenericMessageDialog.GetDefaultYesLabel`)
is returned.
.. versionadded:: 0.9.3
.. method:: GetDefaultCancelBitmap(self)
Returns the default icon for the ``Cancel`` button.
:note: this method may be overridden to provide different defaults for the
default button icons.
.. versionadded:: 0.9.3
.. method:: GetDefaultCancelLabel(self)
Returns the default label for the ``Cancel`` button.
:note: this method may be overridden to provide different defaults for the
default button labels.
.. versionadded:: 0.9.3
.. method:: GetDefaultHelpBitmap(self)
Returns the default icon for the ``Help`` button.
:note: this method may be overridden to provide different defaults for the
default button icons.
.. versionadded:: 0.9.3
.. method:: GetDefaultHelpLabel(self)
Returns the default label for the ``Help`` button.
:note: this method may be overridden to provide different defaults for the
default button labels.
.. versionadded:: 0.9.3
.. method:: GetDefaultNoBitmap(self)
Returns the default icon for the ``No`` button.
:note: this method may be overridden to provide different defaults for the
default button icons.
.. versionadded:: 0.9.3
.. method:: GetDefaultNoLabel(self)
Returns the default label for the ``No`` button.
:note: this method may be overridden to provide different defaults for the
default button labels.
.. versionadded:: 0.9.3
.. method:: GetDefaultOKBitmap(self)
Returns the default icon for the ``OK`` button.
:note: this method may be overridden to provide different defaults for the
default button icons.
.. versionadded:: 0.9.3
.. method:: GetDefaultOKLabel(self)
Returns the default label for the ``OK`` button.
:note: this method may be overridden to provide different defaults for the
default button labels.
.. versionadded:: 0.9.3
.. method:: GetDefaultYesBitmap(self)
Returns the default icon for the ``Yes`` button.
:note: this method may be overridden to provide different defaults for the
default button icons.
.. versionadded:: 0.9.3
.. method:: GetDefaultYesLabel(self)
Returns the default label for the ``Yes`` button.
:note: this method may be overridden to provide different defaults for the
default button labels.
.. versionadded:: 0.9.3
.. method:: GetExtendedMessage(self)
Returns a string representing the extended :class:`GenericMessageDialog` message.
.. versionadded:: 0.9.3
.. method:: GetFullMessage(self)
Returns a string representing the combination of the main :class:`GenericMessageDialog`
message and the extended message, separated by an empty line.
.. versionadded:: 0.9.3
.. method:: GetMessage(self)
Returns a string representing the main :class:`GenericMessageDialog` message.
.. versionadded:: 0.9.3
.. method:: GetMessageDialogStyle(self)
Returns the AGW-specific window style for :class:`GenericMessageDialog`.
.. versionadded:: 0.9.3
.. method:: HasCustomBitmaps(self)
Returns ``True`` if any of the buttons have a non-default icons.
.. versionadded:: 0.9.3
.. method:: HasCustomLabels(self)
Returns ``True`` if any of the buttons have a non-default label.
.. versionadded:: 0.9.3
.. method:: OnCancel(self, event)
:class:`GenericMessageDialog` had received a ``wx.ID_CANCEL`` answer.
.. method:: OnHelp(self, event)
:class:`GenericMessageDialog` had received a ``wx.ID_HELP`` answer.
.. method:: OnKeyDown(self, event)
Handles the ``wx.EVT_KEY_DOWN`` event for :class:`GenericMessageDialog`.
:param `event`: a :class:`KeyEvent` event to be processed.
.. method:: OnNavigation(self, event)
Handles the ``wx.EVT_NAVIGATION_KEY`` event for :class:`GenericMessageDialog`.
:param `event`: a :class:`NavigationKeyEvent` event to be processed.
.. method:: OnNo(self, event)
:class:`GenericMessageDialog` had received a ``wx.ID_NO`` answer.
.. method:: OnOk(self, event)
:class:`GenericMessageDialog` had received a ``wx.ID_OK`` answer.
.. method:: OnYes(self, event)
:class:`GenericMessageDialog` had received a ``wx.ID_YES`` answer.
.. method:: SetExtendedMessage(self, extendedMessage)
Sets the extended message for the dialog: this message is usually an extension of the
short message specified in the constructor or set with :meth:`~GenericMessageDialog.SetMessage`.
If it is set, the main message appears highlighted and this message appears beneath
it in normal font.
:param `extendedMessage`: a string representing the extended :class:`GenericMessageDialog` message.
.. versionadded:: 0.9.3
.. method:: SetHelpBitmap(self, helpBitmap)
Overrides the default icon of the ``Help`` button.
:param `helpBitmap`: the new icon for the ``Help`` button, an instance of :class:`wx.Bitmap`.
.. versionadded:: 0.9.3
.. method:: SetHelpLabel(self, help)
Overrides the default label of the ``Help`` button.
:param `help`: the new label for the ``Help`` button.
:see: The remarks in the :meth:`~GenericMessageDialog.SetYesNoLabels` documentation.
.. versionadded:: 0.9.3
.. method:: SetMessage(self, message)
Sets the message shown by the dialog.
:param `message`: a string representing the main :class:`GenericMessageDialog` message.
.. versionadded:: 0.9.3
.. method:: SetOKBitmap(self, okBitmap)
Overrides the default icon of the ``OK`` button.
:param `yesBitmap`: the new icon for the ``OK`` button, an instance of :class:`wx.Bitmap`;
.. versionadded:: 0.9.3
.. method:: SetOKCancelBitmaps(self, okBitmap, cancelBitmap)
Overrides the default icons of the ``OK`` and ``Cancel`` buttons.
:param `okBitmap`: the new icon for the ``OK`` button, an instance of :class:`wx.Bitmap`;
:param `cancelBitmap`: the new icon for the ``Cancel`` button, an instance of :class:`wx.Bitmap`.
.. versionadded:: 0.9.3
.. method:: SetOKCancelLabels(self, ok, cancel)
Overrides the default labels of the ``OK`` and ``Cancel`` buttons.
:param `ok`: the new label for the ``OK`` button;
:param `cancel`: the new label for the ``Cancel`` button.
:see: The remarks in the :meth:`~GenericMessageDialog.SetYesNoLabels` documentation.
.. versionadded:: 0.9.3
.. method:: SetOKLabel(self, ok)
Overrides the default label of the ``OK`` button.
:param `ok`: the new label for the ``OK`` button.
:see: The remarks in the :meth:`~GenericMessageDialog.SetYesNoLabels` documentation.
.. versionadded:: 0.9.3
.. method:: SetYesNoBitmaps(self, yesBitmap, noBitmap)
Overrides the default icons of the ``Yes`` and ``No`` buttons.
:param `yesBitmap`: the new icon for the ``Yes`` button, an instance of :class:`wx.Bitmap`;
:param `noBitmap`: the new icon for the ``No`` button, an instance of :class:`wx.Bitmap`.
.. versionadded:: 0.9.3
.. method:: SetYesNoCancelBitmaps(self, yesBitmap, noBitmap, cancelBitmap)
Overrides the default icons of the ``Yes`` and ``No`` buttons.
:param `yesBitmap`: the new icon for the ``Yes`` button, an instance of :class:`wx.Bitmap`;
:param `noBitmap`: the new icon for the ``No`` button, an instance of :class:`wx.Bitmap`;
:param `cancelBitmap`: the new icon for the ``Cancel`` button, an instance of :class:`wx.Bitmap`.
.. versionadded:: 0.9.3
.. method:: SetYesNoCancelLabels(self, yes, no, cancel)
Overrides the default labels of the ``Yes`` and ``No`` buttons.
:param `yes`: the new label for the ``Yes`` button;
:param `no`: the new label for the ``No`` button;
:param `cancel`: the new label for the ``Cancel`` button.
:see: The remarks in the :meth:`~GenericMessageDialog.SetYesNoLabels` documentation.
.. versionadded:: 0.9.3
.. method:: SetYesNoLabels(self, yes, no)
Overrides the default labels of the ``Yes`` and ``No`` buttons.
:param `yes`: the new label for the ``Yes`` button;
:param `no`: the new label for the ``No`` button.
Typically, if the function was used successfully, the main dialog message may need to be changed, e.g.::
main_message = "Hello world! I am the main message."
dlg = GenericMessageDialog(None, main_message, "A Nice Message Box",
agwStyle=wx.ICON_INFORMATION | wx.OK)
if dlg.SetYesNoLabels(_("&Quit"), _("&Don't quit")):
dlg.SetMessage(_("What do you want to do?"))
else: # buttons have standard "Yes"/"No" values, so rephrase the question
dlg.SetMessage(_("Do you really want to quit?"))
.. versionadded:: 0.9.3
.. method:: ShowModal(self)
Shows the dialog, returning one of ``wx.ID_OK``, ``wx.ID_CANCEL``, ``wx.ID_YES``,
``wx.ID_NO`` or ``wx.ID_HELP``.
:note: Notice that this method returns the identifier of the button which was
clicked unlike the :class:`MessageBox` () function.
:note: Reimplemented from :class:`Dialog`.
.. method:: SwitchFocus(self)
Switch focus between buttons.
.. method:: WrapMessage(self, message, wrap, font=None)
Wraps the input message to multi lines so that the resulting new message
is at most `wrap` pixels wide.
:param `message`: the original input message;
:param `wrap`: wraps the string in `message` so that every line is at most
`wrap` pixels long;
:param `font`: if not ``None``, it should be an instance of :class:`wx.Font` to be
used to measure and then wrap the input `message`.
:return: a new message wrapped at maximum `wrap` pixels wide.
:todo: Estabilish if wrapping all messages by default is a better idea than
provide a keyword parameter to :class:`GenericMessageDialog`. A default maximum
line width might be the wxMac one, at 360 pixels.
|