Fred Drake | c817e27 | 1998-08-10 18:40:22 +0000 | [diff] [blame] | 1 | \section{\module{EasyDialogs} --- |
Fred Drake | f6863c1 | 1999-03-02 16:37:17 +0000 | [diff] [blame] | 2 | Basic Macintosh dialogs} |
Fred Drake | fe7f3bc | 1998-07-23 17:55:31 +0000 | [diff] [blame] | 3 | |
Fred Drake | f6863c1 | 1999-03-02 16:37:17 +0000 | [diff] [blame] | 4 | \declaremodule{standard}{EasyDialogs} |
| 5 | \platform{Mac} |
Fred Drake | fe7f3bc | 1998-07-23 17:55:31 +0000 | [diff] [blame] | 6 | \modulesynopsis{Basic Macintosh dialogs.} |
| 7 | |
Jack Jansen | da53c52 | 1995-10-10 14:43:20 +0000 | [diff] [blame] | 8 | |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 9 | The \module{EasyDialogs} module contains some simple dialogs for |
Fred Drake | 4973b35 | 2000-08-30 14:33:02 +0000 | [diff] [blame] | 10 | the Macintosh. All routines have an optional parameter \var{id} with |
| 11 | which you can override the DLOG resource used for the dialog, as long |
| 12 | as the item numbers correspond. See the source for details. |
| 13 | |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 14 | The \module{EasyDialogs} module defines the following functions: |
Jack Jansen | da53c52 | 1995-10-10 14:43:20 +0000 | [diff] [blame] | 15 | |
Jack Jansen | da53c52 | 1995-10-10 14:43:20 +0000 | [diff] [blame] | 16 | |
| 17 | \begin{funcdesc}{Message}{str} |
| 18 | A modal dialog with the message text \var{str}, which should be at |
| 19 | most 255 characters long, is displayed. Control is returned when the |
| 20 | user clicks ``OK''. |
| 21 | \end{funcdesc} |
| 22 | |
Fred Drake | cce1090 | 1998-03-17 06:33:25 +0000 | [diff] [blame] | 23 | \begin{funcdesc}{AskString}{prompt\optional{, default}} |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 24 | Ask the user to input a string value, in a modal dialog. \var{prompt} |
Fred Drake | eab58af | 2000-10-14 04:56:52 +0000 | [diff] [blame] | 25 | is the prompt message, the optional \var{default} arg is the initial |
| 26 | value for the string. All strings can be at most 255 bytes |
| 27 | long. \function{AskString()} returns the string entered or \code{None} |
| 28 | in case the user cancelled. |
| 29 | \end{funcdesc} |
| 30 | |
| 31 | \begin{funcdesc}{AskPassword}{prompt\optional{, default}} |
| 32 | Ask the user to input a string value, in a modal dialog. Like |
| 33 | \method{AskString}, but with the text shown as bullets. \var{prompt} |
| 34 | is the prompt message, the optional \var{default} arg is the initial |
Jack Jansen | da53c52 | 1995-10-10 14:43:20 +0000 | [diff] [blame] | 35 | value for the string. All strings can be at most 255 bytes |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 36 | long. \function{AskString()} returns the string entered or \code{None} |
| 37 | in case the user cancelled. |
Jack Jansen | da53c52 | 1995-10-10 14:43:20 +0000 | [diff] [blame] | 38 | \end{funcdesc} |
| 39 | |
Fred Drake | cce1090 | 1998-03-17 06:33:25 +0000 | [diff] [blame] | 40 | \begin{funcdesc}{AskYesNoCancel}{question\optional{, default}} |
Jack Jansen | da53c52 | 1995-10-10 14:43:20 +0000 | [diff] [blame] | 41 | Present a dialog with text \var{question} and three buttons labelled |
| 42 | ``yes'', ``no'' and ``cancel''. Return \code{1} for yes, \code{0} for |
| 43 | no and \code{-1} for cancel. The default return value chosen by |
| 44 | hitting return is \code{0}. This can be changed with the optional |
| 45 | \var{default} argument. |
| 46 | \end{funcdesc} |
| 47 | |
Fred Drake | eab58af | 2000-10-14 04:56:52 +0000 | [diff] [blame] | 48 | \begin{funcdesc}{ProgressBar}{\optional{title \optional{, maxval\optional{,label}}}} |
| 49 | Display a modeless progress dialog with a thermometer bar. \var{title} |
Fred Drake | 41788db | 1998-04-04 06:23:02 +0000 | [diff] [blame] | 50 | is the text string displayed (default ``Working...''), \var{maxval} is |
Fred Drake | eab58af | 2000-10-14 04:56:52 +0000 | [diff] [blame] | 51 | the value at which progress is complete (default |
| 52 | \code{100}). \var{label} is the text that is displayed over the progress |
| 53 | bar itself. The returned object has two methods, |
| 54 | \code{set(\var{value})}, which sets the value of the progress bar, and |
| 55 | \code{label(\var{text})}, which sets the text of the label. The bar |
| 56 | remains visible until the object returned is discarded. |
Jack Jansen | 350b2b9 | 1995-11-14 10:30:27 +0000 | [diff] [blame] | 57 | |
Fred Drake | eab58af | 2000-10-14 04:56:52 +0000 | [diff] [blame] | 58 | The progress bar has a ``cancel'' button. [NOTE: how does the cancel |
| 59 | button behave?] |
Jack Jansen | 350b2b9 | 1995-11-14 10:30:27 +0000 | [diff] [blame] | 60 | \end{funcdesc} |