annotate scripts/plot/util/findall.m @ 23084:ef4d915df748

maint: Merge stable to default.
author John W. Eaton <jwe@octave.org>
date Mon, 23 Jan 2017 14:27:48 -0500
parents 3a2b891d0b33 e9a0469dedd9
children 092078913d54
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
22323
bac0d6f07a3e maint: Update copyright notices for 2016.
John W. Eaton <jwe@octave.org>
parents: 21511
diff changeset
1 ## Copyright (C) 2008-2016 Bill Denney
7557
2ba84879f961 allchild.m, findall.m: new functions
bill@denney.ws
parents:
diff changeset
2 ##
2ba84879f961 allchild.m, findall.m: new functions
bill@denney.ws
parents:
diff changeset
3 ## This file is part of Octave.
2ba84879f961 allchild.m, findall.m: new functions
bill@denney.ws
parents:
diff changeset
4 ##
2ba84879f961 allchild.m, findall.m: new functions
bill@denney.ws
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
2ba84879f961 allchild.m, findall.m: new functions
bill@denney.ws
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22532
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22532
diff changeset
8 ## (at your option) any later version.
7557
2ba84879f961 allchild.m, findall.m: new functions
bill@denney.ws
parents:
diff changeset
9 ##
2ba84879f961 allchild.m, findall.m: new functions
bill@denney.ws
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
2ba84879f961 allchild.m, findall.m: new functions
bill@denney.ws
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22532
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22532
diff changeset
13 ## GNU General Public License for more details.
7557
2ba84879f961 allchild.m, findall.m: new functions
bill@denney.ws
parents:
diff changeset
14 ##
2ba84879f961 allchild.m, findall.m: new functions
bill@denney.ws
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
2ba84879f961 allchild.m, findall.m: new functions
bill@denney.ws
parents:
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
2ba84879f961 allchild.m, findall.m: new functions
bill@denney.ws
parents:
diff changeset
17 ## <http://www.gnu.org/licenses/>.
2ba84879f961 allchild.m, findall.m: new functions
bill@denney.ws
parents:
diff changeset
18
2ba84879f961 allchild.m, findall.m: new functions
bill@denney.ws
parents:
diff changeset
19 ## -*- texinfo -*-
20852
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 19697
diff changeset
20 ## @deftypefn {} {@var{h} =} findall ()
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 19697
diff changeset
21 ## @deftypefnx {} {@var{h} =} findall (@var{prop_name}, @var{prop_value}, @dots{})
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 19697
diff changeset
22 ## @deftypefnx {} {@var{h} =} findall (@var{prop_name}, @var{prop_value}, "-@var{logical_op}", @var{prop_name}, @var{prop_value})
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 19697
diff changeset
23 ## @deftypefnx {} {@var{h} =} findall ("-property", @var{prop_name})
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 19697
diff changeset
24 ## @deftypefnx {} {@var{h} =} findall ("-regexp", @var{prop_name}, @var{pattern})
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 19697
diff changeset
25 ## @deftypefnx {} {@var{h} =} findall (@var{hlist}, @dots{})
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 19697
diff changeset
26 ## @deftypefnx {} {@var{h} =} findall (@var{hlist}, "flat", @dots{})
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 19697
diff changeset
27 ## @deftypefnx {} {@var{h} =} findall (@var{hlist}, "-depth", @var{d}, @dots{})
17122
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 17119
diff changeset
28 ## Find graphics object, including hidden ones, with specified property values.
7557
2ba84879f961 allchild.m, findall.m: new functions
bill@denney.ws
parents:
diff changeset
29 ##
17122
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 17119
diff changeset
30 ## The return value @var{h} is a list of handles to the found graphic objects.
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 17119
diff changeset
31 ##
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 17119
diff changeset
32 ## @code{findall} performs the same search as @code{findobj}, but it
17281
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17238
diff changeset
33 ## includes hidden objects (HandleVisibility = @qcode{"off"}). For full
17122
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 17119
diff changeset
34 ## documentation, @pxref{XREFfindobj,,findobj}.
eaab03308c0b doc: Rewrite docstrings for most plot functions.
Rik <rik@octave.org>
parents: 17119
diff changeset
35 ## @seealso{findobj, allchild, get, set}
7557
2ba84879f961 allchild.m, findall.m: new functions
bill@denney.ws
parents:
diff changeset
36 ## @end deftypefn
2ba84879f961 allchild.m, findall.m: new functions
bill@denney.ws
parents:
diff changeset
37
2ba84879f961 allchild.m, findall.m: new functions
bill@denney.ws
parents:
diff changeset
38 ## Author: Bill Denney <bill@denney.ws>
2ba84879f961 allchild.m, findall.m: new functions
bill@denney.ws
parents:
diff changeset
39
2ba84879f961 allchild.m, findall.m: new functions
bill@denney.ws
parents:
diff changeset
40 function h = findall (varargin)
2ba84879f961 allchild.m, findall.m: new functions
bill@denney.ws
parents:
diff changeset
41
2ba84879f961 allchild.m, findall.m: new functions
bill@denney.ws
parents:
diff changeset
42 unwind_protect
2ba84879f961 allchild.m, findall.m: new functions
bill@denney.ws
parents:
diff changeset
43 shh = get (0, "showhiddenhandles");
2ba84879f961 allchild.m, findall.m: new functions
bill@denney.ws
parents:
diff changeset
44 set (0, "showhiddenhandles", "on");
2ba84879f961 allchild.m, findall.m: new functions
bill@denney.ws
parents:
diff changeset
45 h = findobj (varargin{:});
2ba84879f961 allchild.m, findall.m: new functions
bill@denney.ws
parents:
diff changeset
46 unwind_protect_cleanup
2ba84879f961 allchild.m, findall.m: new functions
bill@denney.ws
parents:
diff changeset
47 set (0, "showhiddenhandles", shh);
2ba84879f961 allchild.m, findall.m: new functions
bill@denney.ws
parents:
diff changeset
48 end_unwind_protect
2ba84879f961 allchild.m, findall.m: new functions
bill@denney.ws
parents:
diff changeset
49
2ba84879f961 allchild.m, findall.m: new functions
bill@denney.ws
parents:
diff changeset
50 endfunction
13096
5553412c6614 Tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 11523
diff changeset
51
13977
08ae07e40d4f Only run uimenu tests if FLTK toolkit is available (Bug #34908)
Rik <octave@nomad.inbox5.com>
parents: 13141
diff changeset
52
21511
e1c5aca1c798 Fix failing tests when building with --without-opengl
Mike Miller <mtmiller@octave.org>
parents: 20852
diff changeset
53 %!testif HAVE_OPENGL, HAVE_FLTK
22532
c06e83d47ac3 Check at run-time for a window system befor executing HAVE_FLTK tests (bug #49138).
Rik <rik@octave.org>
parents: 22323
diff changeset
54 %! if (! have_window_system)
c06e83d47ac3 Check at run-time for a window system befor executing HAVE_FLTK tests (bug #49138).
Rik <rik@octave.org>
parents: 22323
diff changeset
55 %! return;
c06e83d47ac3 Check at run-time for a window system befor executing HAVE_FLTK tests (bug #49138).
Rik <rik@octave.org>
parents: 22323
diff changeset
56 %! endif
17107
dbd64c9a16da Restore graphics toolkit after %!tests that alter it.
Rik <rik@octave.org>
parents: 14138
diff changeset
57 %! toolkit = graphics_toolkit ("fltk");
17119
bd50e0660545 test: Add missing semicolons to suppress output in some plot %!tests.
Rik <rik@octave.org>
parents: 17107
diff changeset
58 %! hf = figure ("visible", "off");
13141
e81ddf9cacd5 maint: untabify and remove trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 13124
diff changeset
59 %! unwind_protect
13111
ebb42fb2da04 Various fixes for tests in scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 13096
diff changeset
60 %! h = findall (hf);
17238
3fd617363762 findobj.m: Return handles in hierarchy order rather than sorted order (bug #39767).
Rik <rik@octave.org>
parents: 17122
diff changeset
61 %! all_handles(1) = {"figure"};
18965
137d01e7c2d4 New scripts pan.m and rotate3d.m, update __add_default_menu__.m
Andreas Weber <andy.weber.aw@gmail.com>
parents: 18961
diff changeset
62 %! all_handles(2:18,1) = {"uimenu"};
13977
08ae07e40d4f Only run uimenu tests if FLTK toolkit is available (Bug #34908)
Rik <octave@nomad.inbox5.com>
parents: 13141
diff changeset
63 %! assert (get (h, "type"), all_handles);
13096
5553412c6614 Tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 11523
diff changeset
64 %! unwind_protect_cleanup
5553412c6614 Tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 11523
diff changeset
65 %! close (hf);
13977
08ae07e40d4f Only run uimenu tests if FLTK toolkit is available (Bug #34908)
Rik <octave@nomad.inbox5.com>
parents: 13141
diff changeset
66 %! graphics_toolkit (toolkit);
13096
5553412c6614 Tests for scripts/plot
Kai Habel <kai.habel@gmx.de>
parents: 11523
diff changeset
67 %! end_unwind_protect