Add loadGui and saveGui help pages.
[scilab.git] / scilab / modules / gui / help / en_US / loadGui.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="loadGui" xml:lang="en">
3     <refnamediv>
4         <refname>loadGui</refname>
5         <refpurpose>Load a graphic user interface from a saved file</refpurpose>
6     </refnamediv>
7     <refsynopsisdiv>
8         <title>Calling Sequence</title>
9         <synopsis>loadGui(filename)</synopsis>
10     </refsynopsisdiv>
11     <refsection>
12         <title>Arguments</title>
13         <variablelist>
14             <varlistentry>
15                 <term>filename</term>
16                 <listitem>
17                     <para>character string containing the path of the file</para>
18                 </listitem>
19             </varlistentry>
20         </variablelist>
21     </refsection>
22     <refsection>
23         <title>Description</title>
24         <para>
25             The <literal>loadGui</literal> function can be used to load in the
26             Scilab session a graphic user interface previously saved in a file with the
27             <literal>
28                 <link linkend="saveGui">saveGui</link>
29             </literal>
30             function.
31         </para>
32         <para>
33             <literal>loadGui(filename)</literal> loads an interface saved in file
34             given by its path <literal>filename</literal>.
35         </para>
36     </refsection>
37     <refsection>
38         <title>Examples</title>
39         <programlisting role="example"><![CDATA[ 
40 // First example
41 f = figure("background", -2);
42 h = uicontrol(f, "style", "text", ...
43               "string", "This is a figure", ...
44               "position", [210 180 300 100], ...
45               "fontsize", 24, ...
46               "backgroundcolor", [1 1 1]);
47
48 saveGui(f, fullfile(TMPDIR, "foo"))
49 close(f)
50 loadGui(fullfile(TMPDIR, "foo"));
51
52 // Second example
53 f = figure("default_axes", "off", ...
54            "dockable", "off", ...
55            "figure_name", "Sélection", ...
56            "axes_size", [200 200], ...
57            "infobar_visible", "off", ...
58            "menubar_visible", "off", ...
59            "toolbar", "none", ...
60            "toolbar_visible", "off", ...
61            "layout", "gridbag");
62            
63 h1 = uicontrol(f, "style", "text", ...
64                 "string", "Following List :", ...
65                 "fontsize", 15, ...
66                 "constraints", createConstraints("gridbag", [1 1 2 1], [1 0], "both"));
67                 
68 h2 = uicontrol(f, "style", "popupmenu", ...
69                 "string", ["item1"; "item2"; "item3"], ...
70                 "value", 1, ...
71                 "fontsize", 15, ...
72                 "constraints", createConstraints("gridbag", [1 2 2 1], [1 0], "both"), ...
73                 "tag", "selection");
74                 
75 h3 = uicontrol(f, "style", "pushbutton", ...
76                 "string", "OK", ...
77                 "callback", "obj = findobj(""tag"", ""selection""); mprintf(""La valeur sélectionnée est : %s.\n"", obj.string(obj.value)); close(gcf())", ...
78                 "fontsize", 15, ...
79                 "constraints", createConstraints("gridbag", [1 3 1 1], [1 0], "both", "left"));
80                 
81 h4 = uicontrol(f, "style", "pushbutton", ...
82                 "string", "CANCEL", ...
83                 "callback", "close(gcf())", ...
84                 "fontsize", 15, ...
85                 "constraints", createConstraints("gridbag", [2 3 1 1], [1 0], "both", "right"));
86                 
87 saveGui(f, "TMPDIR/foo2.xml");
88 close(f)
89 loadGui("TMPDIR/foo2.xml")
90
91
92  ]]></programlisting>
93     </refsection>
94     <refsection role="see also">
95         <title>See Also</title>
96         <simplelist type="inline">
97             <member>
98                 <link linkend="saveGui">saveGui</link>
99             </member>
100             <member>
101                 <link linkend="load">load</link>
102             </member>
103             <member>
104                 <link linkend="save">save</link>
105             </member>
106         </simplelist>
107     </refsection>
108     <refsection>
109         <title>History</title>
110         <revhistory>
111             <revision>
112                 <revnumber>5.5.0</revnumber>
113                 <revremark>
114                     Function <function>loadGui</function> introduced.
115                 </revremark>
116             </revision>
117         </revhistory>
118     </refsection>
119 </refentry>