annotate scripts/gui/msgbox.m @ 20509:c5a8eff5a05d

gallery: add very basic tests (check output size) for all matrix types.
author Carnë Draug <carandraug@octave.org>
date Fri, 03 Jul 2015 16:53:08 +0100
parents aa36fb998a4d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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 -*-
15772
0f1a143e5002 Overhaul scripts/java directory to conform to Octave core.
Rik <rik@octave.org>
parents: 15750
diff changeset
20 ## @deftypefn {Function File} {@var{h} =} msgbox (@var{msg})
0f1a143e5002 Overhaul scripts/java directory to conform to Octave core.
Rik <rik@octave.org>
parents: 15750
diff changeset
21 ## @deftypefnx {Function File} {@var{h} =} msgbox (@var{msg}, @var{title})
0f1a143e5002 Overhaul scripts/java directory to conform to Octave core.
Rik <rik@octave.org>
parents: 15750
diff changeset
22 ## @deftypefnx {Function File} {@var{h} =} msgbox (@var{msg}, @var{title}, @var{icon})
20281
98d10871018a Accept CREATEMODE argument for errordlg, warndlg, msgbox (bug #44775).
Rik <rik@octave.org>
parents: 19793
diff changeset
23 ## @deftypefnx {Function File} {@var{h} =} msgbox (@dots{}, @var{createmode})
19790
446c46af4b42 strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
24 ## Display @var{msg} using a message dialog box.
15625
acf0addfc610 include Octave Forge java package in core Octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
25 ##
20383
777f26aa8e3e doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 20281
diff changeset
26 ## The message may have multiple lines separated by newline characters ("\n"),
777f26aa8e3e doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 20281
diff changeset
27 ## or it may be a cellstr array with one element for each line.
777f26aa8e3e doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 20281
diff changeset
28 ##
777f26aa8e3e doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 20281
diff changeset
29 ## The optional input @var{title} (character string) can be used to decorate
777f26aa8e3e doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 20281
diff changeset
30 ## the dialog caption.
15709
9fee0b741de6 Update Java dialog scrips to latest octave-forge status
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 15625
diff changeset
31 ##
19790
446c46af4b42 strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
32 ## The optional argument @var{icon} selects a dialog icon.
20383
777f26aa8e3e doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 20281
diff changeset
33 ## It can be one of @qcode{"none"} (default), @qcode{"error"}, @qcode{"help"},
777f26aa8e3e doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 20281
diff changeset
34 ## or @qcode{"warn"}.
15748
54e8c2527a9e style and doc fixes for newly imported Java package .m files
John W. Eaton <jwe@octave.org>
parents: 15746
diff changeset
35 ##
15625
acf0addfc610 include Octave Forge java package in core Octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
36 ## The return value is always 1.
20281
98d10871018a Accept CREATEMODE argument for errordlg, warndlg, msgbox (bug #44775).
Rik <rik@octave.org>
parents: 19793
diff changeset
37 ##
98d10871018a Accept CREATEMODE argument for errordlg, warndlg, msgbox (bug #44775).
Rik <rik@octave.org>
parents: 19793
diff changeset
38 ## Compatibility Note: The optional argument @var{createmode} is accepted for
98d10871018a Accept CREATEMODE argument for errordlg, warndlg, msgbox (bug #44775).
Rik <rik@octave.org>
parents: 19793
diff changeset
39 ## @sc{matlab} compatibility, but is not implemented.
20391
aa36fb998a4d maint: Remove unnecessary whitespace at end of lines.
Rik <rik@octave.org>
parents: 20383
diff changeset
40 ##
15772
0f1a143e5002 Overhaul scripts/java directory to conform to Octave core.
Rik <rik@octave.org>
parents: 15750
diff changeset
41 ## @seealso{errordlg, helpdlg, inputdlg, listdlg, questdlg, warndlg}
15625
acf0addfc610 include Octave Forge java package in core Octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
42 ## @end deftypefn
acf0addfc610 include Octave Forge java package in core Octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
43
16508
f19e24c97b20 move common warndlg, errordlg, helpdlg, and msgbox code to private function
John W. Eaton <jwe@octave.org>
parents: 16505
diff changeset
44 function retval = msgbox (msg, title = "", varargin)
15772
0f1a143e5002 Overhaul scripts/java directory to conform to Octave core.
Rik <rik@octave.org>
parents: 15750
diff changeset
45
20281
98d10871018a Accept CREATEMODE argument for errordlg, warndlg, msgbox (bug #44775).
Rik <rik@octave.org>
parents: 19793
diff changeset
46 if (nargin < 1 || nargin > 4)
15772
0f1a143e5002 Overhaul scripts/java directory to conform to Octave core.
Rik <rik@octave.org>
parents: 15750
diff changeset
47 print_usage ();
0f1a143e5002 Overhaul scripts/java directory to conform to Octave core.
Rik <rik@octave.org>
parents: 15750
diff changeset
48 endif
15709
9fee0b741de6 Update Java dialog scrips to latest octave-forge status
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 15625
diff changeset
49
16508
f19e24c97b20 move common warndlg, errordlg, helpdlg, and msgbox code to private function
John W. Eaton <jwe@octave.org>
parents: 16505
diff changeset
50 retval = message_dialog ("msgbox", msg, title, varargin{:});
15625
acf0addfc610 include Octave Forge java package in core Octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
51
acf0addfc610 include Octave Forge java package in core Octave
John W. Eaton <jwe@octave.org>
parents:
diff changeset
52 endfunction
15772
0f1a143e5002 Overhaul scripts/java directory to conform to Octave core.
Rik <rik@octave.org>
parents: 15750
diff changeset
53
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16508
diff changeset
54
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16508
diff changeset
55 %!demo
17337
a31b54b5f84a Use only 1 space between '%!' and start of test/demo code.
Rik <rik@octave.org>
parents: 17281
diff changeset
56 %! disp('- test msgbox message only.');
a31b54b5f84a Use only 1 space between '%!' and start of test/demo code.
Rik <rik@octave.org>
parents: 17281
diff changeset
57 %! msgbox("Below, you should see 3 lines:\nline #1\nline #2, and\nline #3.");
a31b54b5f84a Use only 1 space between '%!' and start of test/demo code.
Rik <rik@octave.org>
parents: 17281
diff changeset
58
a31b54b5f84a Use only 1 space between '%!' and start of test/demo code.
Rik <rik@octave.org>
parents: 17281
diff changeset
59 %!demo
a31b54b5f84a Use only 1 space between '%!' and start of test/demo code.
Rik <rik@octave.org>
parents: 17281
diff changeset
60 %! disp('- test msgbox message and caption.');
a31b54b5f84a Use only 1 space between '%!' and start of test/demo code.
Rik <rik@octave.org>
parents: 17281
diff changeset
61 %! msgbox('You should see a single line.','A msgbox');
a31b54b5f84a Use only 1 space between '%!' and start of test/demo code.
Rik <rik@octave.org>
parents: 17281
diff changeset
62