* `union` now support boolean, sparse boolean, and sparse numerical matrices.
* `kron` and `.*.` are extended to boolean arrays.
* `gamma` is extended to incomplete gamma integrals.
+* `close` is extended to close the help browser, xcos, or the variables browser or editor GUIs.
Help pages:
* [#16612](https://bugzilla.scilab.org/16612): Unlike the `.*.` operator, `kron()` was not defined for sparse numeric matrices.
* [#16613](https://bugzilla.scilab.org/16613): Neither `.*.` nor `kron()` worked with boolean or sparse boolean matrices.
* [#16617](https://bugzilla.scilab.org/16617): `gamma` did not support incomplete gamma integrals.
+* [#16618](https://bugzilla.scilab.org/16618): `close` could not close the help browser, xcos, nor the variable editor or browser.
* [#16622](https://bugzilla.scilab.org/16622): `inv` could no longer be overloaded for hypermatrices of decimal or complex numbers.
* [#16623](https://bugzilla.scilab.org/16623): `rand(2,2,2)^2` yielded a wrong result instead of trying to call the `%s_p_s` overload for input hypermatrices.
* [#16629](https://bugzilla.scilab.org/16629): `interp1`'s documentation did not tell the spline edges conditions ; extrapolation modes were poorly explained. ; the description of the result's size was completely wrong ; x as an option was not documented. A wrong extrapolation value could silently return a wrong result. There was some dead code like `if varargin(5)==%nan`. A bugged error message yielded its own error. When x is implicit, the argument index in error messages could be wrong. `periodic` and `edgevalue` extrapolation modes were not available. `linear` extrapolation was not available for splines. When `xp` is an hypermatrix with `size(xp,1)==1`, the size of the result was irregular/wrong.
* [#16644](https://bugzilla.scilab.org/16644): `input("message:")` yielded a wrong error message about `mprintf` in case of non-interpretable input.
* [#16654](https://bugzilla.scilab.org/16654): `interp` was leaking memory.
+
### Bugs fixed in 6.1.0:
* [#2694](https://bugzilla.scilab.org/2694): `bitget` did not accept positive integers of types int8, int16 or int32.
* [#5824](https://bugzilla.scilab.org/5824): The `datafit` algorithm was not documented.
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2020 - Samuel GOUGEON
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+ *
+ -->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:svg="http://www.w3.org/2000/svg" xmlns:db="http://docbook.org/ns/docbook"
xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="close">
<refnamediv>
<refname>close</refname>
- <refpurpose>closes graphic figures, progressionbars or waitbars</refpurpose>
+ <refpurpose>
+ Closes graphic figures, progression or wait bars, the help browser, xcos,
+ the variables browser or editor.
+ </refpurpose>
</refnamediv>
<refsynopsisdiv>
<title>Syntax</title>
<synopsis>
close
close(H)
+ close help
+ close xcos
+ close xcos!
+ close editvar
+ close browsevar
</synopsis>
</refsynopsisdiv>
<refsection role="parameters">
<para>Vector of graphic figures handles or ids, or of handles of progression bar
or wait bar.
</para>
- <para>
- By default, the current graphic figure is considered.
- </para>
</listitem>
</varlistentry>
</variablelist>
</refsection>
<refsection role="description">
<title>Description</title>
- <para>Graphic windows based on the Tk technology (such as still used by imshow() in the SIVP
- external module) may be closed as well by providing their number that is their handle.
- </para>
+ <para>
+ <emphasis role="bold">close</emphasis> closes the current graphic figure (if any).
+ </para>
+ <para>
+ <emphasis role="bold">close(H)</emphasis> closes the figures, waitbar or
+ progression bars whose handles or indices are in <varname>H</varname>.
+ </para>
+ <para>
+ <emphasis role="bold">close help</emphasis> closes the help browser.
+ </para>
+ <para>
+ <emphasis role="bold">close browsevar</emphasis> closes the variable browser.
+ </para>
+ <para>
+ <emphasis role="bold">close editvar</emphasis> closes the variable editor
+ (it must not be docked).
+ </para>
+ <para>
+ <emphasis role="bold">close xcos</emphasis> closes all opened xcos windows.
+ If some diagrams have unsaved changes, the user is asked for confirmation.
+ </para>
+ <para>
+ <emphasis role="bold">close xcos!</emphasis> forces closing all opened xcos windows
+ without asking for any confirmation.
+ </para>
</refsection>
<refsection role="examples">
<title>Examples</title>
sleep(5000); // Watch at them!
close([25 200 111]) // Finished!
]]></programlisting>
+ <para/>
+ <programlisting role="example"><![CDATA[
+// You are reading this example in the help browser. Now, bye:
+close help
+ ]]></programlisting>
+ <para/>
+ <programlisting role="example"><![CDATA[
+xcos
+sleep(5000)
+close xcos
+ ]]></programlisting>
+ <para/>
+ <programlisting role="example"><![CDATA[
+browsevar
+sleep(5000)
+close browsevar
+ ]]></programlisting>
+ <para/>
+ <programlisting role="example"><![CDATA[
+a = rand(3,5);
+editvar a
+sleep(5000)
+close editvar
+ ]]></programlisting>
</refsection>
<refsection role="see also">
<title>See also</title>
<link linkend="delete">delete</link>
</member>
<member>
- <link linkend="figure">figure</link>
+ <link linkend="exit">exit</link>
</member>
<member>
- <link linkend="scf">scf</link>
+ <link linkend="mclose">mclose</link>
</member>
<member>
- <link linkend="gcf">gcf</link>
+ <link linkend="h5close">h5close</link>
</member>
</simplelist>
</refsection>
<revision>
<revnumber>6.1.1</revnumber>
<revdescription>
- Vector of several figures ids now accepted.
+ <itemizedlist>
+ <listitem>
+ Vector of several figures ids now accepted.
+ </listitem>
+ <listitem>
+ Extension to <literal>close help</literal>, <literal>close xcos</literal>,
+ <literal>close xcos!</literal>, <literal>close browsevar</literal>,
+ and <literal>close editvar</literal>
+ </listitem>
+ </itemizedlist>
</revdescription>
</revision>
</revhistory>
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2020 - Samuel GOUGEON
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+ *
+ -->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:svg="http://www.w3.org/2000/svg" xmlns:db="http://docbook.org/ns/docbook"
xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="close">
<refnamediv>
<refname>close</refname>
- <refpurpose>図を閉じる</refpurpose>
+ <refpurpose>
+ グラフィックフィギュア,進行バーまたは待機バー,ヘルプブラウザ,xcos,browsevar,またはeditvarを閉じます
+ </refpurpose>
</refnamediv>
<refsynopsisdiv>
<title>Syntax</title>
<synopsis>
close
- close(h)
+ close(H)
+ close help
+ close xcos
+ close xcos!
+ close editvar
+ close browsevar
</synopsis>
</refsynopsisdiv>
<refsection>
<title>引数</title>
<variablelist>
<varlistentry>
- <term>h</term>
+ <term>H</term>
<listitem>
<para>Vector of graphic figures handles or ids, or of handles of progression bar
or wait bar.
</refsection>
<refsection>
<title>説明</title>
- <para>
- このルーチンはtksci図(トップレベルウインドウ)を閉じます.
- ハンドルが指定された場合,このハンドルに対応する図が閉じられます.
- それ以外の場合,カレントの(アクティブな)図が閉じられます.
- </para>
+ <para>
+ <emphasis role="bold">close</emphasis> closes the current graphic figure (if any).
+ </para>
+ <para>
+ <emphasis role="bold">close(H)</emphasis> closes the figures, waitbar or
+ progression bars whose handles or indices are in <varname>H</varname>.
+ </para>
+ <para>
+ <emphasis role="bold">close help</emphasis> closes the help browser.
+ </para>
+ <para>
+ <emphasis role="bold">close browsevar</emphasis> closes the variable browser.
+ </para>
+ <para>
+ <emphasis role="bold">close editvar</emphasis> closes the variable editor
+ (it must not be docked).
+ </para>
+ <para>
+ <emphasis role="bold">close xcos</emphasis> closes all opened xcos windows.
+ If some diagrams have unsaved changes, the user is asked for confirmation.
+ </para>
+ <para>
+ <emphasis role="bold">close xcos!</emphasis> forces closing all opened xcos windows
+ without asking for any confirmation.
+ </para>
</refsection>
<refsection>
<title>例</title>
sleep(5000); // Watch at them!
close([25 200 111]) // Finished!
]]></programlisting>
+ <para/>
+ <programlisting role="example"><![CDATA[
+// You are reading this example in the help browser. Now, bye:
+close help
+ ]]></programlisting>
+ <para/>
+ <programlisting role="example"><![CDATA[
+xcos
+sleep(5000)
+close xcos
+ ]]></programlisting>
+ <para/>
+ <programlisting role="example"><![CDATA[
+browsevar
+sleep(5000)
+close browsevar
+ ]]></programlisting>
+ <para/>
+ <programlisting role="example"><![CDATA[
+a = rand(3,5);
+editvar a
+sleep(5000)
+close editvar
+ ]]></programlisting>
</refsection>
<refsection role="see also">
<title>参照</title>
<simplelist type="inline">
<member>
- <link linkend="figure">figure</link>
+ <link linkend="delete">delete</link>
</member>
<member>
- <link linkend="gcf">gcf</link>
+ <link linkend="exit">exit</link>
</member>
<member>
- <link linkend="delete">delete</link>
+ <link linkend="mclose">mclose</link>
+ </member>
+ <member>
+ <link linkend="h5close">h5close</link>
</member>
</simplelist>
</refsection>
<revision>
<revnumber>6.1.1</revnumber>
<revdescription>
- Vector of several figures ids now accepted.
+ <itemizedlist>
+ <listitem>
+ Vector of several figures ids now accepted.
+ </listitem>
+ <listitem>
+ Extension to <literal>close help</literal>, <literal>close xcos</literal>,
+ <literal>close xcos!</literal>, <literal>close browsevar</literal>,
+ and <literal>close editvar</literal>
+ </listitem>
+ </itemizedlist>
</revdescription>
</revision>
</revhistory>
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2020 - Samuel GOUGEON
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+ *
+ -->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:svg="http://www.w3.org/2000/svg" xmlns:db="http://docbook.org/ns/docbook"
xmlns:scilab="http://www.scilab.org" xml:lang="ru" xml:id="close">
<refnamediv>
<refname>close</refname>
<refpurpose>
- закрывает графические окна, панели прогресса и панели состояния
+ Закрывает графические окна, панели прогресса или состояния, браузер справки, xcos,
+ браузер переменных или редактор.
</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>
close
close(H)
+ close help
+ close xcos
+ close xcos!
+ close editvar
+ close browsevar
</synopsis>
</refsynopsisdiv>
<refsection role="parameters">
вектор дескрипторов графических окон или идентификаторов,
либо дескрипторов панели прогресса и панели состояния.
</para>
- <para>
- По умолчанию рассматривается текущее графическое окно.
- </para>
</listitem>
</varlistentry>
</variablelist>
</refsection>
<refsection role="description">
<title>Описание</title>
- <para>
- Графические окна, основанные на технологии Tk (такие, как по-прежнему
- используемое imshow() во внешнем модуле SIVP), могут быть закрыты
- также по указанию их номера, который является их дескриптором.
- </para>
+ <para>
+ <emphasis role="bold">close</emphasis> закрывает текущее графическое окно (если есть).
+ </para>
+ <para>
+ <emphasis role="bold">close(H)</emphasis> закрывает графические окна,панели состояния
+ или прогресса, чьи индикаторы или индексы находятся в <varname>H</varname>.
+ </para>
+ <para>
+ <emphasis role="bold">close help</emphasis> закрывает браузер справки.
+ </para>
+ <para>
+ <emphasis role="bold">close browsevar</emphasis> закрывает браузер переменных.
+ </para>
+ <para>
+ <emphasis role="bold">close editvar</emphasis> закрывает редактор переменных
+ (он не должен быть встроенным).
+ </para>
+ <para>
+ <emphasis role="bold">close xcos</emphasis> закрывает все открытые окна xcos.
+ Если какие-то диаграммы имеют несохранённые изменения, то у пользователя запросят подтверждение.
+ </para>
+ <para>
+ <emphasis role="bold">close xcos!</emphasis> принудительное закрытие всех открытых
+ окон xcos без запроса какого-либо подтверждения.
+ </para>
</refsection>
<refsection role="examples">
<title>Примеры</title>
sleep(5000); // смотрим на них!
close([25 200 111]) // конец!
]]></programlisting>
+ <para/>
+ <programlisting role="example"><![CDATA[
+// Вы читаете этот пример в браузере справки. Теперь до свидания:
+close help
+ ]]></programlisting>
+ <para/>
+ <programlisting role="example"><![CDATA[
+xcos
+sleep(5000)
+close xcos
+ ]]></programlisting>
+ <para/>
+ <programlisting role="example"><![CDATA[
+browsevar
+sleep(5000)
+close browsevar
+ ]]></programlisting>
+ <para/>
+ <programlisting role="example"><![CDATA[
+a = rand(3,5);
+editvar a
+sleep(5000)
+close editvar
+ ]]></programlisting>
</refsection>
<refsection role="see also">
<title>Смотрите также</title>
<link linkend="delete">delete</link>
</member>
<member>
- <link linkend="figure">figure</link>
+ <link linkend="exit">exit</link>
</member>
<member>
- <link linkend="scf">scf</link>
+ <link linkend="mclose">mclose</link>
</member>
<member>
- <link linkend="gcf">gcf</link>
+ <link linkend="h5close">h5close</link>
</member>
</simplelist>
</refsection>
<revision>
<revnumber>6.1.1</revnumber>
<revdescription>
- Теперь принимаются идентификаторы нескольких окон.
+ <itemizedlist>
+ <listitem>
+ Теперь принимаются идентификаторы нескольких окон.
+ </listitem>
+ <listitem>
+ Расширение до <literal>close help</literal>, <literal>close xcos</literal>,
+ <literal>close xcos!</literal>, <literal>close browsevar</literal>
+ и <literal>close editvar</literal>
+ </listitem>
+ </itemizedlist>
</revdescription>
</revision>
</revhistory>
function close(h)
- // Close a graphic figure or delete an uimenu or an uicontrol
+ // Close a graphic figure, or delete an uimenu or an uicontrol,
+ // or close editvar, browsevar, helpbrowser, or all xcos GUI
+
// This function has been written for compatibility with old TK uicontrols/uimenus
// handle has been given ?
- rhs=argn(2);
+ rhs = argn(2);
if rhs < 1 then
// No handle given so destroy current figure
end
else
if type(h) == 9 then // Graphics handle
- delete(h)
+ delete(h);
- elseif type(h) == 1 then // vector of Figures ids
+ elseif type(h) == 1 then
for i = 1:length(h)
tmp = findobj("figure_id",h(i));
if tmp <> [] then
end
end
+ elseif type(h)==10
+ for i = 1:size(h,"*")
+ gui = h(i)
+ select gui
+ case "help"
+ jimport org.scilab.modules.gui.helpbrowser.ScilabHelpBrowser
+ hb = ScilabHelpBrowser.getHelpBrowserWithoutCreation()
+ if type(hb) <> 1
+ hb.close()
+ end
+
+ case "editvar"
+ jimport org.scilab.modules.ui_data.variableeditor.ScilabVariableEditor
+ ve = ScilabVariableEditor.getVariableEditor()
+ if type(ve) <> 1 // <=> ve <> []
+ ve.close()
+ end
+
+ case "browsevar"
+ jimport org.scilab.modules.ui_data.variablebrowser.ScilabVariableBrowser
+ if ScilabVariableBrowser.isBrowseVarOpened()
+ vb = ScilabVariableBrowser.getVariableBrowser()
+ vb.close()
+ end
+
+ case "xcos" // ask for confirmation in case of unsaved changes
+ javaclasspath(SCI + "/modules/xcos/jar/org.scilab.modules.xcos.jar");
+ jimport org.scilab.modules.xcos.Xcos
+ try
+ // Closes all opened Xcos instances: ask for confirmation
+ Xcos.closeSession(%t)
+ end
+
+ case "xcos!" // Do not ask for confirmation in case of unsaved changes
+ javaclasspath(SCI + "/modules/xcos/jar/org.scilab.modules.xcos.jar");
+ jimport org.scilab.modules.xcos.Xcos
+ try
+ inst = Xcos.getInstance()
+ inst.closeXcosFromScilab()
+ end
+
+ else
+ msg = _("%s: Argument #%d: Unknown GUI name ''%s''.\n")
+ warning(msprintf(msg, "close", 1, h(i)))
+ end
+ end
else
// Do not know what to do
error(msprintf(gettext("%s: Wrong type for input argument #%d: A graphic handle or a real expected.\n"), "close", 1));
end
end
endfunction
+
--- /dev/null
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2020 - Samuel GOUGEON
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- TEST WITH GRAPHIC -->
+// <-- NO CHECK REF -->
+//
+// <-- Short Description -->
+// Unitary tests for close()
+
+// Figures
+// -------
+close(winsid())
+scf(7);
+scf(3);
+scf(10);
+scf(6);
+close(6)
+assert_checkequal(winsid(), [7 3 10]);
+close()
+assert_checkequal(winsid(), [3 10]);
+close([10 3])
+assert_checkequal(winsid(), []);
+
+// Help
+// ----
+help
+sleep(200)
+close help
+jimport org.scilab.modules.gui.helpbrowser.ScilabHelpBrowser
+hb = ScilabHelpBrowser.getHelpBrowserWithoutCreation()
+sleep(100)
+assert_checkequal(hb, [])
+
+// Editvar
+// -------
+a = 1;
+editvar a
+sleep(200)
+close editvar
+jimport org.scilab.modules.ui_data.variableeditor.ScilabVariableEditor
+ve = ScilabVariableEditor.getVariableEditor();
+assert_checkequal(ve, []);
+
+// Browsevar
+// ---------
+browsevar
+sleep(200)
+close browsevar
+jimport org.scilab.modules.ui_data.variablebrowser.ScilabVariableBrowser
+assert_checkfalse(ScilabVariableBrowser.isBrowseVarOpened())
+
+// Xcos
+// ----
+xcos
+sleep(600)
+close xcos
+//
+javaclasspath(SCI + "/modules/xcos/jar/org.scilab.modules.xcos.jar");
+jimport org.scilab.modules.xcos.Xcos
+inst = Xcos.getInstance();
+od = inst.openedDiagrams();
+assert_checkequal(od.size(), int32(0));
+
+xcos
+sleep(600)
+close xcos!
+//
+inst = Xcos.getInstance();
+od = inst.openedDiagrams();
+assert_checkequal(od.size(), int32(0));