Mercurial > octave
comparison scripts/gui/helpdlg.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 | 516bb87ea72e |
children | 59ebef9680ef |
comparison
equal
deleted
inserted
replaced
21629:9958cead45e2 | 21630:b5d9b95d1e1a |
---|---|
15 ## You should have received a copy of the GNU General Public License | 15 ## You should have received a copy of the GNU General Public License |
16 ## along with Octave; see the file COPYING. If not, see | 16 ## along with Octave; see the file COPYING. If not, see |
17 ## <http://www.gnu.org/licenses/>. | 17 ## <http://www.gnu.org/licenses/>. |
18 | 18 |
19 ## -*- texinfo -*- | 19 ## -*- texinfo -*- |
20 ## @deftypefn {} {@var{h} =} helpdlg (@var{msg}) | 20 ## @deftypefn {} {@var{h} =} helpdlg () |
21 ## @deftypefnx {} {@var{h} =} helpdlg (@var{msg}) | |
21 ## @deftypefnx {} {@var{h} =} helpdlg (@var{msg}, @var{title}) | 22 ## @deftypefnx {} {@var{h} =} helpdlg (@var{msg}, @var{title}) |
22 ## Display @var{msg} in a help dialog box. | 23 ## Display help message @var{msg} using a help dialog box with caption |
24 ## @var{title} (character string). The default help message is | |
25 ## @qcode{"This is the default help string."} and the default caption is | |
26 ## @qcode{"Help Dialog"}. | |
23 ## | 27 ## |
24 ## The message may have multiple lines separated by newline characters | 28 ## The help message may have multiple lines separated by newline characters |
25 ## ("\n"), or it may be a cellstr array with one element for each | 29 ## ("\n"), or it may be a cellstr array with one element for each line. |
26 ## line. | |
27 ## | 30 ## |
28 ## The optional input @var{title} (character string) can be used to | 31 ## The return value @var{h} is always 1. |
29 ## set the dialog caption. The default title is @qcode{"Help Dialog"}. | |
30 ## | 32 ## |
31 ## The return value is always 1. | 33 ## Examples: |
34 ## | |
35 ## @example | |
36 ## @group | |
37 ## helpdlg ("Some helpful text for the user."); | |
38 ## helpdlg ("Some helpful text\nwith two lines."); | |
39 ## helpdlg (@{"Some helpful text", "with two lines."@}); | |
40 ## helpdlg ("Some helpful text for the user.", "Fancy caption"); | |
41 ## @end group | |
42 ## @end example | |
43 ## | |
32 ## @seealso{errordlg, inputdlg, listdlg, msgbox, questdlg, warndlg} | 44 ## @seealso{errordlg, inputdlg, listdlg, msgbox, questdlg, warndlg} |
33 ## @end deftypefn | 45 ## @end deftypefn |
34 | 46 |
35 function retval = helpdlg (msg, title = "Help Dialog") | 47 function retval = helpdlg (varargin) |
36 | 48 |
37 if (nargin < 1 || nargin > 2) | 49 narginchk (0, 2); |
38 print_usage (); | 50 |
51 box_msg = "This is the default help string."; | |
52 box_title = "Help Dialog"; | |
53 | |
54 if (nargin > 0) | |
55 box_msg = varargin{1}; | |
56 endif | |
57 if (nargin > 1) | |
58 box_title = varargin{2}; | |
39 endif | 59 endif |
40 | 60 |
41 retval = message_dialog ("helpdlg", msg, title, "help"); | 61 retval = msgbox (box_msg, box_title, "help"); |
42 | 62 |
43 endfunction | 63 endfunction |
44 | 64 |
45 | 65 %!error<narginchk> helpdlg (1, 2, 3) |
46 %!demo | 66 %!error<MSG must be a character string> helpdlg (1) |
47 %! disp ('- test helpdlg with a help message only.'); | 67 %!error<TITLE must be a character string> helpdlg ("msg", 1) |
48 %! helpdlg ("Below, you should see 3 lines:\nline #1\nline #2, and\nline #3."); | |
49 | |
50 %!demo | |
51 %! disp ('- test helpdlg with help message and caption.'); | |
52 %! helpdlg ('You should see a single line.','A help dialog'); | |
53 |