Mercurial > octave-nkf
comparison scripts/gui/questdlg.m @ 19630:0e1f5a750d00
maint: Periodic merge of gui-release to default.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 20 Jan 2015 10:24:46 -0500 |
parents | 93b3d03b05e7 446c46af4b42 |
children | a9952a647d52 |
comparison
equal
deleted
inserted
replaced
19626:37d37297acf8 | 19630:0e1f5a750d00 |
---|---|
30 ## The message may have multiple lines separated by newline characters | 30 ## The message may have multiple lines separated by newline characters |
31 ## ("\n"), or it may be a cellstr array with one element for each | 31 ## ("\n"), or it may be a cellstr array with one element for each |
32 ## line. The optional @var{title} (character string) can be used to | 32 ## line. The optional @var{title} (character string) can be used to |
33 ## decorate the dialog caption. | 33 ## decorate the dialog caption. |
34 ## | 34 ## |
35 ## The string @var{default} identifies the default button, | 35 ## The string @var{default} identifies the default button, |
36 ## which is activated by pressing the @key{ENTER} key. | 36 ## which is activated by pressing the @key{ENTER} key. |
37 ## It must match one of the strings given in @var{btn1}, @var{btn2}, or | 37 ## It must match one of the strings given in @var{btn1}, @var{btn2}, or |
38 ## @var{btn3}. | 38 ## @var{btn3}. |
39 ## | 39 ## |
40 ## If only @var{msg} and @var{title} are specified, three buttons with | 40 ## If only @var{msg} and @var{title} are specified, three buttons with |
41 ## the default captions @qcode{"Yes"}, @qcode{"No"}, and @qcode{"Cancel"} are | 41 ## the default captions @qcode{"Yes"}, @qcode{"No"}, and @qcode{"Cancel"} are |
42 ## used. | 42 ## used. |
43 ## | 43 ## |
44 ## If only two button captions, @var{btn1} and @var{btn2}, are specified | 44 ## If only two button captions, @var{btn1} and @var{btn2}, are specified |
45 ## the dialog will have only these two buttons. | 45 ## the dialog will have only these two buttons. |
46 ## | 46 ## |
47 ## @seealso{errordlg, helpdlg, inputdlg, listdlg, warndlg} | 47 ## @seealso{errordlg, helpdlg, inputdlg, listdlg, warndlg} |
48 ## @end deftypefn | 48 ## @end deftypefn |
49 | 49 |
50 function btn = questdlg (msg, title = "Question Dialog", varargin) | 50 function btn = questdlg (msg, title = "Question Dialog", varargin) |
51 | 51 |
52 if (nargin < 1 || nargin > 6) | 52 if (nargin < 1 || nargin > 6) |
53 print_usage (); | 53 print_usage (); |
54 endif | 54 endif |
55 | 55 |
56 if (! ischar (msg)) | 56 if (! ischar (msg)) |
57 if (iscell (msg)) | 57 if (iscell (msg)) |
58 msg = sprintf ("%s\n", msg{:}); | 58 msg = sprintf ("%s\n", msg{:}); |
59 msg(end) = ""; | 59 msg(end) = ""; |
60 else | 60 else |