Modifying any of the .figure_position, .figure_size and .axes_size properties of
a docked graphical figure moves or/and resizes the whole Scilab Desktop!
Testing if a Figure is docked before modifying these properties allows to avoid
such bad effect. See http://bugzilla.scilab.org/11476
Any comment, scoring and bug report is welcome here-below.
--------------------
-->isDocked
function [yn] = isDocked(fh)
Tests whether a (set of) graphical figure is docked to Scilab desktop
CALLING SEQUENCES
isDocked // displays this help
yn = isDocked(fh)
PARAMETERS
fh: figure's handle or matrix of figures handles
yn: boolean or matrix of booleans, with the sizes of fh
DESCRIPTION
yn(i) is set to %T (true) if fh(i) is a figure docked to the Scilab desktop.
It is set to %F otherwise.
isDocked(..) allows avoiding to reset figures properties such that
.figure_position, .figure_size and .axes_size that all affect the
whole Scilab desktop when the related figure is docked.
EXAMPLE
clf
plot2d()
// Then please dock this figure by hand
f = gcf();
// We resize the figure only if it is not docked:
if ~isDocked(f), f.figure_size = [700,650], end
// Now unexpectedly resizing the whole desktop:
s = f.figure_size;
f.figure_size = [900,800]; // :(
// Restoring the desktop's size
f.figure_size = s;
// Testing a matrix of handles:
f2 = scf(); surf() // first, create a new undocked figure
isDocked([f f2 ; f2 f]) // then, do the test (here useless demo;)
SEE ALSO
* http://bugzilla.scilab.org/11476
HISTORY
2010-08-15: Creation
2013-04-27: Checking that handles are of Figure type. vectorization added.
2015-06-07: Improvements. Bugs fixed. First release on FileExchange.