Scilab Home Page | Wiki | Bug Tracker | Forge | Mailing List Archives | Scilab Online Help | ATOMS
File : Details
Login with GitLab

isDocked(figure)

Tests whether a figure is docked to Scilab's desktop
(1123 downloads for this version - 1123 downloads for all versions)
Details
Version
1.0
Author
Samuel Gougeon
Maintainer
Samuel Gougeon
Category
License
Supported Scilab Version
5.4
Creation Date
June 7, 2015
Description
            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.
            
Files (1)
[2.98 kB]
Miscellaneous file
Macro defining the isDocked() function

* MAKE IT AVAILABLE in EVERY SESSION: Click here to see HOW TO

* Get help: Enter "isDocked" without parameters 

News (0)
Comments (0)
Leave a comment
You must register and log in before leaving a comment.
Login with GitLab
Email notifications
Send me email when this toolbox has changes, new files or a new release.
You must register and log in before setting up notifications.