gui: Layout and Constraints documentation 71/14171/5
Pierre-Aime Agnel [Thu, 27 Mar 2014 14:48:14 +0000 (15:48 +0100)]
Change-Id: Idd02ad5c34a06fed1fe758299151eea6ce0d4b69

scilab/modules/gui/help/en_US/layout/CHAPTER [new file with mode: 0644]
scilab/modules/gui/help/en_US/layout/border_constraints_properties.xml [new file with mode: 0644]
scilab/modules/gui/help/en_US/layout/border_layout_options_properties.xml [new file with mode: 0644]
scilab/modules/gui/help/en_US/layout/createConstraints.xml [new file with mode: 0644]
scilab/modules/gui/help/en_US/layout/createLayoutOptions.xml [new file with mode: 0644]
scilab/modules/gui/help/en_US/layout/grid_constraints_properties.xml [new file with mode: 0644]
scilab/modules/gui/help/en_US/layout/grid_layout_options_properties.xml [new file with mode: 0644]
scilab/modules/gui/help/en_US/layout/gridbag_constraints_properties.xml [new file with mode: 0644]
scilab/modules/gui/help/en_US/layout/gridbag_layout_options_properties.xml [new file with mode: 0644]
scilab/modules/gui/help/en_US/layout/layout.xml [new file with mode: 0644]

