Main class implementation, GenericMessageDialog is a possible replacement for the standard wx.MessageDialog.
__init__ | Default class constructor. |
CreateButtonSizer | Creates a sizer with standard buttons. |
CreateMessageDialog | Actually creates the GenericMessageDialog, just before showing it on screen. |
CreateSeparatedButtonSizer | Creates a sizer with standard buttons using CreateButtonSizer separated |
CreateStdDialogButtonSizer | Creates a StdDialogButtonSizer with standard buttons. |
EndDialog | Ends the GenericMessageDialog life. This will be done differently depending on |
GetCaption | Returns the main caption (the title) for GenericMessageDialog. |
GetCustomCancelBitmap | If a custom icon been used for the Cancel button, this method will return |
GetCustomCancelLabel | If a custom label has been used for the Cancel button, this method will return |
GetCustomHelpBitmap | If a custom icon has been used for the Help button, this method will return |
GetCustomHelpLabel | If a custom label has been used for the Help button, this method will return |
GetCustomNoBitmap | If a custom icon has been used for the No button, this method will return |
GetCustomNoLabel | If a custom label has been used for the No button, this method will return |
GetCustomOKBitmap | If a custom icon has been used for the OK button, this method will return |
GetCustomOKLabel | If a custom label has been used for the OK button, this method will return |
GetCustomYesBitmap | If a custom icon has been used for the Yes button, this method will return |
GetCustomYesLabel | If a custom label has been used for the Yes button, this method will return |
GetDefaultCancelBitmap | Returns the default icon for the Cancel button. |
GetDefaultCancelLabel | Returns the default label for the Cancel button. |
GetDefaultHelpBitmap | Returns the default icon for the Help button. |
GetDefaultHelpLabel | Returns the default label for the Help button. |
GetDefaultNoBitmap | Returns the default icon for the No button. |
GetDefaultNoLabel | Returns the default label for the No button. |
GetDefaultOKBitmap | Returns the default icon for the OK button. |
GetDefaultOKLabel | Returns the default label for the OK button. |
GetDefaultYesBitmap | Returns the default icon for the Yes button. |
GetDefaultYesLabel | Returns the default label for the Yes button. |
GetExtendedMessage | Returns a string representing the extended GenericMessageDialog message. |
GetFullMessage | Returns a string representing the combination of the main GenericMessageDialog |
GetMessage | Returns a string representing the main GenericMessageDialog message. |
GetMessageDialogStyle | Returns the AGW-specific window style for GenericMessageDialog. |
HasCustomBitmaps | Returns True if any of the buttons have a non-default icons. |
HasCustomLabels | Returns True if any of the buttons have a non-default label. |
OnCancel | GenericMessageDialog had received a wx.ID_CANCEL answer. |
OnHelp | GenericMessageDialog had received a wx.ID_HELP answer. |
OnKeyDown | Handles the wx.EVT_KEY_DOWN event for GenericMessageDialog. |
OnNavigation | Handles the wx.EVT_NAVIGATION_KEY event for GenericMessageDialog. |
OnNo | GenericMessageDialog had received a wx.ID_NO answer. |
OnOk | GenericMessageDialog had received a wx.ID_OK answer. |
OnYes | GenericMessageDialog had received a wx.ID_YES answer. |
SetExtendedMessage | Sets the extended message for the dialog: this message is usually an extension of the |
SetHelpBitmap | Overrides the default icon of the Help button. |
SetHelpLabel | Overrides the default label of the Help button. |
SetMessage | Sets the message shown by the dialog. |
SetOKBitmap | Overrides the default icon of the OK button. |
SetOKCancelBitmaps | Overrides the default icons of the OK and Cancel buttons. |
SetOKCancelLabels | Overrides the default labels of the OK and Cancel buttons. |
SetOKLabel | Overrides the default label of the OK button. |
SetYesNoBitmaps | Overrides the default icons of the Yes and No buttons. |
SetYesNoCancelBitmaps | Overrides the default icons of the Yes and No buttons. |
SetYesNoCancelLabels | Overrides the default labels of the Yes and No buttons. |
SetYesNoLabels | Overrides the default labels of the Yes and No buttons. |
ShowModal | Shows the dialog, returning one of wx.ID_OK, wx.ID_CANCEL, wx.ID_YES, |
SwitchFocus | Switch focus between buttons. |
WrapMessage | Wraps the input message to multi lines so that the resulting new message is at most wrap pixels wide. |
Main class implementation, GenericMessageDialog is a possible replacement for the standard wx.MessageDialog.
Default class constructor. Use ShowModal to show the dialog.
Parameters: |
|
---|
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.
Creates a sizer with standard buttons.
Parameters: | flags – a bit list of the following flags:
|
---|
Note
The sizer lays out the buttons in a manner appropriate to the platform.
Actually creates the GenericMessageDialog, just before showing it on screen.
Creates a sizer with standard buttons using CreateButtonSizer separated from the rest of the dialog contents by a horizontal wx.StaticLine.
Parameters: | flags – the button sizer flags. |
---|
See also
CreateButtonSizer for a list of valid flags.
Creates a StdDialogButtonSizer with standard buttons.
Parameters: | flags – the button sizer flags. |
---|
See also
CreateButtonSizer for a list of valid flags.
Note
The sizer lays out the buttons in a manner appropriate to the platform.
Ends the GenericMessageDialog life. This will be done differently depending on the dialog modal/non-modal behaviour.
Parameters: | 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.
Returns the main caption (the title) for GenericMessageDialog.
New in version 0.9.3.
If a custom icon been used for the Cancel button, this method will return it as an instance of wx.Bitmap. Otherwise, the default one (as defined in GetDefaultCancelBitmap) is returned.
New in version 0.9.3.
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 GetDefaultCancelLabel) is returned.
New in version 0.9.3.
If a custom icon has been used for the Help button, this method will return it as an instance of wx.Bitmap. Otherwise, the default one (as defined in GetDefaultHelpBitmap) is returned.
New in version 0.9.3.
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 GetDefaultHelpLabel) is returned.
New in version 0.9.3.
If a custom icon has been used for the No button, this method will return it as an instance of wx.Bitmap. Otherwise, the default one (as defined in GetDefaultNoBitmap) is returned.
New in version 0.9.3.
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 GetDefaultNoLabel) is returned.
New in version 0.9.3.
If a custom icon has been used for the OK button, this method will return it as an instance of wx.Bitmap. Otherwise, the default one (as defined in GetDefaultOKBitmap) is returned.
New in version 0.9.3.
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 GetDefaultOKLabel) is returned.
New in version 0.9.3.
If a custom icon has been used for the Yes button, this method will return it as an instance of wx.Bitmap. Otherwise, the default one (as defined in GetDefaultYesBitmap) is returned.
New in version 0.9.3.
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 GetDefaultYesLabel) is returned.
New in version 0.9.3.
Returns the default icon for the Cancel button.
Note
this method may be overridden to provide different defaults for the default button icons.
New in version 0.9.3.
Returns the default label for the Cancel button.
Note
this method may be overridden to provide different defaults for the default button labels.
New in version 0.9.3.
Returns the default icon for the Help button.
Note
this method may be overridden to provide different defaults for the default button icons.
New in version 0.9.3.
Returns the default label for the Help button.
Note
this method may be overridden to provide different defaults for the default button labels.
New in version 0.9.3.
Returns the default icon for the No button.
Note
this method may be overridden to provide different defaults for the default button icons.
New in version 0.9.3.
Returns the default label for the No button.
Note
this method may be overridden to provide different defaults for the default button labels.
New in version 0.9.3.
Returns the default icon for the OK button.
Note
this method may be overridden to provide different defaults for the default button icons.
New in version 0.9.3.
Returns the default label for the OK button.
Note
this method may be overridden to provide different defaults for the default button labels.
New in version 0.9.3.
Returns the default icon for the Yes button.
Note
this method may be overridden to provide different defaults for the default button icons.
New in version 0.9.3.
Returns the default label for the Yes button.
Note
this method may be overridden to provide different defaults for the default button labels.
New in version 0.9.3.
Returns a string representing the extended GenericMessageDialog message.
New in version 0.9.3.
Returns a string representing the combination of the main GenericMessageDialog message and the extended message, separated by an empty line.
New in version 0.9.3.
Returns a string representing the main GenericMessageDialog message.
New in version 0.9.3.
Returns the AGW-specific window style for GenericMessageDialog.
New in version 0.9.3.
Returns True if any of the buttons have a non-default icons.
New in version 0.9.3.
Returns True if any of the buttons have a non-default label.
New in version 0.9.3.
GenericMessageDialog had received a wx.ID_CANCEL answer.
GenericMessageDialog had received a wx.ID_HELP answer.
Handles the wx.EVT_KEY_DOWN event for GenericMessageDialog.
Parameters: | event – a wx.KeyEvent event to be processed. |
---|
Handles the wx.EVT_NAVIGATION_KEY event for GenericMessageDialog.
Parameters: | event – a wx.NavigationKeyEvent event to be processed. |
---|
GenericMessageDialog had received a wx.ID_NO answer.
GenericMessageDialog had received a wx.ID_OK answer.
GenericMessageDialog had received a wx.ID_YES answer.
Sets the extended message for the dialog: this message is usually an extension of the short message specified in the constructor or set with SetMessage.
If it is set, the main message appears highlighted and this message appears beneath it in normal font.
Parameters: | extendedMessage – a string representing the extended GenericMessageDialog message. |
---|
New in version 0.9.3.
Overrides the default icon of the Help button.
Parameters: | helpBitmap – the new icon for the Help button, an instance of wx.Bitmap. |
---|
New in version 0.9.3.
Overrides the default label of the Help button.
Parameters: | help – the new label for the Help button. |
---|
See also
The remarks in the SetYesNoLabels documentation.
New in version 0.9.3.
Sets the message shown by the dialog.
Parameters: | message – a string representing the main GenericMessageDialog message. |
---|
New in version 0.9.3.
Overrides the default icon of the OK button.
Parameters: | yesBitmap – the new icon for the OK button, an instance of wx.Bitmap; |
---|
New in version 0.9.3.
Overrides the default icons of the OK and Cancel buttons.
Parameters: |
---|
New in version 0.9.3.
Overrides the default labels of the OK and Cancel buttons.
Parameters: |
|
---|
See also
The remarks in the SetYesNoLabels documentation.
New in version 0.9.3.
Overrides the default label of the OK button.
Parameters: | ok – the new label for the OK button. |
---|
See also
The remarks in the SetYesNoLabels documentation.
New in version 0.9.3.
Overrides the default icons of the Yes and No buttons.
Parameters: |
---|
New in version 0.9.3.
Overrides the default icons of the Yes and No buttons.
Parameters: |
---|
New in version 0.9.3.
Overrides the default labels of the Yes and No buttons.
Parameters: |
|
---|
See also
The remarks in the SetYesNoLabels documentation.
New in version 0.9.3.
Overrides the default labels of the Yes and No buttons.
Parameters: |
|
---|
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?"))
New in version 0.9.3.
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 wx.MessageBox() function.
Note
Reimplemented from wx.Dialog.
Wraps the input message to multi lines so that the resulting new message is at most wrap pixels wide.
Parameters: |
|
---|---|
Returns: | 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 GenericMessageDialog. A default maximum line width might be the wxMac one, at 360 pixels.