Mercurial > octave
annotate scripts/gui/warndlg.m @ 21630:b5d9b95d1e1a
Removing Java dialog boxes.
* scripts/gui/module.mk: removed message_dialog.m entry.
* scripts/gui/private/message_dialog.m: merged code to msgbox.
* scripts/gui/errordlg.m: function now redirects to msgbox. New tests.
* scripts/gui/helpdlg.m: function now redirects to msgbox. New tests.
* scripts/gui/warndlg.m: function now redirects to msgbox. New tests.
* scripts/gui/msgbox.m: merged code from message_dialog.
Stripped Java dialog boxes. New tests.
* scripts/gui/inputdlg.m: stripped Java dialog boxes. Improved doc. New tests.
* scripts/gui/listdlg.m: stripped Java dialog boxes. Improved doc. New tests.
* scripts/gui/questdlg.m: stripped Java dialog boxes. Improved doc. New tests.
* scripts/miscellaneous/menu.m: stripped Java dialog boxes. Improved doc.
* scripts/java/module.mk: removed entries of deleted files.
* scripts/java/org/octave/DlgListener.java: removed Java dialog box Listener.
* scripts/java/org/octave/images/error.png: removed unused image.
* scripts/java/org/octave/images/information.png: removed unused image.
* scripts/java/org/octave/images/octave.png: removed unused image.
* scripts/java/org/octave/images/question.png: removed unused image.
* scripts/java/org/octave/images/warning.png: removed unused image.
* scripts/java/org/octave/JDialogBox.java: removed Java dialog box class.
* scripts/java/org/octave/TeXcode.java: removed class used by Java dialogs.
* scripts/java/org/octave/TeXtranslator.java: removed class used by Java dialogs.
* doc/module.mk: removed unused java images and java.txi.
* doc/interpreter/java.txi: merged content as minor sections to following files.
* doc/interpreter/bugs.txi: moved Java distinguish section here.
* doc/interpreter/external.txi: moved Java Interface description here.
* doc/interpreter/gui.txi: moved dialog box docstrings here.
* doc/interpreter/octave.texi: corrected TOC.
* doc/interpreter/java-images/image001.png: removed unused image.
* doc/interpreter/java-images/image002.png: removed unused image.
* doc/interpreter/java-images/image003.png: removed unused image.
* doc/interpreter/java-images/image004.png: removed unused image.
* doc/interpreter/java-images/image005.png: removed unused image.
* doc/interpreter/java-images/image006.png: removed unused image.
* doc/interpreter/java-images/image007.png: removed unused image.
* doc/interpreter/java-images/image008.png: removed unused image.
* doc/interpreter/java-images/image009.png: removed unused image.
* NEWS: Announced changes.
author | Kai T. Ohlhus <k.ohlhus@gmail.com> |
---|---|
date | Tue, 19 Apr 2016 15:27:19 +0200 |
parents | 936b88598a0b |
children | 59ebef9680ef |
rev | line source |
---|---|
17744
d63878346099
maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents:
17700
diff
changeset
|
1 ## Copyright (C) 2010, 2013 Martin Hepperle |
15625
acf0addfc610
include Octave Forge java package in core Octave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
2 ## |
15746
da26f72408a7
update copyright statements in newly added java files
John W. Eaton <jwe@octave.org>
parents:
15709
diff
changeset
|
3 ## This file is part of Octave. |
15625
acf0addfc610
include Octave Forge java package in core Octave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
4 ## |
15746
da26f72408a7
update copyright statements in newly added java files
John W. Eaton <jwe@octave.org>
parents:
15709
diff
changeset
|
5 ## Octave is free software; you can redistribute it and/or modify it |
da26f72408a7
update copyright statements in newly added java files
John W. Eaton <jwe@octave.org>
parents:
15709
diff
changeset
|
6 ## under the terms of the GNU General Public License as published by |
da26f72408a7
update copyright statements in newly added java files
John W. Eaton <jwe@octave.org>
parents:
15709
diff
changeset
|
7 ## the Free Software Foundation; either version 3 of the License, or (at |
da26f72408a7
update copyright statements in newly added java files
John W. Eaton <jwe@octave.org>
parents:
15709
diff
changeset
|
8 ## your option) any later version. |
da26f72408a7
update copyright statements in newly added java files
John W. Eaton <jwe@octave.org>
parents:
15709
diff
changeset
|
9 ## |
da26f72408a7
update copyright statements in newly added java files
John W. Eaton <jwe@octave.org>
parents:
15709
diff
changeset
|
10 ## Octave is distributed in the hope that it will be useful, but |
da26f72408a7
update copyright statements in newly added java files
John W. Eaton <jwe@octave.org>
parents:
15709
diff
changeset
|
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
da26f72408a7
update copyright statements in newly added java files
John W. Eaton <jwe@octave.org>
parents:
15709
diff
changeset
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
da26f72408a7
update copyright statements in newly added java files
John W. Eaton <jwe@octave.org>
parents:
15709
diff
changeset
|
13 ## General Public License for more details. |
15625
acf0addfc610
include Octave Forge java package in core Octave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
14 ## |
acf0addfc610
include Octave Forge java package in core Octave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
15 ## You should have received a copy of the GNU General Public License |
15746
da26f72408a7
update copyright statements in newly added java files
John W. Eaton <jwe@octave.org>
parents:
15709
diff
changeset
|
16 ## along with Octave; see the file COPYING. If not, see |
da26f72408a7
update copyright statements in newly added java files
John W. Eaton <jwe@octave.org>
parents:
15709
diff
changeset
|
17 ## <http://www.gnu.org/licenses/>. |
15625
acf0addfc610
include Octave Forge java package in core Octave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
18 |
acf0addfc610
include Octave Forge java package in core Octave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
19 ## -*- texinfo -*- |
21630
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
20 ## @deftypefn {} {@var{h} =} warndlg () |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
21 ## @deftypefnx {} {@var{h} =} warndlg (@var{msg}) |
20852
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
22 ## @deftypefnx {} {@var{h} =} warndlg (@var{msg}, @var{title}) |
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
23 ## @deftypefnx {} {@var{h} =} warndlg (@var{msg}, @var{title}, @var{createmode}) |
21630
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
24 ## Display warning message @var{msg} using a warning dialog box with caption |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
25 ## @var{title} (character string). The default warning message is |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
26 ## @qcode{"This is the default warning string."} and the default caption is |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
27 ## @qcode{"Warning Dialog"}. |
20173
777f26aa8e3e
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20071
diff
changeset
|
28 ## |
21630
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
29 ## The warning message may have multiple lines separated by newline characters |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
30 ## ("\n"), or it may be a cellstr array with one element for each line. |
15625
acf0addfc610
include Octave Forge java package in core Octave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
31 ## |
21630
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
32 ## The return value @var{h} is always 1. |
20071
98d10871018a
Accept CREATEMODE argument for errordlg, warndlg, msgbox (bug #44775).
Rik <rik@octave.org>
parents:
19596
diff
changeset
|
33 ## |
98d10871018a
Accept CREATEMODE argument for errordlg, warndlg, msgbox (bug #44775).
Rik <rik@octave.org>
parents:
19596
diff
changeset
|
34 ## Compatibility Note: The optional argument @var{createmode} is accepted for |
21630
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
35 ## @sc{matlab} compatibility, but is not implemented. See @code{msgbox} for |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
36 ## details. |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
37 ## |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
38 ## Examples: |
20071
98d10871018a
Accept CREATEMODE argument for errordlg, warndlg, msgbox (bug #44775).
Rik <rik@octave.org>
parents:
19596
diff
changeset
|
39 ## |
21630
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
40 ## @example |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
41 ## @group |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
42 ## warndlg ("Some warning text for the user."); |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
43 ## warndlg ("Some warning text\nwith two lines."); |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
44 ## warndlg (@{"Some warning text", "with two lines."@}); |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
45 ## warndlg ("Some warning text for the user.", "Fancy caption"); |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
46 ## @end group |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
47 ## @end example |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
48 ## |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
49 ## @seealso{errordlg, helpdlg, inputdlg, listdlg, msgbox, questdlg} |
15625
acf0addfc610
include Octave Forge java package in core Octave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
50 ## @end deftypefn |
acf0addfc610
include Octave Forge java package in core Octave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
51 |
21630
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
52 function retval = warndlg (varargin) |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
53 |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
54 narginchk (0, 3); |
15772
0f1a143e5002
Overhaul scripts/java directory to conform to Octave core.
Rik <rik@octave.org>
parents:
15749
diff
changeset
|
55 |
21630
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
56 box_msg = "This is the default warning string."; |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
57 box_title = "Warning Dialog"; |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
58 |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
59 if (nargin > 0) |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
60 box_msg = varargin{1}; |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
61 endif |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
62 if (nargin > 1) |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
63 box_title = varargin{2}; |
15772
0f1a143e5002
Overhaul scripts/java directory to conform to Octave core.
Rik <rik@octave.org>
parents:
15749
diff
changeset
|
64 endif |
15709
9fee0b741de6
Update Java dialog scrips to latest octave-forge status
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
15625
diff
changeset
|
65 |
21630
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
66 if (nargin < 3) |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
67 retval = msgbox (box_msg, box_title, "warn"); |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
68 else |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
69 retval = msgbox (box_msg, box_title, "warn", varargin{3}); |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
70 endif |
15625
acf0addfc610
include Octave Forge java package in core Octave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
71 |
acf0addfc610
include Octave Forge java package in core Octave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
72 endfunction |
15772
0f1a143e5002
Overhaul scripts/java directory to conform to Octave core.
Rik <rik@octave.org>
parents:
15749
diff
changeset
|
73 |
21630
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
74 %!error<narginchk> warndlg (1, 2, 3, 4) |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
75 %!error<MSG must be a character string> warndlg (1) |
b5d9b95d1e1a
Removing Java dialog boxes.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
21005
diff
changeset
|
76 %!error<TITLE must be a character string> warndlg ("msg", 1) |