dabo Commit
Revision 3242
Date: 2007-07-12 14:57:30 -0700 (Thu, 12 Jul 2007)
Author: Paul
Trac: http://svn.dabodev.com/trac/dabo/changeset/3242
Changed:
U trunk/dabo/ui/uiwx/dMessageBox.py
Log:
Added/improved docstrings for ui.stop, areYouSure, exclaim, and info. This
fixes ticket #1029.
Diff:
Modified: trunk/dabo/ui/uiwx/dMessageBox.py
===================================================================
--- trunk/dabo/ui/uiwx/dMessageBox.py 2007-07-12 19:35:31 UTC (rev 3241)
+++ trunk/dabo/ui/uiwx/dMessageBox.py 2007-07-12 21:57:30 UTC (rev 3242)
@@ -29,7 +29,20 @@
def areYouSure(message="Are you sure?", title=None, defaultNo=False,
cancelButton=True, parent=None):
- """Display a message dialog asking the user to answer Yes, No to a
question."""
+ """Display a dMessageBox asking the user to answer yes or no to a
question.
+
+ Returns True, False, or None, for choices "Yes", "No", or "Cancel".
+
+ The default title comes from app.getAppInfo("appName"), or if the
+ application object isn't available it will be "Dabo Application".
+
+ If defaultNo is True, the 'No' button will be the default button.
+
+ If cancelButton is True (default), a third 'Cancel' button will appear.
+
+ If parent isn't passed, it will automatically resolve to the current
+ active form.
+ """
if title is None:
title = getDefaultTitle()
style = wx.YES_NO|wx.ICON_QUESTION
@@ -51,23 +64,54 @@
def stop(message="Stop", title=None, parent=None):
+ """Display a dMessageBox informing the user that the operation cannot
proceed.
+
+ Returns None.
+
+ The default title comes from app.getAppInfo("appName"), or if the
+ application object isn't available it will be "Dabo Application".
+
+ If parent isn't passed, it will automatically resolve to the current
+ active form.
+ """
if title is None:
title = getDefaultTitle()
icon = wx.ICON_HAND
showMessageBox(message=message, title=title, icon=icon, parent=parent)
def info(message="Information", title=None, parent=None):
+ """Display a dMessageBox offering the user some useful information.
+
+ Returns None.
+
+ The default title comes from app.getAppInfo("appName"), or if the
+ application object isn't available it will be "Dabo Application".
+
+ If parent isn't passed, it will automatically resolve to the current
+ active form.
+ """
if title is None:
title = getDefaultTitle()
icon = wx.ICON_INFORMATION
showMessageBox(message=message, title=title, icon=icon, parent=parent)
def exclaim(message="Important!", title=None, parent=None):
+ """Display a dMessageBox urgently informing the user that we cannot
proceed.
+
+ Returns None.
+
+ The default title comes from app.getAppInfo("appName"), or if the
+ application object isn't available it will be "Dabo Application".
+
+ If parent isn't passed, it will automatically resolve to the current
+ active form.
+ """
if title is None:
title = getDefaultTitle()
icon = wx.ICON_EXCLAMATION
showMessageBox(message=message, title=title, icon=icon, parent=parent)
+
def showMessageBox(message, title, icon, parent=None):
style = wx.OK | icon
dlg = dMessageBox(message, title, style, parent=parent)
@@ -77,16 +121,6 @@
return None
-def info(message="Information", title=None, parent=None):
- if title is None:
- title = getDefaultTitle()
- style = wx.OK|wx.ICON_INFORMATION
- dlg = dMessageBox(message, title, style, parent=parent)
- retval = dlg.ShowModal()
- dlg.Destroy()
- return None
-
-
def getDefaultTitle():
"""Get a default title for the messageboxes.
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/dabo-dev/[EMAIL PROTECTED]