BIOSCILAB
SCILAB 4.0 PAS-A-PAS
SCILAB 4.0 STEP-BY-STEP

Jacques-Deric Rouault

CNRS / INRIA

Volume 4   LE GRAPHISME
Volume 4   GRAPHISM
4.12   DECLARATION DES HANDLES
4.12   DECLARING HANDLES
Version 4.0.22 du 6 Janvier 2006 / Version 4.0.22, January 6th 2006
Scilab 3.1 - Scilab 4.0 /  Windows - Linux

4.11       LES VARIABLES GRAPHIQUES  / GRAPHIC VARIABLES
ALLER A L'INDEX GENERAL / GO TO THE GENERAL INDEX
ALLER A LA TABLE GENERALE / GO TO THE GENERAL TABLE
4.13       HIERARCHIE DES HANDLES  / HANDLES HIERARCHY 

4.12.01   Déclaration fonctionnelle  / Functionnal declaration
4.12.02   Déclaration par défaut  / Default declaration
4.12.03   Déclaration contextuelle  / Contextual declaration
4.12.04   Déclaration interactive  / Interactive declaration

4.12.01   Déclaration fonctionnelle  / Functionnal declaration

gda  (Déclaration de handle, Declaring a handle)
gdf  (Déclaration de handle, Declaring a handle)
glue  (Déclaration de handle, Declaring a handle)
scf  (Déclaration de handle, Declaring a handle)
unglue  (Déclaration de handle, Declaring a handle)


En général, il n'est pas possible de créér directement une variable de type handle.
Generally, it is not possible to directly create a variable of type handle.

Certaines fonctions retournent directement une valeur de handle.
Some functions directly return a value of handle.

La fonction scf créé une fenetre et retourne son handle (Voir 4.20.12).
The function scf creates a window and returns its handle (See 4.20.12).

//  Program Spas41201A
//  Designed for Scilab 3.1 & 4.0
//  Copyright Jacques-Deric Rouault, CNRS, INRIA

disp ("4.12.01A");
hf = scf (),

Télécharger le fichier / Download the file Spas41201A.sce

La fonction gdf retourne le handle de la fenetre par défaut. (Voir 4.14.03 ).
The function gdf returns the default window handle. (See 4.14.03).

La fonction gda retourne le handle du système d'axes par défaut. (Voir 4.14.03)
The function gda returns the default system of axes handle. (See 4.14.03).

//  Program Spas41201B
//  Designed for Scilab 3.1 & 4.0
//  Copyright Jacques-Deric Rouault, CNRS, INRIA

disp ("4.12.01B");
hfd = gdf (),
had = gda (),

Télécharger le fichier / Download the file Spas41201B.sce

La fonction glue retourne le handle d'agregation construit à partir d'autres handles. (Voir 4.30.50).
The function glue returns the agregation handle built from other handles. (See 4.30.50).

//  Program Spas41201C
//  Designed for Scilab 3.1 & 4.0
//  Copyright Jacques-Deric Rouault, CNRS, INRIA

disp ("4.12.01C");
hf = scf (1);
hf.figure_name = "4.12.01C";
ha = gce ();
xrect (0.1, 0.9, 0.8, 0.8);
hr = gce ();
xsegs ([0, 1], [0, 1]);
hs = gce ();
hg = glue ([hr, hs]);
delete (hf);

Télécharger le fichier / Download the file Spas41201C.sce

La fonction unglue retourne les handles des objets structurés en agregation. (Voir 4.30.51).
The function unglue returns the handles of objects structured in agregation. (See 4.30.51).

//  Program Spas41201D
//  Designed for Scilab 3.1 & 4.0
//  Copyright Jacques-Deric Rouault, CNRS, INRIA

disp ("4.12.01D");
hf = scf (1);
hf.figure_name = "4.12.01D";
ha = gce ();
xrect (0.1, 0.9, 0.8, 0.8);
hr = gce ();
xsegs ([0, 1], [0, 1]);
hs = gce ();
hg = glue ([hr, hs]);
vh = unglue (hg);
delete (hf);

Télécharger le fichier / Download the file Spas41201D.sce

4.12.02   Déclaration parentale  / Parent declaration

children (Déclaration parentale, Parent declaration)
gca

Quand une variable Figure associée à une fenetre graphique est créée par scf, une variable système d'axes Axes est également crée comme enfant. (Voir 4.23.01).
When a graphic window variable Figure is created by scf, a system of axes variable Axes is also created as child(ren). (See 4.23.01).

//  Program Spas41202A
//  Designed for Scilab 3.1 & 4.0
//  Copyright Jacques-Deric Rouault, CNRS, INRIA

disp ("4.12.02A");
hf = scf ();
ha = hf.children (1),

Télécharger le fichier / Download the file Spas41202A.sce

La déclaration ha=hf.children (1) est équivalente à ha=gca () (gca = get current axes)

The declaration ha=hf.children(1) is equivalent to ha=gca () (gca = get current axes).
//  Program Spas41202B
//  Designed for Scilab 3.1 & 4.0
//  Copyright Jacques-Deric Rouault, CNRS, INRIA

disp ("4.12.02B");
hf = scf ();
ha = gca (),

Télécharger le fichier / Download the file Spas41202B.sce

4.12.03   Déclaration contextuelle  / Contextual declaration

gce
get ("hdl")
hdl (get)


La fonction get ("hdl") retourne le handle du dernier objet graphique créé.
The function get ("hdl") returns the handle of the last created graphic object.

//  Program Spas41203A
//  Designed for Scilab 3.1 & 4.0
//  Copyright Jacques-Deric Rouault, CNRS, INRIA

disp ("4.12.03A");
xfrect (0.4, 0.6, 0.2, 0.2); 
hr = get ("hdl"),

Télécharger le fichier / Download the file Spas41203A.sce

La fonction gce est identique à get ("hdl").
The function gce is identical to get ("hdl").

//  Program Spas41203B
//  Designed for Scilab 3.1 & 4.0
//  Copyright Jacques-Deric Rouault, CNRS, INRIA

disp ("4.12.03B");
xfrect (0.4, 0.6, 0.2, 0.2); 
hr = gce (),

Télécharger le fichier / Download the file Spas41203B.sce

4.12.04   Déclaration interactive  / Interactive declaration



La barre d'outils de la fenetre graphique permet de créer directement des handles Segment, Polyline, Text, Rectangle ou Arcs.
Thetoolbar of the graphic window allows the direct creation of handles Segment, Polyline, Text, Rectangle or Arcs..

//  Program Spas41204A
//  Designed for Scilab 4.0
//  Copyright Jacques-Deric Rouault, CNRS, INRIA

disp ("4.12.04A");
hf = scf ();

Télécharger le fichier / Download the file Spas41204A.sce





4.11       LES VARIABLES GRAPHIQUES  / GRAPHIC VARIABLES
ALLER A L'INDEX GENERAL / GO TO THE GENERAL INDEX
ALLER A LA TABLE GENERALE / GO TO THE GENERAL TABLE
4.13       HIERARCHIE DES HANDLES  / HANDLES HIERARCHY