diff --git a/scilab/modules/gui/help/en_US/layout/CHAPTER b/scilab/modules/gui/help/en_US/layout/CHAPTER
new file mode 100644 (file)
index 0000000..d4993d2
--- /dev/null
@@ -0,0 +1 @@
+title = Layouts 
diff --git a/scilab/modules/gui/help/en_US/layout/border_constraints_properties.xml b/scilab/modules/gui/help/en_US/layout/border_constraints_properties.xml
new file mode 100644 (file)
index 0000000..2e9dbde
--- /dev/null
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="border_constraints_properties">
+    <refnamediv>
+        <refname>Border Constraints Properties</refname>
+        <refpurpose>Description of the border constraints set of properties.</refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Calling Sequence</title>
+        <synopsis>
+            constraints = createConstraints("border")
+            constraints = createConstraints("border", position)
+            constraints = createConstraints("border", position, preferredsize)
+        </synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Arguments</title>
+        <variablelist>
+            <varlistentry>
+                <term>position</term>
+                <listitem>
+                    <para>A string</para>
+                    <para>"top" | "left" | {"center"} | "right" |"bottom"</para>
+                    <para>The position of the element in the layout</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>preferredsize</term>
+                <listitem>
+                    <para>
+                        <literal>[width, heigth]</literal> a 1-by-2 matrix of doubles, [-1, -1] by default.
+                    </para>
+                    <para>
+                        The preferred <literal>width</literal> or <literal>heigth</literal> of the element in the layout in pixels if not constrained.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>constraints</term>
+                <listitem>
+                    <para>The created constraints.</para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Description</title>
+        <para>
+            This functions creates the border constraints to set the <literal>constraints</literal> attribute of an uicontrol.
+        </para>
+    </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[
+         //Creating a figure with the border layout with 50 pixel padding in width and 10 in height 
+         f = figure( ...
+         "dockable"        , "off",...
+         "infobar_visible" , "off",...
+         "toolbar"         , "none",...
+         "menubar_visible" , "off",...
+         "menubar"         , "none",...
+         "default_axes"    , "off",...
+         "layout"          , "border",...
+         "layout_options", createLayoutOptions("border", [50,10]),...
+         "visible"         , "on");
+
+         c = createConstraints("border", "top", [50,10]);
+         //First frame is on top with 10 pixel in height
+         u_grid1 = uicontrol(f,...
+         "style", "frame",...
+         "backgroundcolor", [1 0 0], ...
+         "constraints", c);
+
+         sleep(500);
+         c.position = "left";
+         u_grid2 = uicontrol(f,...
+         "style", "frame",...
+         "backgroundcolor", [0 1 0], ...
+         "constraints", c);
+
+         sleep(500);
+         c.position = "center";
+         u_grid3 = uicontrol(f,...
+         "style", "frame",...
+         "backgroundcolor", [0 0 1], ...
+         "constraints", c);
+
+         sleep(500);
+         c.preferredsize = [10, 100];
+         c.position = "right";
+         u_grid4 = uicontrol(f,...
+         "style", "frame",...
+         "backgroundcolor", [1 1 0], ...
+         "constraints", c);
+
+         sleep(500);
+         c.position = "bottom";
+         u_grid5 = uicontrol(f,...
+         "style", "frame",...
+         "backgroundcolor", [1 0 1], ...
+         "constraints", c);
+         ]]></programlisting>
+    </refsection>
+     
+    <refsection role="see also">
+        <title>See Also</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="layout">layout</link>
+            </member>
+            <member>
+                <link linkend="createConstraints">createConstraints</link>
+            </member>
+            <member>
+                <link linkend="uicontrol">uicontrol</link>
+            </member>
+            <member>
+                <link linkend="uicontrol_properties">uicontrol_properties</link>
+            </member>
+        </simplelist>
+    </refsection>
+    <refsection>
+        <title>History</title>
+        <revhistory>
+            <revision>
+                <revnumber>5.5.0</revnumber>
+                <revremark>
+                    Function <function>createBorder</function> introduced.
+                </revremark>
+            </revision>
+        </revhistory>
+    </refsection>
+</refentry>
diff --git a/scilab/modules/gui/help/en_US/layout/border_layout_options_properties.xml b/scilab/modules/gui/help/en_US/layout/border_layout_options_properties.xml
new file mode 100644 (file)
index 0000000..86a91bd
--- /dev/null
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="border_layout_options_properties">
+    <refnamediv>
+        <refname>Border Layout Options Properties</refname>
+        <refpurpose>Description of the border layout options set of properties.</refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Calling Sequence</title>
+        <synopsis>
+            layout_options = createLayoutOptions("border")
+            layout_options = createLayoutOptions("border", padding)
+        </synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Arguments</title>
+        <variablelist>
+            <varlistentry>
+                <term>padding</term>
+                <listitem>
+                    <para>
+                        <literal>[pad_x, pad_y]</literal> a 1-by-2 matrix of doubles, [0,0] by default.
+                    </para>
+                    <para>The padding between elements of the border layout in pixels.</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>layout_options</term>
+                <listitem>
+                    <para>The created layout_options object</para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Description</title>
+        <para>
+            This functions creates the border layout options to set uicontrols <literal>layout_options</literal> attribute.
+        </para>
+    </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[
+         //Creating a figure with the border layout with 50 pixel padding in width and 10 in height 
+         f = figure( ...
+         "dockable"        , "off",...
+         "infobar_visible" , "off",...
+         "toolbar"         , "none",...
+         "menubar_visible" , "off",...
+         "menubar"         , "none",...
+         "default_axes"    , "off",...
+         "layout"          , "border",...
+         "layout_options", createLayoutOptions("border", [50,10]),...
+         "visible"         , "on");
+
+          c = createConstraints("border", "top", [50,10]);
+          //First frame is on top with 10 pixel in height
+          u_grid1 = uicontrol(f,...
+          "style", "frame",...
+          "backgroundcolor", [1 0 0], ...
+          "constraints", c);
+
+          sleep(500);
+          c.position = "left";
+          u_grid2 = uicontrol(f,...
+          "style", "frame",...
+          "backgroundcolor", [0 1 0], ...
+          "constraints", c);
+
+          sleep(500);
+          c.position = "center";
+          u_grid3 = uicontrol(f,...
+          "style", "frame",...
+          "backgroundcolor", [0 0 1], ...
+          "constraints", c);
+
+          sleep(500);
+          c.preferredsize = [10, 100];
+          c.position = "right";
+          u_grid4 = uicontrol(f,...
+          "style", "frame",...
+          "backgroundcolor", [1 1 0], ...
+          "constraints", c);
+
+          sleep(500);
+          c.position = "bottom";
+          u_grid5 = uicontrol(f,...
+          "style", "frame",...
+          "backgroundcolor", [1 0 1], ...
+          "constraints", c);
+          ]]></programlisting>
+    </refsection>
+     
+    <refsection role="see also">
+        <title>See Also</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="layout">layout</link>
+            </member>
+            <member>
+                <link linkend="createLayoutOptions">createLayoutOptions</link>
+            </member>
+            <member>
+                <link linkend="uicontrol">uicontrol</link>
+            </member>
+            <member>
+                <link linkend="uicontrol_properties">uicontrol_properties</link>
+            </member>
+        </simplelist>
+    </refsection>
+    <refsection>
+        <title>History</title>
+        <revhistory>
+            <revision>
+                <revnumber>5.5.0</revnumber>
+                <revremark>
+                    Function <function>createBorder</function> introduced.
+                </revremark>
+            </revision>
+        </revhistory>
+    </refsection>
+</refentry>
diff --git a/scilab/modules/gui/help/en_US/layout/createConstraints.xml b/scilab/modules/gui/help/en_US/layout/createConstraints.xml
new file mode 100644 (file)
index 0000000..e315d65
--- /dev/null
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="createConstraints">
+    <refnamediv>
+        <refname>createConstraints</refname>
+        <refpurpose>Creates the layout constraints structure for a uicontrol.</refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Calling Sequence</title>
+        <synopsis>
+            constraints = createConstraints(constraintsType, varargin)
+        </synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Arguments</title>
+        <variablelist>
+            <varlistentry>
+                <term>constraintsType</term>
+                <listitem>
+                    <para>String</para>
+                    <para>The type of the layout constraints to be created. Available types of constraints are listed below and their specific properties are detailled on dedicated help page:</para>
+                    <itemizedlist>
+                        <listitem>
+                            <para>
+                                "none" or "nolayout": No constraints will be added to the uicontrol layout.
+                            </para>
+                        </listitem>
+                        <listitem>
+                            <para>
+                                "grid": A <link linkend="grid_constraints_properties">grid layout constraint</link>.
+                            </para>
+                        </listitem>
+                        <listitem>
+                            <para>
+                                "border": A <link linkend="border_constraints_properties">border layout constraint</link>. 
+                            </para>
+                        </listitem>
+                        <listitem>
+                            <para>
+                                "gridbag": A <link linkend="gridbag_constraints_properties">gridbag layout constraint</link>.
+                            </para>
+                        </listitem>
+                    </itemizedlist>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>varargin</term>
+                <listitem>
+                    <para>
+                        All <literal>constraintsType</literal> specific properties.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>constraints</term>
+                <listitem>
+                    <para>The created constraints.</para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Description</title>
+        <para>
+            This function creates the constraints structure for uicontrols <literal>constraints</literal> attribute. See <link linkend="uicontrol_properties">uicontrol properties.</link> for more details.
+        </para>
+    </refsection>
+    <refsection role="see also">
+        <title>See Also</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="uicontrol">uicontrol</link>
+            </member>
+            <member>
+                <link linkend="uicontrol_properties">uicontrol_properties</link>
+            </member>
+        </simplelist>
+    </refsection>
+    <refsection>
+        <title>History</title>
+        <revhistory>
+            <revision>
+                <revnumber>5.5.0</revnumber>
+                <revremark>
+                    Function <function>createBorder</function> introduced.
+                </revremark>
+            </revision>
+        </revhistory>
+    </refsection>
+</refentry>
diff --git a/scilab/modules/gui/help/en_US/layout/createLayoutOptions.xml b/scilab/modules/gui/help/en_US/layout/createLayoutOptions.xml
new file mode 100644 (file)
index 0000000..e22b8d9
--- /dev/null
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="createLayoutOptions">
+    <refnamediv>
+        <refname>createLayoutOptions</refname>
+        <refpurpose>
+            Creates the layout options for a <literal>frame</literal> uicontrol or a figure
+        </refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Calling Sequence</title>
+        <synopsis>
+            layout_options = createLayoutOptions(constType, varargin)
+        </synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Arguments</title>
+        <variablelist>
+            <varlistentry>
+                <term>constType</term>
+                <listitem>
+                    <para>String</para>
+                    <para>The type of the layout options to be created. Available types of options are listed below and their specific properties are detailled on dedicated help page:</para>
+                    <itemizedlist>
+                        <listitem>
+                            <para>"none" or "nolayout": No layout options added to the uicontrol. No property is available for this type.</para>
+                        </listitem>
+                        <listitem>
+                            <para>
+                                "grid": the <link linkend="grid_layout_options_properties">grid options</link> type.
+                            </para>
+                        </listitem>
+                        <listitem>
+                            <para>
+                                "border": the <link linkend="border_layout_options_properties">border options</link> type.
+                            </para>
+                        </listitem>
+                        <listitem>
+                            <para>
+                                "gridbag": A <link linkend="gridbag_layout_options_properties">gridbag options</link> type.
+                            </para>
+                        </listitem>
+                    </itemizedlist>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>varargin</term>
+                <listitem>
+                    <para>
+                        All <literal>constType</literal> specific properties.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>layout_options</term>
+                <listitem>
+                    <para>The created layout_options.</para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Description</title>
+        <para>
+            This function creates the layout options structure used to set the <literal>layout_options</literal> attribute of a <literal>frame</literal> uicontrol or a figure. See <link linkend="uicontrol_properties">uicontrol properties</link> for more details.
+        </para>
+    </refsection>
+    <refsection role="see also">
+        <title>See Also</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="layout">layout</link>
+            </member>
+            <member>
+                <link linkend="uicontrol">uicontrol</link>
+            </member>
+            <member>
+                <link linkend="uicontrol_properties">uicontrol_properties</link>
+            </member>
+        </simplelist>
+    </refsection>
+    <refsection>
+        <title>History</title>
+        <revhistory>
+            <revision>
+                <revnumber>5.5.0</revnumber>
+                <revremark>
+                    Function <function>createBorder</function> introduced.
+                </revremark>
+            </revision>
+        </revhistory>
+    </refsection>
+</refentry>
diff --git a/scilab/modules/gui/help/en_US/layout/grid_constraints_properties.xml b/scilab/modules/gui/help/en_US/layout/grid_constraints_properties.xml
new file mode 100644 (file)
index 0000000..f797884
--- /dev/null
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="grid_constraints_properties">
+    <refnamediv>
+        <refname>Grid Constraints Properties</refname>
+        <refpurpose>Description of the grid constraints set of properties.</refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Calling Sequence</title>
+        <synopsis>
+            constraints = createConstraints("grid")
+        </synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Arguments</title>
+        <variablelist>
+            <varlistentry>
+                <term>constraints</term>
+                <listitem>
+                    <para>The created constraints.</para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Description</title>
+        <para>
+            This functions creates the grid constraints to set the uicontrols <literal>constraints</literal> attribute.
+        </para>
+    </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[
+         //Create a figure with a grid layout 
+         f = figure( ...
+         "dockable"        , "off",...
+         "infobar_visible" , "off",...
+         "toolbar"         , "none",...
+         "menubar_visible" , "off",...
+         "menubar"         , "none",...
+         "default_axes"    , "off",...
+         "layout"          , "grid",...
+         "visible"         , "on");
+
+         //Set the grid to be 2 by 3 elements
+         lay_opt = createLayoutOptions("grid", [2,3]);
+         set(f,"layout_options",lay_opt);
+
+         //Insert uicontrols on the grid
+         //Each uicontrol is inserted from left to right
+         //and top to bottom
+
+         c = createConstraints("grid"); //Create the constraint for nested uicontrols
+
+         u_grid1 = uicontrol(f,...
+         "style", "frame",...
+         "backgroundcolor", [1 0 0],...
+         "constraints", c);
+
+         sleep(500);
+         u_grid2 = uicontrol(f,...
+         "style", "frame",...
+         "backgroundcolor", [0 1 0],...
+         "constraints", c);
+
+         sleep(500);
+         u_grid3 = uicontrol(f,...
+         "style", "frame",...
+         "backgroundcolor", [0 0 1],...
+         "constraints", c);
+
+         sleep(500);
+         u_grid4 = uicontrol(f,...
+         "style", "frame",...
+         "backgroundcolor", [1 1 0],...
+         "constraints", c);
+
+         sleep(500);
+         u_grid5 = uicontrol(f,...
+         "style", "frame",...
+         "backgroundcolor", [1 0 1],...
+         "constraints", c);
+
+         sleep(500);
+         u_grid6 = uicontrol(f,...
+         "style", "frame",...
+         "backgroundcolor", [0 1 1],...
+         "constraints", c);
+         ]]></programlisting>
+    </refsection>
+    <refsection role="see also">
+        <title>See Also</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="layout">layout</link>
+            </member>
+            <member>
+                <link linkend="createConstraints">createConstraints</link>
+            </member>
+            <member>
+                <link linkend="uicontrol">uicontrol</link>
+            </member>
+            <member>
+                <link linkend="uicontrol_properties">uicontrol_properties</link>
+            </member>
+        </simplelist>
+    </refsection>
+    <refsection>
+        <title>History</title>
+        <revhistory>
+            <revision>
+                <revnumber>5.5.0</revnumber>
+                <revremark>
+                    Function <function>createBorder</function> introduced.
+                </revremark>
+            </revision>
+        </revhistory>
+    </refsection>
+</refentry>
diff --git a/scilab/modules/gui/help/en_US/layout/grid_layout_options_properties.xml b/scilab/modules/gui/help/en_US/layout/grid_layout_options_properties.xml
new file mode 100644 (file)
index 0000000..a57daa5
--- /dev/null
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="grid_layout_options_properties">
+    <refnamediv>
+        <refname>Grid Layout Options Properties</refname>
+        <refpurpose>Description of the grid layout options set of properties.</refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Calling Sequence</title>
+        <synopsis>
+            layout_options = createLayoutOptions("grid")
+            layout_options = createLayoutOptions("grid", size)
+            layout_options = createLayoutOptions("grid", size, padding)
+        </synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Arguments</title>
+        <variablelist>
+            <varlistentry>
+                <term>size</term>
+                <listitem>
+                    <para>
+                        <literal>[width, heigth]</literal> a 1-by-2 matrix of double, [0,0] by default
+                    </para>
+                    <para>
+                        The <literal>width</literal> and <literal>heigth</literal> of the grid in number of elements (not pixels).
+                    </para>
+                    <para>
+                        A value of 0 for either <literal>width</literal> or <literal>heigth</literal> defines an indefinite number of elements on the rows or columns of the grid.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>padding</term>
+                <listitem>
+                    <para>
+                        <literal>[pad_x, pad_y]</literal> a 1-by-2 matrix of doubles, [0,0] by default.
+                    </para>
+                    <para>The padding between elements of the grid in pixels.</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>layout_options</term>
+                <listitem>
+                    <para>The created layout_options.</para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Description</title>
+        <para>
+            This functions creates the grid layout options to set uicontrols <literal>layout_options</literal> attribute.
+        </para>
+    </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[
+         //Create a figure with a grid layout 
+         f = figure( ...
+         "dockable"        , "off",...
+         "infobar_visible" , "off",...
+         "toolbar"         , "none",...
+         "menubar_visible" , "off",...
+         "menubar"         , "none",...
+         "default_axes"    , "off",...
+         "layout"          , "grid",...
+         "visible"         , "on");
+
+         //Set the grid to be 2 by 3 elements
+         lay_opt = createLayoutOptions("grid", [2,3]);
+         set(f,"layout_options",lay_opt);
+
+         //Insert uicontrols on the grid
+         //Each uicontrol is inserted from left to right
+         //and top to bottom
+
+         c = createConstraints("grid"); //Create the constraint for nested uicontrols
+
+         u_grid1 = uicontrol(f,...
+         "style", "frame",...
+         "backgroundcolor", [1 0 0],...
+         "constraints", c);
+
+         sleep(500);
+         u_grid2 = uicontrol(f,...
+         "style", "frame",...
+         "backgroundcolor", [0 1 0],...
+         "constraints", c);
+
+         sleep(500);
+         u_grid3 = uicontrol(f,...
+         "style", "frame",...
+         "backgroundcolor", [0 0 1],...
+         "constraints", c);
+
+         sleep(500);
+         u_grid4 = uicontrol(f,...
+         "style", "frame",...
+         "backgroundcolor", [1 1 0],...
+         "constraints", c);
+
+         sleep(500);
+         u_grid5 = uicontrol(f,...
+         "style", "frame",...
+         "backgroundcolor", [1 0 1],...
+         "constraints", c);
+
+         sleep(500);
+         u_grid6 = uicontrol(f,...
+         "style", "frame",...
+         "backgroundcolor", [0 1 1],...
+         "constraints", c);
+         ]]></programlisting>
+    </refsection>
+    <refsection role="see also">
+        <title>See Also</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="layout">layout</link>
+            </member>
+            <member>
+                <link linkend="createLayoutOptions">createLayoutOptions</link>
+            </member>
+            <member>
+                <link linkend="uicontrol">uicontrol</link>
+            </member>
+            <member>
+                <link linkend="uicontrol_properties">uicontrol_properties</link>
+            </member>
+        </simplelist>
+    </refsection>
+    <refsection>
+        <title>History</title>
+        <revhistory>
+            <revision>
+                <revnumber>5.5.0</revnumber>
+                <revremark>
+                    Function <function>createBorder</function> introduced.
+                </revremark>
+            </revision>
+        </revhistory>
+    </refsection>
+</refentry>
diff --git a/scilab/modules/gui/help/en_US/layout/gridbag_constraints_properties.xml b/scilab/modules/gui/help/en_US/layout/gridbag_constraints_properties.xml
new file mode 100644 (file)
index 0000000..d0686ef
--- /dev/null
@@ -0,0 +1,203 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="gridbag_constraints_properties">
+    <refnamediv>
+        <refname>Gridbag Constraints Properties</refname>
+        <refpurpose>Description of the gridbag constraints set of properties.</refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Calling Sequence</title>
+        <synopsis>
+            constraints = createConstraints("gridbag")
+            constraints = createConstraints("gridbag", grid)
+            constraints = createConstraints("gridbag", grid, weight)
+            constraints = createConstraints("gridbag", grid, weight, fill)
+            constraints = createConstraints("gridbag", grid, weight, fill, anchor)
+            constraints = createConstraints("gridbag", grid, weight, fill, anchor, padding)
+            constraints = createConstraints("gridbag", grid, weight, fill, anchor, padding, preferredsize)
+        </synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Arguments</title>
+        <variablelist>
+            <varlistentry>
+                <term>grid</term>
+                <listitem>
+                    <para>
+                        <literal>[pos_x, pos_y, width, height]</literal> a 1-by-4 matrix of double, [0, 0, 0, 0] by default.
+                    </para>
+                    <para>
+                        <literal>pos_x</literal> and <literal>pos_x</literal> are the coordinates of the element on a virtual grid.
+                    </para>
+                    <para>
+                        <literal>width</literal> and <literal>height</literal> are the width and height of the element on the virtual grid.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>weight</term>
+                <listitem>
+                    <para>
+                        <literal>[weight_x, weight_y]</literal> a 1-by-2 matrix of doubles, [0, 0] by default.
+                    </para>
+                    <para>The weights applied for the resize on either axes.</para>
+                    <para>A larger value means the element will get more space during resize.</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>fill</term>
+                <listitem>
+                    <para>A string</para>
+                    <para>{"none"} | "horizontal" | "vertical" | "both"</para>
+                    <para>Indicates how to fill the available space during resize on either direction (or both).</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>anchor</term>
+                <listitem>
+                    <para>A string</para>
+                    <para>{"center"} | "upper" | "upper_right" | "right" | "lower_right" | "lower" | "lower_left" | "left" | "upper_left"</para>
+                    <para>Tells where to anchor the element when it is smaller than the area it is nested in.</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>padding</term>
+                <listitem>
+                    <para>
+                        <literal>[pad_x, pad_y]</literal> a 1-by-2 matrix of doubles, [0 0] by default
+                    </para>
+                    <para>Padding between this element and elements around it.</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>preferred_size</term>
+                <listitem>
+                    <para>
+                        <literal>[p_size_x, p_size_y]</literal> a 1-by-2 matrix of doubles, [-1 -1] by default
+                    </para>
+                    <para>Preferred size in pixel when not constrained, used to avoid changing the size when resizing the nesting frame.</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>constraints</term>
+                <listitem>
+                    <para>The created constraints.</para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[
+          //Creates the figure with a gridbag layout
+          f = figure( ...
+          "dockable"        , "off",...
+          "infobar_visible" , "off",...
+          "toolbar"         , "none",...
+          "menubar_visible" , "off",...
+          "menubar"         , "none",...
+          "default_axes"    , "off",...
+          "layout"          , "gridbag",...
+          "visible"         , "on");
+
+         redf_grid   = [1, 1, 2, 1]; //Red frame is placed at 1x1 and is a 2x1 rectangle
+         greenf_grid = [3, 1, 1, 2]; //Green frame is at 3x1 and is a 1x2 rectangle
+         bluef_grid  = [1, 2, 1, 1]; //Blue frame is at 2x1 and is a 1x1 rectangle
+         yelf_grid   = [1, 3, 2, 2]; //Yellow frame is at 1x3 and is a 2x2 rectangle
+         magf_grid   = [3, 4, 1, 1]; //Magenta frame is at 3x4 and is a 1x1 rectangle
+         cyanf_grid  = [2, 2, 1, 1]; //Cyan is at 2x2 and is a 1x1 rectangle
+         whitf_grid  = [3, 3, 1, 1]; //White is at 3x3 and is a 1x1 rectangle
+
+         c = createConstraints("gridbag",[1, 1, 1, 1], [1, 1], "both", "center", [0, 0], [50, 50]);
+
+         c.grid = redf_grid;
+         u_grid1 = uicontrol(f , ...
+         "style"               , "frame"                     , ...
+         "backgroundcolor"     , [1 0 0]                     , ...
+         "constraints"         , c);
+
+         sleep(500);
+         c.grid = greenf_grid;
+         c.weight = [0.1,1]; //Last column will fill horizontal space 10 times less than other columns
+         u_grid2 = uicontrol(f , ...
+         "style"               , "frame"                     , ...
+         "backgroundcolor"     , [0 1 0]                     , ...
+         "constraints"         , c);
+
+         sleep(500);
+         c.grid = bluef_grid;
+         c.weight = [1,1];
+         c.fill = "none" //This will force the blue square to be at the preferred size
+         u_grid3 = uicontrol(f , ...
+         "style"               , "frame"                     , ...
+         "backgroundcolor"     , [0 0 1]                     , ...
+         "constraints"         , c);
+
+         sleep(500);
+         c.grid = cyanf_grid;
+         c.fill = "vertical" // this will fill the empty space with cyan vertically
+         c.anchor = "right" //this will position the cyan stripe on the right
+         c.padding = [100,0] //this will extend the cyan stripe horizontally up to 100 pixel if space is available
+         u_grid1 = uicontrol(f , ...
+         "style"               , "frame"                     , ...
+         "backgroundcolor"     , [0 1 1]                     , ...
+         "constraints"         , c);
+
+         sleep(500);
+         c.grid = yelf_grid;
+         c.fill = "both";
+         c.anchor ="center";
+         c.padding = [0,0];
+         u_grid4 = uicontrol(f , ...
+         "style"               , "frame"                     , ...
+         "backgroundcolor"     , [1 1 0]                     , ...
+         "constraints"         , c);
+
+         sleep(500);
+         c.grid = whitf_grid;
+         c.weight = [0.1,1]
+         u_grid1 = uicontrol(f , ...
+         "style"               , "frame"                     , ...
+         "backgroundcolor"     , [1 1 1]                     , ...
+         "constraints"         , c);
+
+         sleep(500);
+         c.grid = magf_grid;
+         c.weight = [0.1,1]
+         u_grid5 = uicontrol(f , ...
+         "style"               , "frame"                     , ...
+         "backgroundcolor"     , [1 0 1]                     , ...
+         "constraints"         , c);
+         ]]></programlisting>
+    </refsection>
+     <refsection>
+        <title>Description</title>
+        <para>
+            This functions creates the gridbag constraints to set the uicontrols <literal>constraints</literal> attribute.
+        </para>
+    </refsection>
+    <refsection role="see also">
+        <title>See Also</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="layout">layout</link>
+            </member>
+            <member>
+                <link linkend="uicontrol">uicontrol</link>
+            </member>
+            <member>
+                <link linkend="uicontrol_properties">uicontrol_properties</link>
+            </member>
+        </simplelist>
+    </refsection>
+    <refsection>
+        <title>History</title>
+        <revhistory>
+            <revision>
+                <revnumber>5.5.0</revnumber>
+                <revremark>
+                    Function <function>createBorder</function> introduced.
+                </revremark>
+            </revision>
+        </revhistory>
+    </refsection>
+</refentry>
diff --git a/scilab/modules/gui/help/en_US/layout/gridbag_layout_options_properties.xml b/scilab/modules/gui/help/en_US/layout/gridbag_layout_options_properties.xml
new file mode 100644 (file)
index 0000000..db2b37d
--- /dev/null
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="gridbag_layout_options_properties">
+    <refnamediv>
+        <refname>Gridbag Layout Options Properties</refname>
+        <refpurpose>Description of the gridbag layout options set of properties.</refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Calling Sequence</title>
+        <synopsis>
+            layout_options = createLayoutOptions("gridbag")
+        </synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Arguments</title>
+        <variablelist>
+            <varlistentry>
+                <term>layout_options</term>
+                <listitem>
+                    <para>The created layout_options</para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Description</title>
+        <para>
+            This functions creates the gridbag layout options to set uicontrols <literal>layout_options</literal> attribute.
+        </para>
+    </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[
+          //Creates the figure with a gridbag layout
+          f = figure( ...
+          "dockable"        , "off",...
+          "infobar_visible" , "off",...
+          "toolbar"         , "none",...
+          "menubar_visible" , "off",...
+          "menubar"         , "none",...
+          "default_axes"    , "off",...
+          "layout"          , "gridbag",...
+          "visible"         , "on");
+
+          redf_grid   = [1, 1, 2, 1]; //Red frame is placed at 1x1 and is a 2x1 rectangle
+          greenf_grid = [3, 1, 1, 2]; //Green frame is at 3x1 and is a 1x2 rectangle
+          bluef_grid  = [1, 2, 1, 1]; //Blue frame is at 2x1 and is a 1x1 rectangle
+          yelf_grid   = [1, 3, 2, 2]; //Yellow frame is at 1x3 and is a 2x2 rectangle
+          magf_grid   = [3, 4, 1, 1]; //Magenta frame is at 3x4 and is a 1x1 rectangle
+          cyanf_grid  = [2, 2, 1, 1]; //Cyan is at 2x2 and is a 1x1 rectangle
+          whitf_grid  = [3, 3, 1, 1]; //White is at 3x3 and is a 1x1 rectangle
+
+          c = createConstraints("gridbag",[1, 1, 1, 1], [1, 1], "both", "center", [0, 0], [50, 50]);
+
+          c.grid = redf_grid;
+          u_grid1 = uicontrol(f , ...
+          "style"               , "frame"                     , ...
+          "backgroundcolor"     , [1 0 0]                     , ...
+          "constraints"         , c);
+
+          sleep(500);
+          c.grid = greenf_grid;
+          c.weight = [0.1,1] //Last column will fill horizontal space 10 times less than other columns
+          u_grid2 = uicontrol(f , ...
+          "style"               , "frame"                     , ...
+          "backgroundcolor"     , [0 1 0]                     , ...
+          "constraints"         , c);
+
+          sleep(500);
+          c.grid = bluef_grid;
+          c.weight = [1,1]
+          c.fill = "none" //This will force the blue square to be at the preferred size
+          u_grid3 = uicontrol(f , ...
+          "style"               , "frame"                     , ...
+          "backgroundcolor"     , [0 0 1]                     , ...
+          "constraints"         , c);
+
+          sleep(500);
+          c.grid = cyanf_grid;
+          c.fill = "vertical" // this will fill the empty space with cyan vertically
+          c.anchor = "right" //this will position the cyan stripe on the right
+          c.padding = [100,0] //this will extend the cyan stripe horizontally up to 100 pixel if space is available
+          u_grid1 = uicontrol(f , ...
+          "style"               , "frame"                     , ...
+          "backgroundcolor"     , [0 1 1]                     , ...
+          "constraints"         , c);
+
+          sleep(500);
+          c.grid = yelf_grid;
+          c.fill = "both"
+          c.anchor ="center"
+          c.padding = [0,0]
+          u_grid4 = uicontrol(f , ...
+          "style"               , "frame"                     , ...
+          "backgroundcolor"     , [1 1 0]                     , ...
+          "constraints"         , c);
+
+          sleep(500);
+          c.grid = whitf_grid;
+          c.weight = [0.1,1]
+          u_grid1 = uicontrol(f , ...
+          "style"               , "frame"                     , ...
+          "backgroundcolor"     , [1 1 1]                     , ...
+          "constraints"         , c);
+
+          sleep(500);
+          c.grid = magf_grid;
+          c.weight = [0.1,1]
+          u_grid5 = uicontrol(f , ...
+          "style"               , "frame"                     , ...
+          "backgroundcolor"     , [1 0 1]                     , ...
+          "constraints"         , c);
+          ]]></programlisting>
+    </refsection>
+    <refsection role="see also">
+        <title>See Also</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="layout">layout</link>
+            </member>
+            <member>
+                <link linkend="createLayoutOptions">createLayoutOptions</link>
+            </member>
+            <member>
+                <link linkend="uicontrol">uicontrol</link>
+            </member>
+            <member>
+                <link linkend="uicontrol_properties">uicontrol_properties</link>
+            </member>
+        </simplelist>
+    </refsection>
+    <refsection>
+        <title>History</title>
+        <revhistory>
+            <revision>
+                <revnumber>5.5.0</revnumber>
+                <revremark>
+                    Function <function>createBorder</function> introduced.
+                </revremark>
+            </revision>
+        </revhistory>
+    </refsection>
+</refentry>
diff --git a/scilab/modules/gui/help/en_US/layout/layout.xml b/scilab/modules/gui/help/en_US/layout/layout.xml
new file mode 100644 (file)
index 0000000..24f6ff3
--- /dev/null
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="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="layout" xml:lang="en">
+    <refnamediv>
+        <refname>Layout</refname>
+        <refpurpose>Description of the different layouts and constraints for uicontrols and figures.</refpurpose>
+    </refnamediv>
+    <refsection>
+        <title>Description</title>
+        <para>
+            Layouts control how figures or <literal>frame</literal> uicontrols manage the positions and display of nested uicontrols.
+            Layout options can be created/set using the <link linkend="createLayoutOptions">createLayoutOptions</link> function.
+        </para>
+    </refsection>
+    <refsection>
+        <title>Properties</title>
+        <variablelist>
+            <varlistentry>
+                <term>nolayout | none</term>
+                <listitem>
+                    <para>No layout is applied, nested uicontrols do not have any constraint.</para>
+                    <para>Nested uicontrols must be positionned manually and their size is fixed.</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>grid</term>
+                <listitem>
+                    <para>A grid layout is applied to all nested uicontrols.</para>
+                    <para>
+                        Nested uicontrols are positionned in a grid defined in <literal>layout_options</literal> from left to right and top to bottom.
+                    </para>
+                    <para>
+                        See <link linkend="grid_layout_options_properties">grid layout options</link> for information on grid layouts.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>border</term>
+                <listitem>
+                    <para>A border layout is applied to all nested uicontrols.</para>
+                    <para>Nested uicontrols are positionned on a border of the parent frame or in the center.</para>
+                    <para>
+                        See <link linkend="border_layout_options_properties">border layout options</link> for information on border layouts.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>gridbag</term>
+                <listitem>
+                    <para>A gridbag layout is applied to all nested uicontrols.</para>
+                    <para>Nested uicontrols are positionned on a virtual grid as in the grid layout but can occupy several grid spaces, fill empty space horizontally or vertically.</para>
+                    <para>The gridbag layout allows finer control over the uicontrol behaviour during resize.</para>
+                    <para>
+                        see <link linkend="gridbag_layout_options_properties">gridbag layout options</link> for information on gridbag layouts.
+                    </para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection>
+        <title>Layout Constraints</title>
+        <para>Constraints define behaviour of a uicontrol inside a layout.</para>
+        <para>
+            All nested elements in a layout must define its <literal>constraint</literal> attribute relative to their parent layout. Layouts are thus defined on the parent while constraints are defined on the children.
+        </para>
+        <para>
+            Constraints can be created/set using the <link linkend="createConstraints">createConstraints</link> function.
+        </para>
+    </refsection>
+    <refsection role="see also">
+        <title>See Also</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="uicontrol_properties">uicontrol_properties</link>
+            </member>
+        </simplelist>
+    </refsection>
+</refentry>