<?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>Syntax</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, height]</literal> a 1-by-2 matrix of double, [0,0] by default
                    </para>
                    <para>
                        The <literal>width</literal> and <literal>height</literal> of the grid in number of elements (not pixels).
                    </para>
                    <para>
                        A value of 0 for either <literal>width</literal> or <literal>height</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>
