AGW Logo

agw_title genericmessagedialog

This class is a possible, fancy replacement for wx.MessageDialog.


description Description

This class represents a dialog that shows a single or multi-line message, with a choice of OK, Yes, No, Cancel and Help buttons. It is a possible replacement for the standard wx.MessageDialog, with these extra functionalities:

  • Possibility to modify the dialog position;
  • Custom themed generic bitmap & text buttons;
  • Support for normal and extended message (in different fonts);
  • Custom labels for the OK, Yes, No, Cancel and Help buttons;
  • Custom icons for the OK, Yes, No, Cancel and Help buttons;
  • Possibility to set an icon to the dialog;
  • More visibility to the button getting the focus;
  • Support for Aqua buttons or Gradient buttons instead of themed ones (see AquaButton and GradientButton);
  • Possibility to automatically wrap long lines of text;
  • Good old Python code :-D .

And a lot more. Check the demo for an almost complete review of the functionalities.


usage Usage

Usage example:

import wx
import wx.lib.agw.genericmessagedialog as GMD

# Our normal wxApp-derived class, as usual
app = wx.App(0)

main_message = "Hello world! I am the main message."

dlg = GMD.GenericMessageDialog(None, main_message, "A Nice Message Box",
                               agwStyle=wx.ICON_INFORMATION|wx.OK)

dlg.ShowModal()
dlg.Destroy()

app.MainLoop()

This code snippet can be downloaded, see this example script.

Note

Some of the AGW snippets of code in the documentation use images and external files (to create bitmaps or access external data). As these files are not provided in these snippets, you should make the approriate modifications to the code to actually run it.


platforms Supported Platforms

GenericMessageDialog has been tested on the following platforms:
  • Windows (Windows XP).

styles Window Styles

This class supports the following window styles:


Window styles for genericmessagedialog
Window Styles Hex Value Description
GMD_USE_AQUABUTTONS 0x20 Uses wx.lib.agw.aquabutton buttons instead of generic buttons.
GMD_USE_GRADIENTBUTTONS 0x40 Uses wx.lib.agw.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 for genericmessagedialog
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.

events Events Processing

No custom events are available for this class.


license License And Version

GenericMessageDialog is distributed under the wxPython license.

Latest Revision: Andrea Gavana @ 29 Feb 2012, 21.00 GMT

Version 0.7

Module author: Andrea Gavana <andrea.gavana@gmail.com>


hierarchy Inheritance Diagram

Inheritance diagram for module: genericmessagedialog

Inheritance diagram of genericmessagedialog.GenericMessageDialog, genericmessagedialog.StdDialogButtonSizer


svn_main SVN Revisions

A graphical representation of the SVN commits in the last year.

Click on any date in the picture to jump to that particular revision page, containing information about committers, log messages and SVN diffs.

genericmessagedialog

Revision Graph For genericmessagedialog


2to3 Python 3 Issues (via 2to3)

No issues have been detected by 2to3.py.