annotate scripts/gui/dialog.m @ 22299:9fc91bb2aec3

doc: grammarcheck documentation for 4.2 release. * container.txi, contrib.txi, diagperm.txi, errors.txi, external.txi, func.txi, image.txi, nonlin.txi, numbers.txi, plot.txi, quad.txi, sparse.txi, strings.txi, tips.txi, var.txi, vectorize.txi, __dispatch__.cc, cellfun.cc, file-io.cc, gsvd.cc, load-path.cc, regexp.cc, __init_gnuplot__.cc, __osmesa_print__.cc, qr.cc, xzip.cc, ov-classdef.cc, octave_config_info.m, grabcode.m, publish.m, dialog.m, condest.m, normest1.m, mkdir.m, ode23.m, ode45.m, odeplot.m, AbsRel_Norm.m, integrate_adaptive.m, integrate_const.m, integrate_n_steps.m, axis.m, isocaps.m, isocolors.m, isosurface.m, light.m, __calc_isovalue_from_data__.m, __marching_cube__.m, cov.m, median.m: doc: grammarcheck documentation for 4.2 release.
author Rik <rik@octave.org>
date Mon, 15 Aug 2016 10:05:50 -0700
parents 55f7de37b618
children 3a2b891d0b33 e9a0469dedd9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
21825
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
1 ## Copyright (C) 2016 John Donoghue
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
2 ##
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
3 ## This file is part of Octave.
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
4 ##
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
8 ## your option) any later version.
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
9 ##
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
13 ## General Public License for more details.
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
14 ##
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
17 ## <http://www.gnu.org/licenses/>.
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
18
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
19 ## -*- texinfo -*-
22299
9fc91bb2aec3 doc: grammarcheck documentation for 4.2 release.
Rik <rik@octave.org>
parents: 21937
diff changeset
20 ## @deftypefn {} {@var{h} =} dialog (@dots{}, "@var{property}", @var{value}, @dots{})
21825
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
21 ##
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
22 ## Create an empty modal dialog window that other uicontrols can be added to.
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
23 ##
22299
9fc91bb2aec3 doc: grammarcheck documentation for 4.2 release.
Rik <rik@octave.org>
parents: 21937
diff changeset
24 ## The dialog box is a figure object with properties as recommended for a
9fc91bb2aec3 doc: grammarcheck documentation for 4.2 release.
Rik <rik@octave.org>
parents: 21937
diff changeset
25 ## dialog box.
21825
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
26 ##
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
27 ## The default properties differing from a figure are:
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
28 ##
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
29 ## @table @asis
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
30 ## @item buttondownfcn
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
31 ## @code{if isempty(allchild(gcbf)), close(gcbf), end}
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
32 ##
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
33 ## @item colormap
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
34 ## []
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
35 ##
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
36 ## @item color
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
37 ## defaultuicontrolbackgroundcolor
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
38 ##
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
39 ## @item dockcontrols
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
40 ## off
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
41 ##
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
42 ## @item handlevisibility
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
43 ## callback
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
44 ##
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
45 ## @item integerhandle
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
46 ## off
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
47 ##
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
48 ## @item inverthardcopy
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
49 ## off
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
50 ##
21937
55f7de37b618 maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents: 21825
diff changeset
51 ## @item menubar
21825
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
52 ## none
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
53 ##
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
54 ## @item numbertitle
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
55 ## off
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
56 ##
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
57 ## @item paperpositionmode
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
58 ## auto
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
59 ##
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
60 ## @item resize
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
61 ## off
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
62 ##
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
63 ## @item visible
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
64 ## on
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
65 ##
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
66 ## @item windowstyle
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
67 ## modal
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
68 ##
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
69 ## @end table
21937
55f7de37b618 maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents: 21825
diff changeset
70 ##
21825
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
71 ##
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
72 ## Multiple property-value pairs may be specified for the dialog object, but
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
73 ## they must appear in pairs.
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
74 ##
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
75 ## The return value @var{h} is a graphics handle to the created figure.
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
76 ## object.
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
77 ##
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
78 ## Examples:
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
79 ##
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
80 ## @example
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
81 ## @group
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
82 ##
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
83 ## % create an empty dialog window titled 'Dialog Example'
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
84 ## h = dialog ("name", "Dialog Example");
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
85 ##
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
86 ## % create a button (default style)
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
87 ## b = uicontrol (h, "string", "OK", "position",[10 10 150 40], "callback","delete(gcf)");
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
88 ##
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
89 ## % wait for dialog to resume or close
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
90 ## uiwait (h);
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
91 ##
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
92 ## @end group
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
93 ## @end example
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
94 ##
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
95 ## @seealso{figure, uiwait}
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
96 ##
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
97 ## @end deftypefn
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
98
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
99 ## Author: jdonoghue
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
100
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
101 function h = dialog (varargin)
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
102
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
103 tmph = figure ( ...
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
104 "buttondownfcn", "if isempty(allchild(gcbf)), close(gcbf), endif", ...
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
105 "color", get(0,"defaultuicontrolbackgroundcolor"), ...
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
106 "colormap", [], ...
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
107 "dockcontrols", "off", ...
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
108 "handlevisibility", "callback", ...
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
109 "integerhandle", "off", ...
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
110 "inverthardcopy", "off", ...
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
111 "menubar", "none", ...
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
112 "numbertitle", "off", ...
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
113 "paperpositionmode", "auto", ...
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
114 "resize", "off", ...
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
115 "toolbar", "none", ...
21937
55f7de37b618 maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents: 21825
diff changeset
116 "visible", "on",
21825
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
117 "windowstyle", "modal", ...
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
118 varargin{:} );
21937
55f7de37b618 maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents: 21825
diff changeset
119
21825
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
120 if (nargout > 0)
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
121 h = tmph;
21937
55f7de37b618 maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents: 21825
diff changeset
122 endif
55f7de37b618 maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents: 21825
diff changeset
123
21825
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
124 endfunction
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
125
f1f17f13b3b9 Add dialog function (Bug #48136)
John Donoghue <john.donoghue@ieee.org>
parents:
diff changeset
126