Mercurial > hg > octave-nkf
annotate scripts/gui/msgbox.m @ 20177:15e5eb7a0c1d
make dist: add updated zoom images to EXTRADIST (bug #44579)
* libgui/graphics/module.mk: add graphics/images/zoom-in.png, graphics/images/zoom-out.png, remove graphics/images/zoom.png
author | John Donoghue |
---|---|
date | Thu, 19 Mar 2015 08:37:47 -0400 |
parents | 0e1f5a750d00 |
children | 98d10871018a |
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}) |
19790
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
23 ## 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
|
24 ## |
15748
54e8c2527a9e
style and doc fixes for newly imported Java package .m files
John W. Eaton <jwe@octave.org>
parents:
15746
diff
changeset
|
25 ## The message may have multiple lines separated by newline characters |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
16512
diff
changeset
|
26 ## (@qcode{"\n"}), or it may be a cellstr array with one element for each |
15772
0f1a143e5002
Overhaul scripts/java directory to conform to Octave core.
Rik <rik@octave.org>
parents:
15750
diff
changeset
|
27 ## line. The optional input @var{title} (character string) can be used to |
15748
54e8c2527a9e
style and doc fixes for newly imported Java package .m files
John W. Eaton <jwe@octave.org>
parents:
15746
diff
changeset
|
28 ## decorate the dialog caption. |
15709
9fee0b741de6
Update Java dialog scrips to latest octave-forge status
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
15625
diff
changeset
|
29 ## |
19790
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
30 ## The optional argument @var{icon} selects a dialog icon. |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
16512
diff
changeset
|
31 ## It can be one of @qcode{"none"} (default), @qcode{"error"}, |
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
16512
diff
changeset
|
32 ## @qcode{"help"}, 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
|
33 ## |
15625
acf0addfc610
include Octave Forge java package in core Octave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
34 ## The return value is always 1. |
15772
0f1a143e5002
Overhaul scripts/java directory to conform to Octave core.
Rik <rik@octave.org>
parents:
15750
diff
changeset
|
35 ## @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
|
36 ## @end deftypefn |
acf0addfc610
include Octave Forge java package in core Octave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
37 |
16508
f19e24c97b20
move common warndlg, errordlg, helpdlg, and msgbox code to private function
John W. Eaton <jwe@octave.org>
parents:
16505
diff
changeset
|
38 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
|
39 |
0f1a143e5002
Overhaul scripts/java directory to conform to Octave core.
Rik <rik@octave.org>
parents:
15750
diff
changeset
|
40 if (nargin < 1 || nargin > 3) |
0f1a143e5002
Overhaul scripts/java directory to conform to Octave core.
Rik <rik@octave.org>
parents:
15750
diff
changeset
|
41 print_usage (); |
0f1a143e5002
Overhaul scripts/java directory to conform to Octave core.
Rik <rik@octave.org>
parents:
15750
diff
changeset
|
42 endif |
15709
9fee0b741de6
Update Java dialog scrips to latest octave-forge status
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
15625
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 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
|
45 |
acf0addfc610
include Octave Forge java package in core Octave
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
46 endfunction |
15772
0f1a143e5002
Overhaul scripts/java directory to conform to Octave core.
Rik <rik@octave.org>
parents:
15750
diff
changeset
|
47 |
16512
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16508
diff
changeset
|
48 |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16508
diff
changeset
|
49 %!demo |
17337
a31b54b5f84a
Use only 1 space between '%!' and start of test/demo code.
Rik <rik@octave.org>
parents:
17281
diff
changeset
|
50 %! 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
|
51 %! 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
|
52 |
a31b54b5f84a
Use only 1 space between '%!' and start of test/demo code.
Rik <rik@octave.org>
parents:
17281
diff
changeset
|
53 %!demo |
a31b54b5f84a
Use only 1 space between '%!' and start of test/demo code.
Rik <rik@octave.org>
parents:
17281
diff
changeset
|
54 %! 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
|
55 %! 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
|
56 |