X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..b881fc787d2823bdd8a415080b82feee90804a17:/wxPython/demo/wxMessageDialog.py diff --git a/wxPython/demo/wxMessageDialog.py b/wxPython/demo/wxMessageDialog.py index 17dcf7d741..009c30fb11 100644 --- a/wxPython/demo/wxMessageDialog.py +++ b/wxPython/demo/wxMessageDialog.py @@ -1,11 +1,15 @@ +# 11/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o Updated for wx namespace +# -from wxPython.wx import * +import wx #--------------------------------------------------------------------------- def runTest(frame, nb, log): - dlg = wxMessageDialog(frame, 'Hello from Python and wxPython!', - 'A Message Box', wxOK | wxICON_INFORMATION) + dlg = wx.MessageDialog(frame, 'Hello from Python and wxPython!', + 'A Message Box', wx.OK | wx.ICON_INFORMATION) #wxYES_NO | wxNO_DEFAULT | wxCANCEL | wxICON_INFORMATION) dlg.ShowModal() dlg.Destroy() @@ -14,50 +18,22 @@ def runTest(frame, nb, log): - - - - - - - - - - overview = """\ -wxMessageDialog() ----------------------------------- - -wxMessageDialog(wxWindow* parent, const wxString& message, const wxString& caption = "Message box", long style = wxOK | wxCANCEL | wxCENTRE, const wxPoint& pos = wxDefaultPosition) - -Constructor. Use wxMessageDialog::ShowModal to show the dialog. +This class represents a dialog that shows a single or multi-line message, with a +choice of OK, Yes, No and Cancel buttons. -Parameters -------------------- +Additionally, various style flags can determine whether an icon is displayed, +and, if so, what kind. -parent = Parent window. +The dialog can be modal or not; of modal, the user's response is in the return +code of ShowModal(). If not, the response can be taken from GetReturnCode() (inherited +from the wxDialog super class). If not modal and the return code is required, it +must be retrieved before the dialog is destroyed. -message = Message to show on the dialog. - -caption = The dialog caption. - -style = A dialog style (bitlist) containing flags chosen from the following: - -wxOK Show an OK button. - -wxCANCEL Show a Cancel button. - -wxYES_NO Show Yes and No buttons. - -wxCENTRE Centre the message. Not Windows. - -wxICON_EXCLAMATION Shows an exclamation mark icon. Windows only. - -wxICON_HAND Shows a hand icon. Windows only. - -wxICON_QUESTION Shows a question mark icon. Windows only. +""" -wxICON_INFORMATION Shows an information (i) icon. Windows only. -pos = Dialog position. -""" +if __name__ == '__main__': + import sys,os + import run + run.main(['', os.path.basename(sys.argv[0])])