annotate scripts/gui/uigetdir.m @ 20173:777f26aa8e3e stable

doc: Update more docstrings to have one sentence summary as first line. Reviewed plot/ and gui/ in scripts directory. * scripts/gui/errordlg.m, scripts/gui/helpdlg.m, scripts/gui/inputdlg.m, scripts/gui/listdlg.m, scripts/gui/msgbox.m, scripts/gui/private/__get_funcname__.m, scripts/gui/private/__uiobject_split_args__.m, scripts/gui/questdlg.m, scripts/gui/uigetdir.m, scripts/gui/uigetfile.m, scripts/gui/uiwait.m, scripts/gui/waitbar.m, scripts/gui/warndlg.m, scripts/plot/appearance/annotation.m, scripts/plot/appearance/axis.m, scripts/plot/appearance/box.m, scripts/plot/appearance/caxis.m, scripts/plot/appearance/datetick.m, scripts/plot/appearance/hidden.m, scripts/plot/appearance/legend.m, scripts/plot/appearance/xlim.m, scripts/plot/appearance/ylim.m, scripts/plot/appearance/zlim.m, scripts/plot/draw/area.m, scripts/plot/draw/comet.m, scripts/plot/draw/comet3.m, scripts/plot/draw/contour.m, scripts/plot/draw/contourf.m, scripts/plot/draw/isocolors.m, scripts/plot/draw/isonormals.m, scripts/plot/draw/isosurface.m, scripts/plot/draw/plotmatrix.m, scripts/plot/draw/quiver.m, scripts/plot/draw/quiver3.m, scripts/plot/draw/ribbon.m, scripts/plot/draw/semilogxerr.m, scripts/plot/draw/semilogyerr.m, scripts/plot/draw/sphere.m, scripts/plot/draw/surfl.m, scripts/plot/draw/tetramesh.m, scripts/plot/util/allchild.m, scripts/plot/util/ancestor.m, scripts/plot/util/axes.m, scripts/plot/util/colstyle.m, scripts/plot/util/frame2im.m, scripts/plot/util/gnuplot_binary.in, scripts/plot/util/hgsave.m, scripts/plot/util/im2frame.m, scripts/plot/util/isaxes.m, scripts/plot/util/isfigure.m, scripts/plot/util/linkaxes.m, scripts/plot/util/ndgrid.m, scripts/plot/util/pan.m, scripts/plot/util/print.m, scripts/plot/util/printd.m, scripts/plot/util/private/__add_default_menu__.m, scripts/plot/util/rotate.m, scripts/plot/util/rotate3d.m, scripts/plot/util/saveas.m, scripts/plot/util/struct2hdl.m, scripts/plot/util/subplot.m, scripts/plot/util/zoom.m: Update more docstrings to have one sentence summary as first line.
author Rik <rik@octave.org>
date Sat, 09 May 2015 22:50:09 -0700
parents 9b7ca334a104
children 516bb87ea72e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19697
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 18971
diff changeset
1 ## Copyright (C) 2010-2015 Kai Habel
11283
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
2 ##
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
3 ## This file is part of Octave.
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
4 ##
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
8 ## your option) any later version.
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
9 ##
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
13 ## General Public License for more details.
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
14 ##
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
17 ## <http://www.gnu.org/licenses/>.
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
18
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
19 ## -*- texinfo -*-
11469
c776f063fefe Overhaul m-script files to use common variable name between code and documentation.
Rik <octave@nomad.inbox5.com>
parents: 11295
diff changeset
20 ## @deftypefn {Function File} {@var{dirname} =} uigetdir ()
11283
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
21 ## @deftypefnx {Function File} {@var{dirname} =} uigetdir (@var{init_path})
11469
c776f063fefe Overhaul m-script files to use common variable name between code and documentation.
Rik <octave@nomad.inbox5.com>
parents: 11295
diff changeset
22 ## @deftypefnx {Function File} {@var{dirname} =} uigetdir (@var{init_path}, @var{dialog_name})
19833
9fc020886ae9 maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19799
diff changeset
23 ## Open a GUI dialog for selecting a directory.
9fc020886ae9 maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19799
diff changeset
24 ##
9fc020886ae9 maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19799
diff changeset
25 ## If @var{init_path} is not given the current working directory is used.
20173
777f26aa8e3e doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19848
diff changeset
26 ##
19833
9fc020886ae9 maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19799
diff changeset
27 ## @var{dialog_name} may be used to customize the dialog title.
15532
95d7475a0a89 doc: Add seealso links between uigetfile, uiputfile, uigetdir.
Rik <rik@octave.org>
parents: 15467
diff changeset
28 ## @seealso{uigetfile, uiputfile}
11283
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
29 ## @end deftypefn
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
30
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
31 ## Author: Kai Habel
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
32
13697
0f8ff98929b2 Allow a toolkit to provide its own version of UI dialogs.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 13215
diff changeset
33 function dirname = uigetdir (init_path = pwd, dialog_name = "Select Directory to Open")
11283
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
34
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
35 if (nargin > 2)
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
36 print_usage ();
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
37 endif
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
38
19833
9fc020886ae9 maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19799
diff changeset
39 if (! ischar (init_path) || ! ischar (dialog_name))
11469
c776f063fefe Overhaul m-script files to use common variable name between code and documentation.
Rik <octave@nomad.inbox5.com>
parents: 11295
diff changeset
40 error ("uigetdir: INIT_PATH and DIALOG_NAME must be string arguments");
c776f063fefe Overhaul m-script files to use common variable name between code and documentation.
Rik <octave@nomad.inbox5.com>
parents: 11295
diff changeset
41 endif
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11583
diff changeset
42
19833
9fc020886ae9 maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19799
diff changeset
43 if (! isdir (init_path))
12522
33bbae85769a Add uimenu, uigetdir, uigetfile, and uiputfile to documentation.
Rik <octave@nomad.inbox5.com>
parents: 12183
diff changeset
44 init_path = fileparts (init_path);
11283
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
45 endif
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
46
19848
9b7ca334a104 Backout cset a9952a647d52 and use __octave_link_enabled__ rather than isguirunning.
Rik <rik@octave.org>
parents: 19833
diff changeset
47 if (__octave_link_enabled__ ())
16655
8fa0b416f465 * uigetdir.m: Eliminate unnecessary cell array for function args.
John W. Eaton <jwe@octave.org>
parents: 16654
diff changeset
48 file_filter = cell (0, 2);
8fa0b416f465 * uigetdir.m: Eliminate unnecessary cell array for function args.
John W. Eaton <jwe@octave.org>
parents: 16654
diff changeset
49 default_file_name = "";
8fa0b416f465 * uigetdir.m: Eliminate unnecessary cell array for function args.
John W. Eaton <jwe@octave.org>
parents: 16654
diff changeset
50 dialog_position = [240, 120];
8fa0b416f465 * uigetdir.m: Eliminate unnecessary cell array for function args.
John W. Eaton <jwe@octave.org>
parents: 16654
diff changeset
51 dialog_mode = "dir";
16654
510b711f4e31 Added uigetdir to octave_link
John Donoghue <john.donoghue@ieee.org>
parents: 15532
diff changeset
52
16655
8fa0b416f465 * uigetdir.m: Eliminate unnecessary cell array for function args.
John W. Eaton <jwe@octave.org>
parents: 16654
diff changeset
53 [filename, dirname, filterindex] ...
8fa0b416f465 * uigetdir.m: Eliminate unnecessary cell array for function args.
John W. Eaton <jwe@octave.org>
parents: 16654
diff changeset
54 = __octave_link_file_dialog__ (file_filter, dialog_name,
8fa0b416f465 * uigetdir.m: Eliminate unnecessary cell array for function args.
John W. Eaton <jwe@octave.org>
parents: 16654
diff changeset
55 default_file_name, dialog_position,
8fa0b416f465 * uigetdir.m: Eliminate unnecessary cell array for function args.
John W. Eaton <jwe@octave.org>
parents: 16654
diff changeset
56 dialog_mode, init_path);
16654
510b711f4e31 Added uigetdir to octave_link
John Donoghue <john.donoghue@ieee.org>
parents: 15532
diff changeset
57 else
19833
9fc020886ae9 maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19799
diff changeset
58 funcname = __get_funcname__ (mfilename ());
16654
510b711f4e31 Added uigetdir to octave_link
John Donoghue <john.donoghue@ieee.org>
parents: 15532
diff changeset
59 dirname = feval (funcname, init_path, dialog_name);
510b711f4e31 Added uigetdir to octave_link
John Donoghue <john.donoghue@ieee.org>
parents: 15532
diff changeset
60 endif
19833
9fc020886ae9 maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19799
diff changeset
61
11283
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
62 endfunction
58f175d39a7a GUI file functions
Kai Habel <kai.habel@gmx.de>
parents:
diff changeset
63
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
64
11583
c4c2cd67c440 Fixes for ui file functions, bug#32190
Kai Habel <kai.habel@gmx.de>
parents: 11576
diff changeset
65 %!demo
14245
4506eade9f04 Use Matlab coding conventions for demos in plot/ directory.
Rik <octave@nomad.inbox5.com>
parents: 14237
diff changeset
66 %! uigetdir (pwd, 'Select Directory');
13215
cb8fd692b600 Add tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 12642
diff changeset
67
cb8fd692b600 Add tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 12642
diff changeset
68 ## Remove from test statistics. No real tests possible.
14237
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
69 %!assert (1)
11949c9795a0 Revamp %!demos in m-files to use Octave coding conventions on spacing, etc.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
70