add createWindow macro 14/14214/2
Antoine ELIAS [Fri, 28 Mar 2014 14:23:36 +0000 (15:23 +0100)]
Change-Id: I8cc4a47471e1e24175fb30d7457a22a78c1c5d59

scilab/modules/gui/help/en_US/createWindow.xml [new file with mode: 0644]
scilab/modules/gui/help/en_US/figure.xml
scilab/modules/gui/macros/createWindow.sci [new file with mode: 0644]

diff --git a/scilab/modules/gui/help/en_US/createWindow.xml b/scilab/modules/gui/help/en_US/createWindow.xml
new file mode 100644 (file)
index 0000000..7ec1568
--- /dev/null
@@ -0,0 +1,67 @@
+<?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="createWindow">
+    <refnamediv>
+        <refname>createWindow</refname>
+        <refpurpose>create a window</refpurpose>
+    </refnamediv>
+    <refsynopsisdiv>
+        <title>Calling Sequence</title>
+        <synopsis>
+            f = createWindow();
+        </synopsis>
+    </refsynopsisdiv>
+    <refsection>
+        <title>Description</title>
+        <para>
+            This routine creates a graphic window with default properties :
+            <itemizedlist>
+                <listitem>
+                    <para>dockable = "off"</para>
+                </listitem>
+                <listitem>
+                    <para>default_axes = "off"</para>
+                </listitem>
+                <listitem>
+                    <para>infobar_visible = "off"</para>
+                </listitem>
+                <listitem>
+                    <para>toolbar_visible = "off"</para>
+                </listitem>
+                <listitem>
+                    <para>menubar_visible = "off"</para>
+                </listitem>
+            </itemizedlist>
+        </para>
+    </refsection>
+    <refsection>
+        <title>Examples</title>
+        <programlisting role="example"><![CDATA[
+// Create a window
+f = createWindow()
+f.axes_size = [400 400];
+uicontrol(f, "style", "pushbutton", "units", "normalized", "position", [0 0 0.5 0.5], "string", "Button", "horizontalalignment", "center");
+uicontrol(f, "style", "text", "units", "normalized", "position", [0 0.5 0.5 0.5], "string", "Label", "horizontalalignment", "center");
+uicontrol(f, "style", "radiobutton", "units", "normalized", "position", [0.5 0 0.5 0.5], "string", "Radiobutton", "horizontalalignment", "center", "groupname", "grouptest");
+uicontrol(f, "style", "checkbox", "units", "normalized", "position", [0.5 0.5 0.5 0.5], "string", "Checkbox", "horizontalalignment", "center", "groupname", "grouptest");
+]]></programlisting>
+    </refsection>
+    <refsection role="see also">
+        <title>See Also</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="figure">figure</link>
+            </member>
+        </simplelist>
+    </refsection>
+    <refsection>
+        <title>History</title>
+        <revhistory>
+            <revision>
+                <revnumber>5.5.0</revnumber>
+                <revremark>
+                    Function <function>createWindow</function> introduced.
+                </revremark>
+            </revision>
+        </revhistory>
+    </refsection>
+</refentry>
index 717c201..be740a8 100644 (file)
@@ -129,6 +129,9 @@ close(h);
             <member>
                 <link linkend="gcf">gcf</link>
             </member>
+            <member>
+                <link linkend="createWindow">createWindow</link>
+            </member>
         </simplelist>
     </refsection>
 </refentry>
diff --git a/scilab/modules/gui/macros/createWindow.sci b/scilab/modules/gui/macros/createWindow.sci
new file mode 100644 (file)
index 0000000..75c0203
--- /dev/null
@@ -0,0 +1,18 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2014 - Scilab Enterprises - Antoine ELIAS
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+function f = createWindow()
+    f = figure( ...
+    "dockable", "off", ...
+    "infobar_visible", "off", ...
+    "toolbar_visible", "off", ...
+    "menubar_visible", "off", ...
+    "default_axes", "off");
+endfunction
+