summaryrefslogtreecommitdiffstats
path: root/helpcontent2/source/text/sbasic/guide
diff options
context:
space:
mode:
Diffstat (limited to 'helpcontent2/source/text/sbasic/guide')
-rw-r--r--helpcontent2/source/text/sbasic/guide/access2base.xhp98
-rw-r--r--helpcontent2/source/text/sbasic/guide/basic_2_python.xhp181
-rw-r--r--helpcontent2/source/text/sbasic/guide/basic_examples.xhp36
-rw-r--r--helpcontent2/source/text/sbasic/guide/calc_borders.xhp248
-rw-r--r--helpcontent2/source/text/sbasic/guide/control_properties.xhp49
-rw-r--r--helpcontent2/source/text/sbasic/guide/create_dialog.xhp60
-rw-r--r--helpcontent2/source/text/sbasic/guide/insert_control.xhp57
-rw-r--r--helpcontent2/source/text/sbasic/guide/read_write_values.xhp196
-rw-r--r--helpcontent2/source/text/sbasic/guide/sample_code.xhp139
-rw-r--r--helpcontent2/source/text/sbasic/guide/show_dialog.xhp63
-rw-r--r--helpcontent2/source/text/sbasic/guide/translation.xhp108
11 files changed, 1235 insertions, 0 deletions
diff --git a/helpcontent2/source/text/sbasic/guide/access2base.xhp b/helpcontent2/source/text/sbasic/guide/access2base.xhp
new file mode 100644
index 000000000..507a63c9d
--- /dev/null
+++ b/helpcontent2/source/text/sbasic/guide/access2base.xhp
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+
+<!--
+===================================================================================================================
+=== The Access2Base library is a part of the LibreOffice project. ===
+=== Full documentation is available on http://www.access2base.com ===
+===================================================================================================================
+
+ Access2Base is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ Access2Base is free software; you can redistribute it and/or modify it under the terms of either (at your option):
+
+ 1) The Mozilla Public License, v. 2.0. If a copy of the MPL was not
+ distributed with this file, you can obtain one at http://mozilla.org/MPL/2.0/ .
+
+ 2) The GNU Lesser General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version. If a copy of the LGPL was not
+ distributed with this file, see http://www.gnu.org/licenses/ .
+ -->
+
+
+<helpdocument version="1.0">
+<meta>
+ <topic id="textsbasicsharedA2B001xml" indexer="include" status="PUBLISH">
+ <title id="tit" xml-lang="en-US">Access2Base</title>
+ <filename>/text/sbasic/guide/access2base.xhp</filename>
+ </topic>
+ <history>
+ <created date="2013-11-01T00:00:00">Access2Base topic first insertion, by Jean-Pierre Ledure</created>
+ </history>
+</meta>
+<body>
+<bookmark xml-lang="en-US" branch="index" id="bm_idA2B001">
+<bookmark_value>Access2Base</bookmark_value>
+<bookmark_value>Microsoft Access; Access2Base</bookmark_value>
+<bookmark_value>Access databases; run in Base</bookmark_value>
+</bookmark>
+ <paragraph role="heading" id="hd_idA2B002" xml-lang="en-US" level="1">Access2Base</paragraph>
+ <paragraph role="heading" id="hd_idA2B003" xml-lang="en-US" level="2">What is Access2Base?</paragraph>
+ <paragraph role="paragraph" id="par_idA2B004" xml-lang="en-US">Access2Base is a %PRODUCTNAME BASIC library of macros for (business or personal) application developers and advanced users. It is one of the libraries stored in "Application macros and dialogs".</paragraph>
+ <paragraph role="paragraph" id="par_idA2B005" xml-lang="en-US">The functionalities provided by the implemented macros are all directly inspired by Microsoft Access. The macros are callable mainly from a %PRODUCTNAME <emph>Base</emph> application, but also from <emph>any</emph> %PRODUCTNAME document (Writer, Calc, ...) where access to data stored in a database makes sense.</paragraph>
+ <paragraph role="paragraph" id="par_idA2B006" xml-lang="en-US">The API provided by Access2Base is intended to be more concise, intuitive and easy to learn than the standard UNO API (API = Application Programming Interface).</paragraph>
+ <paragraph role="warning" id="par_idA2B007" xml-lang="en-US"><emph>The library is documented online on </emph><link href="http://www.access2base.com" name="http://www.access2base.com"><emph>http://www.access2base.com</emph></link>.</paragraph>
+ <paragraph role="heading" id="hd_idA2B008" xml-lang="en-US" level="2">The implemented macros include:</paragraph>
+ <list type="ordered" format="1">
+ <listitem>
+ <paragraph role="listitem" id="par_idA2B009" xml-lang="en-US">a simplified and extensible API for <emph>forms</emph>, <emph>dialogs</emph> and <emph>controls</emph> manipulations similar with the Microsoft Access object model,</paragraph>
+ </listitem>
+ <listitem>
+ <paragraph role="listitem" id="par_idA2B010" xml-lang="en-US">an API for database access with the <emph>table</emph>, <emph>query</emph>, <emph>recordset</emph> and <emph>field</emph> objects,</paragraph>
+ </listitem>
+ <listitem>
+ <paragraph role="listitem" id="par_idA2B011" xml-lang="en-US">a number of <emph>actions</emph> with a syntax identical to their corresponding Microsoft Access macros/actions,</paragraph>
+ </listitem>
+ <listitem>
+ <paragraph role="listitem" id="par_idA2B012" xml-lang="en-US">the <emph>DLookup</emph>, <emph>DSum</emph>, ... database functions,</paragraph>
+ </listitem>
+ <listitem>
+ <paragraph role="listitem" id="par_idA2B013" xml-lang="en-US">the support of the shortcut notations like <item type="literal">Forms!myForm!myControl</item></paragraph>
+ </listitem>
+ </list>
+ <paragraph role="paragraph" id="par_idA2B014" xml-lang="en-US">in addition</paragraph>
+ <list type="ordered" format="1" startwith="6">
+ <listitem>
+ <paragraph role="listitem" id="par_idA2B015" xml-lang="en-US">a consistent errors and exceptions handler,</paragraph>
+ </listitem>
+ <listitem>
+ <paragraph role="listitem" id="par_idA2B016" xml-lang="en-US">facilities for programming form, dialog and control <emph>events</emph> and</paragraph>
+ </listitem>
+ <listitem>
+ <paragraph role="listitem" id="par_idA2B017" xml-lang="en-US">the support of both embedded forms and standalone (Writer) forms.</paragraph>
+ </listitem>
+ </list>
+ <paragraph role="heading" id="hd_idA2B018" xml-lang="en-US" level="2">Compare Access2Base with Microsoft Access VBA</paragraph>
+ <bascode>
+ <paragraph role="bascode" id="hd_idA2B019" xml-lang="en-US" localize="false">REM Open a form ... </paragraph>
+ <paragraph role="bascode" id="hd_idA2B020" xml-lang="en-US" localize="false"> OpenForm("myForm") </paragraph>
+ <paragraph role="bascode" id="hd_idA2B021" xml-lang="en-US" localize="false">REM Move a form to new left-top coordinates ... </paragraph>
+ <paragraph role="bascode" id="hd_idA2B022" xml-lang="en-US" localize="false"> Dim ofForm As Object ' In VBA => Dim ofForm As Form </paragraph>
+ <paragraph role="bascode" id="hd_idA2B023" xml-lang="en-US" localize="false"> Set ofForm = Forms("myForm") </paragraph>
+ <paragraph role="bascode" id="hd_idA2B024" xml-lang="en-US" localize="false"> ofForm.Move(100, 200) </paragraph>
+ <paragraph role="bascode" id="hd_idA2B025" xml-lang="en-US" localize="false">REM Get the value of a control ... </paragraph>
+ <paragraph role="bascode" id="hd_idA2B026" xml-lang="en-US" localize="false"> Dim ocControl As Object </paragraph>
+ <paragraph role="bascode" id="hd_idA2B027" xml-lang="en-US" localize="false"> ocControl = ofForm.Controls("myControl") </paragraph>
+ <paragraph role="bascode" id="hd_idA2B028" xml-lang="en-US" localize="false"> MsgBox ocControl.Value </paragraph>
+ <paragraph role="bascode" id="hd_idA2B029" xml-lang="en-US" localize="false">REM Hide a control ... </paragraph>
+ <paragraph role="bascode" id="hd_idA2B030" xml-lang="en-US" localize="false"> ocControl.Visible = False </paragraph>
+ <paragraph role="bascode" id="hd_idA2B031" xml-lang="en-US" localize="false">REM ... or alternatively ... </paragraph>
+ <paragraph role="bascode" id="hd_idA2B032" xml-lang="en-US" localize="false"> setValue("Forms!myForm!myControl.Visible", False) ' Shortcut notation </paragraph>
+ <paragraph role="bascode" id="hd_idA2B033" xml-lang="en-US" localize="false"> ' In VBA => Forms!myForm!myControl.Visible = False </paragraph>
+ </bascode>
+</body>
+</helpdocument>
diff --git a/helpcontent2/source/text/sbasic/guide/basic_2_python.xhp b/helpcontent2/source/text/sbasic/guide/basic_2_python.xhp
new file mode 100644
index 000000000..4ea2d89f4
--- /dev/null
+++ b/helpcontent2/source/text/sbasic/guide/basic_2_python.xhp
@@ -0,0 +1,181 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<helpdocument version="1.0">
+ <!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ -->
+ <meta>
+ <topic id="text/sbasic/guide/basic_2_python">
+ <title id="tit" xml-lang="en-US">Basic to Python</title>
+ <filename>/text/sbasic/guide/basic_2_python.xhp</filename>
+ </topic>
+ </meta>
+ <body>
+ <bookmark branch="index" id="N0430">
+ <bookmark_value>Basic;Calling Python</bookmark_value>
+ <bookmark_value>API;SimpleFileAccess</bookmark_value>
+ <bookmark_value>API;PathSettings</bookmark_value>
+ <bookmark_value>API;XScript</bookmark_value>
+ </bookmark>
+ <h1 id="hd_id811571848401485"><variable id="basic2python"><link href="text/sbasic/guide/basic_2_python.xhp" name="Basic Programming Examples">Calling Python Scripts from Basic</link></variable></h1>
+ <paragraph role="paragraph" id="N0432">Calling Python scripts from %PRODUCTNAME Basic macros is possible, and valuable features can be obtained such as:</paragraph>
+ <list type="unordered">
+ <listitem><paragraph role="listitem" id="N0433"><literal>ComputerName</literal> identification or <literal>OSName</literal> detection are possible,</paragraph></listitem>
+ <listitem><paragraph role="listitem" id="N0434">Basic <literal>FileLen()</literal> function and <link href="https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1ucb_1_1SimpleFileAccess.html" name="ucb.SimpleFileAccess">com.sun.star.ucb.SimpleFileAccess.</link><literal>getSize()</literal> API function exhibit a 2 Gigabytes file size upper limit that Python helps to overcome,</paragraph></listitem>
+ <listitem><paragraph role="listitem" id="N0435"><link href="https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1util_1_1PathSettings.html" name="util.PathSettings">com.sun.star.util.PathSettings</link> can be normalized,</paragraph></listitem>
+ <listitem><paragraph role="listitem" id="N0436">and many more.</paragraph></listitem>
+ </list>
+ <tip id="N0437">A reasonable exposure to %PRODUCTNAME Basic and to <link href="https://api.libreoffice.org/" name="Application Programming Interface">Application Programming Interface (API)</link> features is recommended prior to perform inter-language calls from Basic to Python, to JavaScript or any other script engine.</tip>
+ <h2 id="N0438">Retrieving Python Scripts</h2>
+ <paragraph role="paragraph" id="N0439">Python scripts can be personal, shared, or embedded in documents. In order to execute them, %PRODUCTNAME Basic needs to be provided with Python script locations. Locating <link href="https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1script_1_1provider_1_1XScript.html" name="script.provider.XScript">com.sun.star.script.provider.XScript</link> interface compliant UNO objects allows the execution of Python scripts:</paragraph>
+ <bascode>
+ <paragraph role="bascode" localize="false" id="N0440">Option Explicit</paragraph>
+ <paragraph role="bascode" localize="false" id="N0441"> </paragraph>
+ <paragraph role="bascode" localize="false" id="N0442">Public Function GetPythonScript(macro As String, _</paragraph>
+ <paragraph role="bascode" localize="false" id="N0443"> Optional location As String) As com.sun.star.script.provider.Xscript</paragraph>
+ <paragraph role="bascode" id="N0444"> &apos;&apos;&apos; Grab Python script object before execution</paragraph>
+ <paragraph role="bascode" id="N0445"> &apos; Arguments:</paragraph>
+ <paragraph role="bascode" id="N0446"> &apos; macro : as &quot;library/module.py$macro&quot; or &quot;module.py$macro&quot;</paragraph>
+ <paragraph role="bascode" id="N0447"> &apos; location: as &quot;document&quot;, &quot;share&quot;, &quot;user&quot; or ENUM(eration)</paragraph>
+ <paragraph role="bascode" id="N0448"> &apos; Result:</paragraph>
+ <paragraph role="bascode" id="N0449"> &apos; located com.sun.star.script.provider.XScript UNO service&apos;&apos;&apos;</paragraph>
+ <paragraph role="bascode" localize="false" id="N0450"> If IsMissing(location) Then location = &quot;user&quot;</paragraph>
+ <paragraph role="bascode" localize="false" id="N0451"> Dim mspf As Object &apos; com.sun.star.script.provider.MasterScriptProviderFactory</paragraph>
+ <paragraph role="bascode" id="N0452"> Dim sp As Object &apos; com.sun.star.script.provider.XScriptProvider compatible</paragraph>
+ <paragraph role="bascode" localize="false" id="N0453"> Dim uri As String</paragraph>
+ <paragraph role="bascode" localize="false" id="N0454"> If location=&quot;document&quot; Then</paragraph>
+ <paragraph role="bascode" localize="false" id="N0455"> sp = ThisComponent.getScriptProvider()</paragraph>
+ <paragraph role="bascode" localize="false" id="N0456"> Else</paragraph>
+ <paragraph role="bascode" localize="false" id="N0457"> mspf = CreateUNOService(&quot;com.sun.star.script.provider.MasterScriptProviderFactory&quot;)</paragraph>
+ <paragraph role="bascode" localize="false" id="N0458"> sp = mspf.createScriptProvider(&quot;&quot;)</paragraph>
+ <paragraph role="bascode" localize="false" id="N0459"> End If</paragraph>
+ <paragraph role="bascode" localize="false" id="N0460"> uri = &quot;vnd.sun.star.script:&quot;&amp; macro &amp;&quot;?language=Python&amp;location=&quot;&amp; location</paragraph>
+ <paragraph role="bascode" localize="false" id="N0461"> GetPythonScript = sp.getScript(uri)</paragraph>
+ <paragraph role="bascode" localize="false" id="N0462">End Function &apos; GetPythonScript</paragraph>
+ </bascode>
+ <h2 id="N0463">Executing Python Scripts</h2>
+ <embed href="text/sbasic/python/python_2_basic.xhp#APIScriptingFramework" />
+ <h3 id="N0464">Syntax</h3>
+ <paragraph role="paragraph" localize="false" id="N0465"><literal>workstation_name = script.invoke(Array(), Array(), Array())</literal></paragraph>
+ <paragraph role="paragraph" id="N0466"><literal>opSysName = script.invoke(Array(), in_outs, Array())</literal> &apos; in_out is an Array</paragraph>
+ <paragraph role="paragraph" localize="false" id="N0467"><literal>file_len = script.invoke(Array(systemFilePath), Array(), Array())</literal></paragraph>
+ <paragraph role="paragraph" localize="false" id="N0468"><literal>normalizedPath = script.invoke(Array(systemFilePath), Array(), Array())</literal></paragraph>
+ <h3 id="N0469">Embedded Scripts Examples</h3>
+ <paragraph role="paragraph" id="N0470">Below <literal>ComputerName</literal>, and <literal>GetFilelen</literal> routines are calling their Python counterparts, using aforementioned <literal>GetPythonScript</literal> function. Exception handling is not detailed.</paragraph>
+ <bascode>
+ <paragraph role="bascode" localize="false" id="N0471">Option Explicit</paragraph>
+ <paragraph role="bascode" id="N0472">Option Compatible &apos; Properties are supported</paragraph>
+ <paragraph role="bascode" localize="false" id="N0473"> </paragraph>
+ <paragraph role="bascode" localize="false" id="N0474">Private scr As Object &apos; com.sun.star.script.provider.XScript</paragraph>
+ <paragraph role="bascode" localize="false" id="N0475"> </paragraph>
+ <paragraph role="bascode" localize="false" id="N0476">Private Property Get ComputerName As String</paragraph>
+ <paragraph role="bascode" id="N0477"> &apos;&apos;&apos;Workstation name&apos;&apos;&apos;</paragraph>
+ <paragraph role="bascode" localize="false" id="N0478"> scr = GetPythonScript(&quot;Platform.py$computer_name&quot;, &quot;document&quot;)</paragraph>
+ <paragraph role="bascode" localize="false" id="N0479"> ComputerName = scr.invoke(Array(), Array(), Array())</paragraph>
+ <paragraph role="bascode" localize="false" id="N0480">End Property &apos; ComputerName</paragraph>
+ <paragraph role="bascode" localize="false" id="N0481"> </paragraph>
+ <paragraph role="bascode" localize="false" id="N0482">Private Function GetFilelen(systemFilePath As String) As Currency</paragraph>
+ <paragraph role="bascode" id="N0483"> &apos;&apos;&apos;File size in bytes&apos;&apos;&apos;</paragraph>
+ <paragraph role="bascode" localize="false" id="N0484"> scr = GetPythonScript(&quot;Os/Path.py$get_size&quot;, Script.ISEMBEDDED)</paragraph>
+ <paragraph role="bascode" localize="false" id="N0485"> GetFilelen = scr.invoke(Array(systemFilePath), Array(), Array(),)</paragraph>
+ <paragraph role="bascode" localize="false" id="N0486">End Function &apos; GetFilelen</paragraph>
+ <paragraph role="bascode" localize="false" id="N0487"> </paragraph>
+ <paragraph role="bascode" localize="false" id="N0488">Private Type _SCRIPT_LOCATION</paragraph>
+ <paragraph role="bascode" id="N0489"> ISEMBEDDED As String &apos; document script</paragraph>
+ <paragraph role="bascode" id="N0490"> ISPERSONAL As String &apos; user script</paragraph>
+ <paragraph role="bascode" id="N0491"> ISSHARED As String &apos; %PRODUCTNAME macro</paragraph>
+ <paragraph role="bascode" localize="false" id="N0492">End Type &apos; _SCRIPT_LOCATION</paragraph>
+ <paragraph role="bascode" localize="false" id="N0493"> </paragraph>
+ <paragraph role="bascode" localize="false" id="N0494">Public Function Script() As Object &apos; Text enumeration</paragraph>
+ <paragraph role="bascode" localize="false" id="N0495"> Static enums As _SCRIPT_LOCATION : With enums</paragraph>
+ <paragraph role="bascode" localize="false" id="N0496"> If .ISEMBEDDED = &quot;&quot; Then</paragraph>
+ <paragraph role="bascode" id="N0497"> .ISEMBEDDED = &quot;document&quot; &apos; document script</paragraph>
+ <paragraph role="bascode" id="N0498"> .ISPERSONAL = &quot;user&quot; &apos; user scripts</paragraph>
+ <paragraph role="bascode" id="N0499"> .ISSHARED = &quot;share&quot; &apos; %PRODUCTNAME macro</paragraph>
+ <paragraph role="bascode" localize="false" id="N0500"> End If : End With &apos; enums</paragraph>
+ <paragraph role="bascode" localize="false" id="N0501"> Script = enums</paragraph>
+ <paragraph role="bascode" localize="false" id="N0502">End Function &apos; Script</paragraph>
+ </bascode>
+ <paragraph role="paragraph" id="N0503">Two different Python modules are called. They can either be embedded in the current document, either be stored on the file system. Argument type checking is skipped for clarity:</paragraph>
+ <list type="unordered">
+ <listitem><paragraph localize="false" role="paragraph" id="N0504">Platform.py</paragraph></listitem>
+ </list>
+ <pycode>
+ <paragraph role="pycode" localize="false" id="N0505"># -*- coding: utf-8 -*-</paragraph>
+ <paragraph role="pycode" localize="false" id="N0506">from __future__ import unicode_literals</paragraph>
+ <paragraph role="pycode" localize="false" id="N0507"> </paragraph>
+ <paragraph role="pycode" localize="false" id="N0508">import platform</paragraph>
+ <paragraph role="pycode" localize="false" id="N0509"> </paragraph>
+ <paragraph role="pycode" localize="false" id="N0510">def computer_name() -&gt; str:</paragraph>
+ <paragraph role="pycode" localize="false" id="N0511"> return platform.node()</paragraph>
+ <paragraph role="pycode" localize="false" id="N0512"> </paragraph>
+ <paragraph role="pycode" localize="false" id="N0513">def OSname() -&gt; str:</paragraph>
+ <paragraph role="pycode" localize="false" id="N0514"> return platform.system()</paragraph>
+ </pycode>
+ <list type="unordered">
+ <listitem><paragraph localize="false" role="paragraph" id="N0515">Os/Path.py</paragraph></listitem>
+ </list>
+ <pycode>
+ <paragraph role="pycode" localize="false" id="N0516"># -*- coding: utf-8 -*-</paragraph>
+ <paragraph role="pycode" localize="false" id="N0517">from __future__ import unicode_literals</paragraph>
+ <paragraph role="pycode" localize="false" id="N0518"> </paragraph>
+ <paragraph role="pycode" localize="false" id="N0519">import os.path</paragraph>
+ <paragraph role="pycode" localize="false" id="N0520"> </paragraph>
+ <paragraph role="pycode" localize="false" id="N0521">def get_size(systemFilePath: str) -&gt; str:</paragraph>
+ <paragraph role="pycode" localize="false" id="N0522"> return str(os.path.getsize(systemFilePath))</paragraph>
+ <paragraph role="pycode" localize="false" id="N0523"> </paragraph>
+ <paragraph role="pycode" localize="false" id="N0524">def normalyze(systemPath: str) -&gt; str:</paragraph>
+ <paragraph role="pycode" localize="false" id="N0525"> return os.path.normpath(systemPath)</paragraph>
+ </pycode>
+ <h3 id="N0526">Personal or Shared Scripts Examples</h3>
+ <paragraph role="paragraph" id="N0527">The calling mechanism for personal or shared Python scripts is identical to that of embedded scripts. Library names are mapped to folders. Computing %PRODUCTNAME user profile and shared modules system file paths can be performed as detailed in <link href="text/sbasic/python/python_session.xhp">Getting session information</link>. Below <literal>OSName</literal>, <literal>HelloWorld</literal> and <literal>NormalizePath</literal> routines are calling their Python counterparts, using aforementioned <literal>GetPythonScript</literal> function. Exception handling is not detailed.</paragraph>
+ <bascode>
+ <paragraph role="bascode" localize="false" id="N0528">Option Explicit</paragraph>
+ <paragraph role="bascode" id="N0529">Option Compatible &apos; Properties are supported</paragraph>
+ <paragraph role="bascode" localize="false" id="N0530"> </paragraph>
+ <paragraph role="bascode" localize="false" id="N0531">Private scr As Object &apos; com.sun.star.script.provider.XScript</paragraph>
+ <paragraph role="bascode" localize="false" id="N0532"> </paragraph>
+ <paragraph role="bascode" localize="false" id="N0533">Private Property Get OSName As String</paragraph>
+ <paragraph role="bascode" id="N0534"> &apos;&apos;&apos;Platform name as &quot;Linux&quot;, &quot;Darwin&quot; or &quot;Windows&quot;&apos;&apos;&apos;</paragraph>
+ <paragraph role="bascode" localize="false" id="N0535"> scr = GetPythonScript(&quot;Platform.py$OSname&quot;, Script.ISPERSONAL)</paragraph>
+ <paragraph role="bascode" localize="false" id="N0536"> OSName = scr.invoke(Array(), Array(), Array()) </paragraph>
+ <paragraph role="bascode" localize="false" id="N0537">End Property &apos; OSName</paragraph>
+ <paragraph role="bascode" localize="false" id="N0538"> </paragraph>
+ <paragraph role="bascode" localize="false" id="N0539">Private Sub HelloWorld()</paragraph>
+ <paragraph role="bascode" id="N0540"> &apos;&apos;&apos;%PRODUCTNAME Python shared sample&apos;&apos;&apos;</paragraph>
+ <paragraph role="bascode" localize="false" id="N0541"> scr = GetPythonScript(&quot;HelloWorld.py$HelloWorldPython&quot;, Script.ISSHARED)</paragraph>
+ <paragraph role="bascode" localize="false" id="N0542"> scr.invoke(Array(), Array(), Array(),)</paragraph>
+ <paragraph role="bascode" localize="false" id="N0543">End Sub &apos; HelloWorld</paragraph>
+ <paragraph role="bascode" localize="false" id="N0544"> </paragraph>
+ <paragraph role="bascode" localize="false" id="N0545">Public Function NormalizePath(systemFilePath As String) As String</paragraph>
+ <paragraph role="bascode" id="N0546"> &apos;&apos;&apos;Strip superfluous &apos;\..&apos; in path&apos;&apos;&apos;</paragraph>
+ <paragraph role="bascode" localize="false" id="N0547"> scr = GetPythonScript(&quot;Os/Path.py$normalyze&quot;, &quot;user&quot;)</paragraph>
+ <paragraph role="bascode" localize="false" id="N0548"> NormalizePath = scr.invoke(Array(systemFilePath), Array(), Array())</paragraph>
+ <paragraph role="bascode" localize="false" id="N0549">End Function &apos; NormalizePath</paragraph>
+ </bascode>
+ <h2 id="N0550">Python standard modules</h2>
+ <paragraph role="paragraph" id="N0551">%PRODUCTNAME embedded Python contains many standard libraries to benefit from. They bear a rich feature set, such as but not limited to:</paragraph>
+ <list type="unordered">
+ <listitem><paragraph role="listitem" id="N0552"><emph>argparse</emph> Parser for command-line options, arguments and sub-commands</paragraph></listitem>
+ <listitem><paragraph role="listitem" id="N0553"><emph>cmath</emph> Mathematical functions for complex numbers</paragraph></listitem>
+ <listitem><paragraph role="listitem" id="N0554"><emph>csv</emph> CSV files reading and writing</paragraph></listitem>
+ <listitem><paragraph role="listitem" id="N0555"><emph>datetime</emph> Genuine date and time types</paragraph></listitem>
+ <listitem><paragraph role="listitem" id="N0556"><emph>json</emph> JSON encoder and decoder</paragraph></listitem>
+ <listitem><paragraph role="listitem" id="N0557"><emph>math</emph> Mathematical functions</paragraph></listitem>
+ <listitem><paragraph role="listitem" id="N0558"><emph>re</emph> Regular expression operations</paragraph></listitem>
+ <listitem><paragraph role="listitem" id="N0559"><emph>socket</emph> Low-level networking interface</paragraph></listitem>
+ <listitem><paragraph role="listitem" id="N0560"><emph>sys</emph> System-specific parameters and functions</paragraph></listitem>
+ <listitem><paragraph role="listitem" id="N0561"><emph>unittest</emph> and <emph>trace</emph> Unit testing framework and Track Python execution</paragraph></listitem>
+ <listitem><paragraph role="listitem" id="N0562"><emph>xml.etree.ElementTree</emph> ElementTree XML API</paragraph></listitem>
+ </list>
+ <section id="relatedtopics" >
+ <embed href="text/sbasic/python/python_2_basic.xhp#py2ba_h1"/>
+ <embed href="text/sbasic/shared/main0601.xhp#mainsbasic"/>
+ <embed href="text/sbasic/python/main0000.xhp#pythonscriptshelp"/>
+ </section>
+ </body>
+</helpdocument>
diff --git a/helpcontent2/source/text/sbasic/guide/basic_examples.xhp b/helpcontent2/source/text/sbasic/guide/basic_examples.xhp
new file mode 100644
index 000000000..97b11c065
--- /dev/null
+++ b/helpcontent2/source/text/sbasic/guide/basic_examples.xhp
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<helpdocument version="1.0">
+ <!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ -->
+ <meta>
+ <topic id="basicexamples" indexer="include" status="PUBLISH">
+ <title id="tit" xml-lang="en-US">Basic Programming Examples</title>
+ <filename>/text/sbasic/guide/basic_examples.xhp</filename>
+ </topic>
+ </meta>
+ <body>
+ <bookmark xml-lang="en-US" branch="index" id="bm_id171559140731329">
+ <bookmark_value>Basic;programming examples</bookmark_value>
+ </bookmark>
+ <section id="basicexamplesh1">
+ <h1 id="hd_id471559139063621"><variable id="basicexamplestit"><link href="text/sbasic/guide/basic_examples.xhp" name="Basic Programming Examples">Basic Programming Examples</link></variable></h1>
+ </section>
+ <embed href="text/sbasic/python/python_handler.xhp#pythonhandler_h1"/>
+ <embed href="text/sbasic/python/python_listener.xhp#pythonlistener"/>
+ <embed href="text/sbasic/python/python_session.xhp#pythonsession"/>
+ <embed href="text/sbasic/python/python_platform.xhp#pythonplatform"/>
+ <embed href="text/sbasic/python/python_document_events.xhp#pythonmonitor"/>
+ <embed href="text/sbasic/guide/show_dialog.xhp#show_dialog"/>
+ <embed href="text/sbasic/guide/sample_code.xhp#sample_code"/>
+ <embed href="text/sbasic/guide/basic_2_python.xhp#basic2python"/>
+ <section id="relatedtopics">
+ <embed href="text/sbasic/shared/main0601.xhp#mainsbasic"/>
+ </section>
+</body>
+</helpdocument>
diff --git a/helpcontent2/source/text/sbasic/guide/calc_borders.xhp b/helpcontent2/source/text/sbasic/guide/calc_borders.xhp
new file mode 100644
index 000000000..23fa7b885
--- /dev/null
+++ b/helpcontent2/source/text/sbasic/guide/calc_borders.xhp
@@ -0,0 +1,248 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<helpdocument version="1.0">
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+-->
+
+<meta>
+ <topic id="SF_FormControl" indexer="include" status="PUBLISH">
+ <title id="tit" xml-lang="en-US">Formatting Borders in Calc with Macros</title>
+ <filename>/text/sbasic/guide/calc_borders.xhp</filename>
+ </topic>
+</meta>
+
+<body>
+ <bookmark localize="false" branch="index" id="bm_id41582391760114">
+ <bookmark_value>macros;format borders</bookmark_value>
+ </bookmark>
+ <h1 id="hd_id461623364876507"><variable id="title"><link href="text/sbasic/guide/calc_borders.xhp" name="Calc_Borders_h1">Formatting Borders in Calc with Macros</link></variable></h1>
+ <paragraph role="paragraph" id="par_id461630536347127">By using Basic or Python programming languages it is possible to write macros that apply formats to ranges of cells in Calc.</paragraph>
+
+ <h2 id="hd_id81630536486560">Formatting Borders in Ranges of Cells</h2>
+ <paragraph role="paragraph" id="par_id871630536518700">The code snippet below creates a <literal>Sub</literal> called <literal>FormatCellBorder</literal> that applies new border formats to a given range address in the current Calc sheet.</paragraph>
+ <bascode>
+ <paragraph role="bascode" localize="false" id="bas_id161630537784558">Sub FormatCellBorder(cellAddress as String, newStyle as Byte, newWidth as Long, Optional newColor as Long)</paragraph>
+ <paragraph role="bascode" id="bas_id131630537785605"> ' Creates the UNO struct that will store the new line format</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id751630537785844"> Dim lineFormat as New com.sun.star.table.BorderLine2</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id331630537786054"> lineFormat.LineStyle = newStyle</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id561630537786262"> lineFormat.LineWidth = newWidth</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id731630537786476"> If Not IsMissing(newColor) Then lineFormat.Color = newColor</paragraph>
+ <paragraph role="bascode" id="bas_id971630537786724"> ' Gets the target cell</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id221630537786925"> Dim oCell as Object</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id301630537787141"> Set oCell = ThisComponent.CurrentController.ActiveSheet.getCellRangeByName(cellAddress)</paragraph>
+ <paragraph role="bascode" id="bas_id791630537787373"> ' Applies the new format to all borders</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id291630537787589"> oCell.TopBorder = lineFormat</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id471630537787829"> oCell.RightBorder = lineFormat</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id21630537788070"> oCell.LeftBorder = lineFormat</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id491630537788285"> oCell.BottomBorder = lineFormat</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id531630537788597">End Sub</paragraph>
+ </bascode>
+ <paragraph role="paragraph" id="par_id141630537941393">The <literal>Sub</literal> described above takes in four arguments:</paragraph>
+ <list type="unordered">
+ <listitem>
+ <paragraph id="par_id841630538209958" role="listitem"><emph>cellAddress</emph> is a string denoting the range to be formatted in the format "A1".</paragraph>
+ </listitem>
+ <listitem>
+ <paragraph id="par_id821630538210271" role="listitem"><emph>newStyle</emph> is an integer value that corresponds to the border line style (see <link href="text/sbasic/guide/calc_borders.xhp#LineStyles_h2" name="LineStyles_link">Line Styles</link> below).</paragraph>
+ </listitem>
+ <listitem>
+ <paragraph id="par_id191630538210607" role="listitem"><emph>newWidth</emph> is an integer value that defines the line width.</paragraph>
+ </listitem>
+ <listitem>
+ <paragraph id="par_id71630538211142" role="listitem"><emph>newColor</emph> is an integer value corresponding to a color defined using the <link href="text/sbasic/shared/03010305.xhp" name="RGB_link">RGB</link> function.</paragraph>
+ </listitem>
+ </list>
+ <paragraph role="paragraph" id="par_id201630538522838">To call <literal>FormatCellBorder</literal> create a new macro and pass the desired arguments, as shown below:</paragraph>
+ <bascode>
+ <paragraph role="bascode" localize="false" id="bas_id871630538918984">Sub MyMacro</paragraph>
+ <paragraph role="bascode" id="bas_id651630603779228"> ' Gives access to the line style constants</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id961630603780188"> Dim cStyle as Object</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id741630603780429"> Set cStyle = com.sun.star.table.BorderLineStyle</paragraph>
+ <paragraph role="bascode" id="bas_id321630538931144"> ' Formats "B5" with solid blue borders</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id1001630538931505"> FormatCellBorder("B5", cStyle.SOLID, 20, RGB(0, 0, 255))</paragraph>
+ <paragraph role="bascode" id="bas_id91630538931686"> ' Formats all borders in the range "D2:F6" with red dotted borders</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id261630538932143"> FormatCellBorder("D2:F6", cStyle.DOTTED, 20, RGB(255, 0, 0))</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id471630539067462">End Sub</paragraph>
+ </bascode>
+ <paragraph role="paragraph" id="par_id31630540159114">It is possible to implement the same functionality in Python:</paragraph>
+ <pycode>
+ <paragraph role="pycode" localize="false" id="pyc_id381630541980340">from uno import createUnoStruct</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id231630541980607">from scriptforge import CreateScriptService</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id801630542013431"></paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id221630540777433">def formatCellBorder(cellAddress, newStyle, newWidth, newColor=0):</paragraph>
+ <paragraph role="pycode" id="pyc_id411630540777672"> # Defines the new line format</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id731630540777889"> line_format = createUnoStruct("com.sun.star.table.BorderLine2")</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id341630540778097"> line_format.LineStyle = newStyle</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id301630540778329"> line_format.LineWidth = newWidth</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id691630540778577"> line_format.Color = newColor</paragraph>
+ <paragraph role="pycode" id="pyc_id361630540778786"> # Scriptforge service to access cell ranges</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id471630540778985"> doc = CreateScriptService("Calc")</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id551630540779225"> cell = doc.XCellRange(cellAddress)</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id51630540779426"> cell.TopBorder = line_format</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id31630540779643"> cell.RightBorder = line_format</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id401630540779834"> cell.LeftBorder = line_format</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id291630540780067"> cell.BottomBorder = line_format</paragraph>
+ </pycode>
+ <paragraph role="paragraph" id="par_id931630541661889">The code snippet below implements a macro named <literal>myMacro</literal> that calls <literal>formatCellBorder</literal>:</paragraph>
+ <pycode>
+ <paragraph role="pycode" localize="false" id="pyc_id131630605507740">from com.sun.star.table import BorderLineStyle as cStyle</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id351630605508043"></paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id181630541791470">def myMacro():</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id1001630541791803"> bas = CreateScriptService("Basic")</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id531630541792043"> formatCellBorder("B5", cStyle.SOLID, 20, bas.RGB(0, 0, 255))</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id601630541792230"> formatCellBorder("D2:F6", cStyle.DOTTED, 20, bas.RGB(255, 0, 0))</paragraph>
+ </pycode>
+ <note id="par_id261630541889040">The Python code presented above uses the <link href="text/sbasic/shared/03/lib_ScriptForge.xhp" name="SF_link">ScriptForge library</link> that is available since %PRODUCTNAME 7.2.</note>
+
+ <section id="LineStyles_h2">
+ <h2 id="hd_id361630539136798">Line Styles</h2>
+ </section>
+ <paragraph role="paragraph" id="par_id501630539147234">Line styles are defined as integer constants. The table below lists the constants for the line styles available in <menuitem>Format - Cells - Borders</menuitem>:</paragraph>
+ <table id="tab_id531630539273987">
+ <tablerow>
+ <tablecell>
+ <paragraph id="par_id651630604006712" role="tablehead">Constant name</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id501630539273987" role="tablehead">Integer value</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id191630539273987" role="tablehead">Line style name</paragraph>
+ </tablecell>
+ </tablerow>
+ <tablerow>
+ <tablecell>
+ <paragraph id="par_id301630604024530" localize="false" role="tablecontent">SOLID</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id861630539273987" localize="false" role="tablecontent">0</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id691630539273987" role="tablecontent">Solid</paragraph>
+ </tablecell>
+ </tablerow>
+ <tablerow>
+ <tablecell>
+ <paragraph id="par_id571630604044791" localize="false" role="tablecontent">DOTTED</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id321630539319305" localize="false" role="tablecontent">1</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id591630539325162" role="tablecontent">Dotted</paragraph>
+ </tablecell>
+ </tablerow>
+ <tablerow>
+ <tablecell>
+ <paragraph id="par_id921630604090581" localize="false" role="tablecontent">DASHED</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id261630539430102" localize="false" role="tablecontent">2</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id881630539433260" role="tablecontent">Dashed</paragraph>
+ </tablecell>
+ </tablerow>
+ <tablerow>
+ <tablecell>
+ <paragraph id="par_id981630604124169" localize="false" role="tablecontent">FINE_DASHED</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id701630539460809" localize="false" role="tablecontent">14</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id111630539463634" role="tablecontent">Fine dashed</paragraph>
+ </tablecell>
+ </tablerow>
+ <tablerow>
+ <tablecell>
+ <paragraph id="par_id311630604157101" localize="false" role="tablecontent">DOUBLE_THIN</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id101630539468131" localize="false" role="tablecontent">15</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id261630539471483" role="tablecontent">Double thin</paragraph>
+ </tablecell>
+ </tablerow>
+ <tablerow>
+ <tablecell>
+ <paragraph id="par_id911630604171290" localize="false" role="tablecontent">DASH_DOT</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id851630539475055" localize="false" role="tablecontent">16</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id671630539478101" role="tablecontent">Dash dot</paragraph>
+ </tablecell>
+ </tablerow>
+ <tablerow>
+ <tablecell>
+ <paragraph id="par_id841630604186084" localize="false" role="tablecontent">DASH_DOT_DOT</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id481630539481944" localize="false" role="tablecontent">17</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id701630539484498" role="tablecontent">Dash dot dot</paragraph>
+ </tablecell>
+ </tablerow>
+ </table>
+ <tip id="par_id751630539680866">Refer to the <link href="https://api.libreoffice.org/docs/idl/ref/namespacecom_1_1sun_1_1star_1_1table_1_1BorderLineStyle.html" name="BorderLineStyle_link">BorderLineStyle Constant Reference</link> in the LibreOffice API documentation to learn more about line style constants.</tip>
+
+ <h2 id="hd_id31630542361666">Formatting Borders Using TableBorder2</h2>
+ <paragraph role="paragraph" id="par_id11630542436346">Range objects have a property named <literal>TableBorder2</literal> that can be used to format range borders as it is done in the <menuitem>Format - Cells - Borders</menuitem> dialog in the <emph>Line Arrangement</emph> section.</paragraph>
+ <paragraph role="paragraph" id="par_id641630542724480">In addition to top, bottom, left and right borders, <literal>TableBorder2</literal> also defines vertical and horizontal borders. The macro below applies only the top and bottom borders to the range "B2:E5".</paragraph>
+ <bascode>
+ <paragraph role="bascode" localize="false" id="bas_id761630543331847">Sub TableBorder2Example</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id261630606415938"> Dim cStyle as Object</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id831630606416281"> Set cStyle = com.sun.star.table.BorderLineStyle</paragraph>
+ <paragraph role="bascode" id="bas_id191630543332073"> ' Defines the new line format</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id111630543332260"> Dim lineFormat as New com.sun.star.table.BorderLine2</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id101630543332460"> lineFormat.LineStyle = cStyle.SOLID</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id241630543332688"> lineFormat.LineWidth = 15</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id631630543332874"> lineFormat.Color = RGB(0, 0, 0)</paragraph>
+ <paragraph role="bascode" id="bas_id281630543333061"> ' Struct that stores the new TableBorder2 definition</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id691630543333288"> Dim tableFormat as New com.sun.star.table.TableBorder2</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id451630543333501"> tableFormat.TopLine = lineFormat</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id661630543333742"> tableFormat.BottomLine = lineFormat</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id151630543333968"> tableFormat.IsTopLineValid = True</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id211630543334181"> tableFormat.IsBottomLineValid = True</paragraph>
+ <paragraph role="bascode" id="bas_id11630543334395"> ' Applies the table format to the range "B2:E5"</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id761630543334607"> Dim oCell as Object</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id531630543334821"> oCell = ThisComponent.CurrentController.ActiveSheet.getCellRangeByName("B2:E5")</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id851630543335050"> oCell.TableBorder2 = tableFormat</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id51630543335289">End Sub</paragraph>
+ </bascode>
+ <paragraph role="paragraph" id="par_id401630544066231">The macro can be implemented in Python as follows:</paragraph>
+ <pycode>
+ <paragraph role="pycode" localize="false" id="pyc_id131630605507120">from com.sun.star.table import BorderLineStyle as cStyle</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id21630606279912">from scriptforge import CreateScriptService</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id351630605508087"></paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id791630544113462">def tableBorder2Example():</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id461630606297116"> bas = CreateScriptService("Basic")</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id221630544113741"> line_format = createUnoStruct("com.sun.star.table.BorderLine2")</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id271630544113941"> line_format.LineStyle = cStyle.SOLID</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id41630544114154"> line_format.LineWidth = 18</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id921630544114367"> line_format.Color = bas.RGB(0, 0, 0)</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id421630544114568"> table_format = createUnoStruct("com.sun.star.table.TableBorder2")</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id721630544114809"> table_format.TopLine = line_format</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id481630544115021"> table_format.BottomLine = line_format</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id371630544115248"> table_format.IsTopLineValid = True</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id171630544115462"> table_format.IsBottomLineValid = True</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id761630544115702"> doc = CreateScriptService("Calc")</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id341630544115915"> cell = doc.XCellRange("B2:E5")</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id841630544116128"> cell.TableBorder2 = table_format</paragraph>
+ </pycode>
+ <tip id="par_id751630539680102">Refer to the <link href="https://api.libreoffice.org/docs/idl/ref/structcom_1_1sun_1_1star_1_1table_1_1TableBorder2.html" name="BorderLineStyle_link">TableBorder2 Struct Reference</link> in the LibreOffice API documentation to learn more about its attributes.</tip>
+
+ <section id="relatedtopics">
+ <embed href="text/sbasic/shared/03/lib_ScriptForge.xhp#ScriptForge_lib"/>
+ </section>
+ </body>
+</helpdocument>
diff --git a/helpcontent2/source/text/sbasic/guide/control_properties.xhp b/helpcontent2/source/text/sbasic/guide/control_properties.xhp
new file mode 100644
index 000000000..7d8ff2c3e
--- /dev/null
+++ b/helpcontent2/source/text/sbasic/guide/control_properties.xhp
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ -->
+
+<helpdocument version="1.0">
+<meta>
+<topic id="textsbasicguidecontrol_propertiesxml" indexer="include" status="PUBLISH">
+<title id="tit" xml-lang="en-US">Changing the Properties of Controls in the Dialog Editor</title>
+<filename>/text/sbasic/guide/control_properties.xhp</filename>
+</topic>
+<history>
+<created date="2003-10-31T00:00:00">Sun Microsystems, Inc.</created>
+</history>
+</meta>
+<body>
+<bookmark xml-lang="en-US" branch="index" id="bm_id3145786"><bookmark_value>properties; controls in dialog editor</bookmark_value>
+<bookmark_value>changing;control properties</bookmark_value>
+<bookmark_value>controls;changing properties</bookmark_value>
+<bookmark_value>dialog editor;changing control properties</bookmark_value>
+</bookmark>
+<paragraph role="heading" id="hd_id3145786" xml-lang="en-US" level="1"><variable id="control_properties"><link href="text/sbasic/guide/control_properties.xhp" name="Changing the Properties of Controls in the Dialog Editor">Changing the Properties of Controls in the Dialog Editor</link>
+</variable></paragraph>
+<paragraph role="paragraph" id="par_id3147317" xml-lang="en-US">You can set the properties of control that you add to a dialog. For example, you can change the color, name, and size of a button that you added. You can change most control properties when you create or edit a dialog. However, you can only change some properties at runtime.</paragraph>
+<paragraph role="paragraph" id="par_id3145749" xml-lang="en-US">To change the properties of a control in design mode, right-click the control, and then choose <emph>Properties</emph>.</paragraph>
+<section id="relatedtopics">
+<embed href="text/sbasic/guide/create_dialog.xhp#create_dialog"/>
+<embed href="text/sbasic/guide/insert_control.xhp#insert_control"/>
+<embed href="text/sbasic/guide/show_dialog.xhp#show_dialog"/>
+<embed href="text/sbasic/guide/sample_code.xhp#sample_code"/>
+</section>
+</body>
+</helpdocument>
diff --git a/helpcontent2/source/text/sbasic/guide/create_dialog.xhp b/helpcontent2/source/text/sbasic/guide/create_dialog.xhp
new file mode 100644
index 000000000..e948d4467
--- /dev/null
+++ b/helpcontent2/source/text/sbasic/guide/create_dialog.xhp
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ -->
+
+
+ <helpdocument version="1.0">
+<meta>
+<topic id="textsbasicguidecreate_dialogxml" indexer="include" status="PUBLISH">
+<title id="tit" xml-lang="en-US">Creating a Basic Dialog</title>
+<filename>/text/sbasic/guide/create_dialog.xhp</filename>
+</topic>
+</meta>
+<body>
+<bookmark xml-lang="en-US" branch="index" id="bm_id3149346"><bookmark_value>dialogs;creating Basic dialogs</bookmark_value>
+</bookmark><paragraph role="heading" id="hd_id3149346" xml-lang="en-US" level="1"><variable id="create_dialog"><link href="text/sbasic/guide/create_dialog.xhp" name="Creating a Basic Dialog">Creating a Basic Dialog</link>
+</variable></paragraph>
+<list type="ordered">
+<listitem>
+<paragraph role="listitem" id="par_id3163802" xml-lang="en-US">Choose <emph>Tools - Macros - Organize Dialogs</emph>, and then click <emph>New</emph>.</paragraph>
+</listitem>
+<listitem>
+<paragraph role="listitem" id="par_id3150447" xml-lang="en-US">Enter a name for the dialog and click <emph>OK</emph>. To rename the dialog later, right-click the name on the tab and choose <emph>Rename</emph>.<comment>UFI: issue #i51589#</comment></paragraph>
+</listitem>
+<listitem>
+<paragraph role="listitem" id="par_idN1065F" xml-lang="en-US">Click <emph>Edit</emph>. The Basic dialog editor opens and contains a blank dialog.</paragraph>
+</listitem>
+<listitem>
+<paragraph role="listitem" id="par_id3153726" xml-lang="en-US">If you do not see the <emph>Toolbox</emph> bar, click the arrow next to the <emph>Insert Controls </emph>icon to open the <emph>Toolbox</emph> bar.</paragraph>
+</listitem>
+<listitem>
+<paragraph role="listitem" id="par_id3148455" xml-lang="en-US">Click a tool and then drag in the dialog to create the control.</paragraph>
+</listitem>
+</list>
+<section id="relatedtopics">
+<embed href="text/sbasic/guide/control_properties.xhp#control_properties"/>
+<embed href="text/sbasic/guide/insert_control.xhp#insert_control"/>
+<embed href="text/sbasic/guide/translation.xhp#translation"/>
+<embed href="text/sbasic/guide/show_dialog.xhp#show_dialog"/>
+<embed href="text/sbasic/guide/sample_code.xhp#sample_code"/>
+</section>
+</body>
+</helpdocument>
diff --git a/helpcontent2/source/text/sbasic/guide/insert_control.xhp b/helpcontent2/source/text/sbasic/guide/insert_control.xhp
new file mode 100644
index 000000000..cbc6fdbdb
--- /dev/null
+++ b/helpcontent2/source/text/sbasic/guide/insert_control.xhp
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ -->
+
+<helpdocument version="1.0">
+<meta>
+<topic id="textsbasicguideinsert_controlxml" indexer="include" status="PUBLISH">
+<title id="tit" xml-lang="en-US">Creating Controls in the Dialog Editor</title>
+<filename>/text/sbasic/guide/insert_control.xhp</filename>
+</topic>
+<history>
+<created date="2003-10-31T00:00:00">Sun Microsystems, Inc.</created>
+</history>
+</meta>
+<body>
+<bookmark xml-lang="en-US" branch="index" id="bm_id3149182"><bookmark_value>controls; creating in the dialog editor</bookmark_value>
+<bookmark_value>dialog editor;creating controls</bookmark_value>
+</bookmark>
+<paragraph role="heading" id="hd_id3149182" xml-lang="en-US" level="1"><variable id="insert_control"><link href="text/sbasic/guide/insert_control.xhp" name="Creating Controls in the Dialog Editor">Creating Controls in the Dialog Editor</link>
+</variable></paragraph>
+<paragraph role="paragraph" id="par_id3146797" xml-lang="en-US">Use the tools on the <emph>Toolbox </emph>of the BASIC dialog editor to add controls to your dialog.</paragraph>
+<list type="ordered">
+<listitem>
+<paragraph role="listitem" id="par_id3150276" xml-lang="en-US">To open the <emph>Toolbox</emph>, click the arrow next to the <emph>Insert Controls</emph> icon on the <emph>Macro</emph> toolbar.</paragraph>
+</listitem>
+<listitem>
+<paragraph role="listitem" id="par_id3145068" xml-lang="en-US">Click a tool on the toolbar, for example, <emph>Button</emph>.</paragraph>
+</listitem>
+<listitem>
+<paragraph role="listitem" id="par_id3153360" xml-lang="en-US">On the dialog, drag the button to the size you want.</paragraph>
+</listitem>
+</list>
+<section id="relatedtopics">
+<embed href="text/sbasic/guide/control_properties.xhp#control_properties"/>
+<embed href="text/sbasic/guide/create_dialog.xhp#create_dialog"/>
+<embed href="text/sbasic/guide/show_dialog.xhp#show_dialog"/>
+<embed href="text/sbasic/guide/sample_code.xhp#sample_code"/>
+</section>
+</body>
+</helpdocument>
diff --git a/helpcontent2/source/text/sbasic/guide/read_write_values.xhp b/helpcontent2/source/text/sbasic/guide/read_write_values.xhp
new file mode 100644
index 000000000..b8dab321c
--- /dev/null
+++ b/helpcontent2/source/text/sbasic/guide/read_write_values.xhp
@@ -0,0 +1,196 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<helpdocument version="1.0">
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+-->
+
+<meta>
+ <topic id="SF_FormControl" indexer="include" status="PUBLISH">
+ <title id="tit" xml-lang="en-US">Reading and Writing values to Ranges</title>
+ <filename>/text/sbasic/guide/read_write_values.xhp</filename>
+ </topic>
+</meta>
+
+<body>
+ <bookmark localize="false" branch="index" id="bm_id41582391760114">
+ <bookmark_value>macros;read values from cells</bookmark_value>
+ <bookmark_value>macros;write values to cells</bookmark_value>
+ </bookmark>
+ <h1 id="hd_id461623364876507"><variable id="title"><link href="text/sbasic/guide/read_write_values.xhp" name="ReadWriteValues_h1">Reading and Writing values to Ranges</link></variable></h1>
+ <paragraph role="paragraph" id="par_id781633210592228">Macros in %PRODUCTNAME Calc often need to read and write values from/to sheets. This help page describes the various approaches to accessing sheets and ranges to read or write their values.</paragraph>
+ <note id="par_id191633214565965">All examples presented in this page can be implemented both in Basic and Python.</note>
+
+ <h2 id="hd_id331633213558740">Accessing a Single Cell</h2>
+ <paragraph role="paragraph" id="par_id731633213581386">The example below enters the numeric value 123 into cell "A1" of the current sheet.</paragraph>
+ <bascode>
+ <paragraph role="bascode" localize="false" id="bas_id1001633213643422">Dim oSheet as Object</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id871633213643663">Dim oCell as Object</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id591633213643809">oSheet = ThisComponent.CurrentController.getActiveSheet()</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id311633213803255">oCell = oSheet.getCellRangeByName("A1")</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id321633213808005">oCell.setValue(123)</paragraph>
+ </bascode>
+ <paragraph role="paragraph" id="par_id131633213887433">The same can be accomplished with Python:</paragraph>
+ <pycode>
+ <paragraph role="pycode" localize="false" id="pyc_id641633214066390">doc = XSCRIPTCONTEXT.getDocument()</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id201633214066644">sheet = doc.getCurrentController().getActiveSheet()</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id831633214066790">cell = sheet.getCellRangeByName("A1")</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id371633214066935">cell.setValue(123)</paragraph>
+ </pycode>
+ <paragraph role="paragraph" id="par_id861633214219511">Note that in the previous examples the cell is accessed using its range name "A1". It is also possible to access cells using indices as though the sheet were a matrix where columns and rows are indexed starting from zero.</paragraph>
+ <paragraph role="paragraph" id="par_id161633214461067">This can be done using the <literal>getCellByPosition(colIndex, rowIndex)</literal> method, that takes in a column and a row index. The example below in Basic changes the text value in cell "C1" (column 2, row 0).</paragraph>
+ <bascode>
+ <paragraph role="bascode" localize="false" id="bas_id111633214658017">oSheet = ThisComponent.CurrentController.getActiveSheet()</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id81633214658358">oCell = oSheet.getCellByPosition(2, 0)</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id121633214658518">oCell.setString("Hello")</paragraph>
+ </bascode>
+ <paragraph role="paragraph" id="par_id221633214713436">This example can also be implemented in Python as follows:</paragraph>
+ <pycode>
+ <paragraph role="pycode" localize="false" id="pyc_id501633214747969">doc = XSCRIPTCONTEXT.getDocument()</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id321633214748196">sheet = doc.getCurrentController().getActiveSheet()</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id581633214748362">cell = sheet.getCellByPosition(2, 0)</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id11633214748538">cell.setString("Hello")</paragraph>
+ </pycode>
+ <note id="par_id101633215142970">The main difference between Python and Basic scripts lies on how to get access to the sheet object by using the <literal>XSCRIPTCONTEXT</literal> context variable. After that, all methods and properties are identical in Basic and Python.</note>
+ <h2 id="hd_id411633215666257">Values, Strings and Formulas</h2>
+ <paragraph role="paragraph" id="par_id861633215682610">Calc cells can have three types of values: numeric, strings and formulas. Each type has its own set and get methods:</paragraph>
+ <table id="tab_id841633215791905">
+ <tablerow>
+ <tablecell>
+ <paragraph id="par_id191633215791905" role="tablehead">Type</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id381633215791905" localize="false" role="tablehead">Get Method</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id111633215791905" localize="false" role="tablehead">Set Method</paragraph>
+ </tablecell>
+ </tablerow>
+ <tablerow>
+ <tablecell>
+ <paragraph id="par_id181633215791905" role="tablecontent">Numeric</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id701633215791905" localize="false" role="tablecontent"><literal>getValue()</literal></paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id391633215791905" localize="false" role="tablecontent"><literal>setValue(newValue)</literal></paragraph>
+ </tablecell>
+ </tablerow>
+ <tablerow>
+ <tablecell>
+ <paragraph id="par_id961633215932180" role="tablecontent">Text</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id641633215941293" localize="false" role="tablecontent"><literal>getString()</literal></paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id731633215943212" localize="false" role="tablecontent"><literal>setString(newString)</literal></paragraph>
+ </tablecell>
+ </tablerow>
+ <tablerow>
+ <tablecell>
+ <paragraph id="par_id651633215984116" role="tablecontent">Formula</paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id151633215985290" localize="false" role="tablecontent"><literal>getFormula()</literal></paragraph>
+ </tablecell>
+ <tablecell>
+ <paragraph id="par_id661633215985584" localize="false" role="tablecontent"><literal>setFormula(newFormula)</literal></paragraph>
+ </tablecell>
+ </tablerow>
+ </table>
+ <note id="par_id21633215845395">Dates and currency values are considered as numeric values in Calc.</note>
+ <paragraph role="paragraph" id="par_id221633216111353">The following example enters numeric values into cells "A1" and "A2" and inserts a formula in cell "A3" that returns the multiplication of these values.</paragraph>
+ <bascode>
+ <paragraph role="bascode" localize="false" id="bas_id101633216444190">oSheet = ThisComponent.CurrentController.getActiveSheet()</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id71633216444993">oCell = oSheet.getCellRangeByName("A1")</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id551633216445179">oCell.setValue(10)</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id291633216445364">oCell = oSheet.getCellRangeByName("A2")</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id831633216445527">oCell.setValue(20)</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id351633216445704">oCell = oSheet.getCellRangeByName("A3")</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id371633216445928">oCell.setFormula("=A1*A2")</paragraph>
+ </bascode>
+ <h2 id="hd_id321633216630043">Accessing Ranges in Different Sheets</h2>
+ <paragraph role="paragraph" id="par_id371633216672570">The previous examples used only the active sheet to perform operations. It is possible to access cell ranges in different sheets by their indices or names.</paragraph>
+ <paragraph role="paragraph" id="par_id861633216843382">The example below enters a numeric value into cell "A1" of the sheet named "Sheet2".</paragraph>
+ <bascode>
+ <paragraph role="bascode" localize="false" id="bas_id451633216955038">oSheet = ThisComponent.Sheets.getByName("Sheet2")</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id291633216955305">oCell = oSheet.getCellRangeByName("A1")</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id971633216955455">oCell.setValue(123)</paragraph>
+ </bascode>
+ <paragraph role="paragraph" id="par_id611633217090743">This example can also be implemented in Python as follows:</paragraph>
+ <pycode>
+ <paragraph role="pycode" localize="false" id="pyc_id701633217100520">doc = XSCRIPTCONTEXT.getDocument()</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id821633217100824">sheet = doc.Sheets["Sheet2"]</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id941633217101010">cell = sheet.getCellRangeByName("A1")</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id551633217101223">cell.setValue(123)</paragraph>
+ </pycode>
+ <paragraph role="paragraph" id="par_id631633217279518">Sheets can also be accessed using zero-based indices indicating which sheet considering the order they appear in the Calc file.</paragraph>
+ <paragraph role="paragraph" id="par_id291633264880172">In Basic, instead of using the <literal>getByName</literal> method, use <literal>Sheets(sheetIndex)</literal> as shown next:</paragraph>
+ <bascode>
+ <paragraph role="bascode" localize="false" id="bas_id101633264967469">oSheet = ThisComponent.Sheets(0)</paragraph>
+ </bascode>
+ <paragraph role="paragraph" id="par_id891633265000047">This can be done in a similar fashion in Python:</paragraph>
+ <pycode>
+ <paragraph role="pycode" localize="false" id="pyc_id91633265043348">sheet = doc.Sheets[0]</paragraph>
+ </pycode>
+ <h2 id="hd_id451633265241066">Using the ScriptForge Library</h2>
+ <paragraph role="paragraph" id="par_id731633265268585">The Calc service of the ScriptForge library can be used to get and set cell values as follows:</paragraph>
+ <bascode>
+ <paragraph role="paragraph" id="par_id551633265526538">' Loads the ScriptForge library</paragraph>
+ <paragraph role="paragraph" localize="false" id="par_id841633265526803">GlobalScope.BasicLibraries.LoadLibrary("ScriptForge")</paragraph>
+ <paragraph role="paragraph" id="par_id581633265527001">' Gets access to the current Calc document</paragraph>
+ <paragraph role="paragraph" localize="false" id="par_id721633265527202">oDoc = CreateScriptService("Calc")</paragraph>
+ <paragraph role="paragraph" id="par_id751633265527427">' Sets the value of cells A1 and A2</paragraph>
+ <paragraph role="paragraph" localize="false" id="par_id261633265527616">oDoc.setValue("A1", "Hello")</paragraph>
+ <paragraph role="paragraph" localize="false" id="par_id511633265527793">oDoc.setValue("A2", 123)</paragraph>
+ </bascode>
+ <note id="par_id781633267324929">The <literal>setValue</literal> method can be used to set both numeric and text values. To set a cell formula, use the <literal>setFormula</literal> method.</note>
+ <paragraph role="paragraph" id="par_id251633265634883">With the Calc service, getting and setting cell values can be done with a single line of code. The example below gets the value from cell "A1" and shows it on a message box.</paragraph>
+ <bascode>
+ <paragraph role="bascode" localize="false" id="bas_id981633265860659">Dim val as Variant, oDoc as Object</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id321633265860947">oDoc = CreateScriptService("Calc")</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id961633265861153">val = oDoc.getValue("A1")</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id161633265861435">MsgBox val</paragraph>
+ </bascode>
+ <paragraph role="paragraph" id="par_id521633608223310">The ScriptForge library also makes it simpler to access ranges in different sheets, as demonstrated in the example below:</paragraph>
+ <bascode>
+ <paragraph role="bascode" localize="false" id="bas_id761633608365821">Dim val1, val2</paragraph>
+ <paragraph role="bascode" id="bas_id521633608366292">' Gets cell "A1" from the sheet named "Sheet1"</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id351633608366132">val1 = oDoc.getValue("Sheet1.A1")</paragraph>
+ <paragraph role="bascode" id="bas_id661633608366484">' Gets cell "B3" from the sheet named "Sheet2"</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id351633608366882">val2 = oDoc.getValue("Sheet2.B3")</paragraph>
+ <paragraph role="bascode" id="bas_id501633608516381">' Places the result into cell "A1" of sheet "Report"</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id391633608564643">Dim result : result = val1 * val2</paragraph>
+ <paragraph role="bascode" localize="false" id="bas_id171633608516608">oDoc.setValue("Report.A1", result)</paragraph>
+ </bascode>
+ <paragraph role="paragraph" id="par_id431633266057163">The examples above can also be implemented in Python as follows:</paragraph>
+ <pycode>
+ <paragraph role="pycode" localize="false" id="pyc_id421633266075692">from scriptforge import CreateScriptService</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id181633266076836">doc = CreateScriptService("Calc")</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id951633266077067">doc.setValue("A1", "Hello")</paragraph>
+ </pycode>
+ <pycode>
+ <paragraph role="pycode" localize="false" id="pyc_id181633266076867">doc = CreateScriptService("Calc")</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id631633266227188">bas = CreateScriptService("Basic")</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id471633266077260">val = doc.getValue("A1")</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id751633266077419">bas.MsgBox(val)</paragraph>
+ </pycode>
+ <pycode>
+ <paragraph role="pycode" localize="false" id="pyc_id51633608688348">first_val = doc.getValue("Sheet1.A1")</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id601633608688574">second_val = doc.getValue("Sheet2.B3")</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id801633608688713">result = first_val * second_val</paragraph>
+ <paragraph role="pycode" localize="false" id="pyc_id941633608688898">doc.setValue("Report.A1", result)</paragraph>
+ </pycode>
+ <section id="relatedtopics">
+ <embed href="text/sbasic/shared/03/lib_ScriptForge.xhp#ScriptForge_lib"/>
+ <embed href="text/sbasic/shared/03/sf_calc.xhp#CalcService"/>
+ <embed href="text/sbasic/python/python_programming.xhp#pythonprogrammingheading"/>
+ </section>
+ </body>
+</helpdocument>
diff --git a/helpcontent2/source/text/sbasic/guide/sample_code.xhp b/helpcontent2/source/text/sbasic/guide/sample_code.xhp
new file mode 100644
index 000000000..cdb79e383
--- /dev/null
+++ b/helpcontent2/source/text/sbasic/guide/sample_code.xhp
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ -->
+<helpdocument version="1.0">
+ <meta>
+ <topic id="textsbasicguidesample_codexml" indexer="include" status="PUBLISH">
+ <title id="tit" xml-lang="en-US">Programming Examples for Controls in the Dialog Editor</title>
+ <filename>/text/sbasic/guide/sample_code.xhp</filename>
+ </topic>
+ <history>
+ <created date="2003-10-31T00:00:00">Sun Microsystems, Inc.</created>
+ </history>
+ </meta>
+<body>
+ <bookmark xml-lang="en-US" branch="index" id="bm_id3155338"><bookmark_value>programming examples for controls</bookmark_value>
+ <bookmark_value>dialogs;loading (example)</bookmark_value>
+ <bookmark_value>dialogs;displaying (example)</bookmark_value>
+ <bookmark_value>controls;reading or editing properties (example)</bookmark_value>
+ <bookmark_value>list boxes;removing entries from (example)</bookmark_value>
+ <bookmark_value>list boxes;adding entries to (example)</bookmark_value>
+ <bookmark_value>examples; programming controls</bookmark_value>
+ <bookmark_value>dialog editor;programming examples for controls</bookmark_value>
+ <bookmark_value>Tools;LoadDialog</bookmark_value>
+</bookmark>
+<section id="samplecode">
+ <paragraph role="heading" id="hd_id3155338" xml-lang="en-US" level="1"><variable id="sample_code"><link href="text/sbasic/guide/sample_code.xhp" name="Programming Examples for Controls in the Dialog Editor">Programming Examples for Controls in the Dialog Editor</link>
+ </variable></paragraph>
+</section>
+<paragraph role="paragraph" id="par_id3153031" xml-lang="en-US">The following examples are for a new <link href="text/sbasic/guide/create_dialog.xhp" name="dialog">dialog</link> called "Dialog1". Use the tools on the <emph>Toolbox</emph> bar in the dialog editor to create the dialog and add the following controls: a <emph>Check Box</emph> called "CheckBox1", a <emph>Label Field</emph> called "Label1", a <emph>Button</emph> called "CommandButton1", and a <emph>List Box</emph> called "ListBox1".</paragraph>
+<paragraph role="warning" id="par_id3154141" xml-lang="en-US">Be consistent with uppercase and lowercase letter when you attach a control to an object variable.</paragraph>
+<paragraph role="heading" id="hd_id3154909" xml-lang="en-US" level="3">Global Function for Loading Dialogs</paragraph>
+<bascode>
+<paragraph role="bascode" id="par_id3153193" xml-lang="en-US" localize="false">Function LoadDialog(Libname as String, DialogName as String, Optional oLibContainer)</paragraph>
+<paragraph role="bascode" id="par_id3145787" xml-lang="en-US" localize="false">Dim oLib as Object ' com.sun.star.script.XLibraryContainer</paragraph>
+<paragraph role="bascode" id="par_id3148576" xml-lang="en-US" localize="false">Dim oLibDialog as Object</paragraph>
+<paragraph role="bascode" id="par_id3153726" xml-lang="en-US" localize="false">Dim oRuntimeDialog as Object</paragraph>
+<paragraph role="bascode" id="par_id3149261" xml-lang="en-US" localize="false"> If IsMissing(oLibContainer) Then</paragraph>
+<paragraph role="bascode" id="par_id3148646" xml-lang="en-US" localize="false"> oLibContainer = DialogLibraries</paragraph>
+<paragraph role="bascode" id="par_id3151115" xml-lang="en-US" localize="false"> End If</paragraph>
+<paragraph role="bascode" id="par_id3146986" xml-lang="en-US" localize="false"> oLibContainer.LoadLibrary(LibName)</paragraph>
+<paragraph role="bascode" id="par_id3145366" xml-lang="en-US" localize="false"> oLib = oLibContainer.GetByName(Libname)</paragraph>
+<paragraph role="bascode" id="par_id3145271" xml-lang="en-US" localize="false"> oLibDialog = oLib.GetByName(DialogName)</paragraph>
+<paragraph role="bascode" id="par_id3144764" xml-lang="en-US" localize="false"> oRuntimeDialog = CreateUnoDialog(oLibDialog)</paragraph>
+<paragraph role="bascode" id="par_id3153876" xml-lang="en-US" localize="false"> LoadDialog() = oRuntimeDialog</paragraph>
+<paragraph role="bascode" id="par_id3156286" xml-lang="en-US" localize="false">End Function</paragraph>
+</bascode>
+<paragraph role="paragraph" id="par_id3153032" xml-lang="en-US"><literal>LoadDialog</literal> function is stored in <literal>Tools.ModuleControls</literal> available from Application Macros and Dialogs.</paragraph>
+<paragraph role="heading" id="hd_id3149412" xml-lang="en-US" level="3">Displaying a Dialog</paragraph>
+<bascode>
+<paragraph role="bascode" id="par_id3145801" xml-lang="en-US">REM global definition of variables</paragraph>
+<paragraph role="bascode" id="par_id3150716" xml-lang="en-US" localize="false">Dim oDialog1 AS Object</paragraph>
+<paragraph role="bascode" id="par_id3154510" xml-lang="en-US" localize="false">Sub StartDialog1</paragraph>
+<paragraph role="bascode" id="par_id6715587" xml-lang="en-US" localize="false"> With GlobalScope.BasicLibraries</paragraph>
+<paragraph role="bascode" id="par_id3148575" xml-lang="en-US" localize="false"> If Not .IsLibraryLoaded("Tools") Then .LoadLibrary("Tools")</paragraph>
+<paragraph role="bascode" id="par_id5815587" xml-lang="en-US" localize="false"> End With</paragraph>
+<paragraph role="bascode" id="par_id3150327" xml-lang="en-US" localize="false"> oDialog1 = Tools.ModuleControls.LoadDialog("Standard", "Dialog1")</paragraph>
+<paragraph role="bascode" id="par_id3155767" xml-lang="en-US" localize="false"> oDialog1.Execute()</paragraph>
+<paragraph role="bascode" id="par_id3149019" xml-lang="en-US" localize="false">End Sub</paragraph>
+</bascode>
+<paragraph role="heading" id="hd_id3150042" xml-lang="en-US" level="3">Read or Edit Properties of Controls in the Program</paragraph>
+<bascode>
+<paragraph role="bascode" id="par_id3159267" xml-lang="en-US" localize="false">Sub Sample1</paragraph>
+<paragraph role="bascode" id="par_id6715588" xml-lang="en-US" localize="false"> With GlobalScope.Basiclibraries</paragraph>
+<paragraph role="bascode" id="par_id3148576" xml-lang="en-US" localize="false"> If Not .IsLibraryLoaded("Tools") Then .LoadLibrary("Tools")</paragraph>
+<paragraph role="bascode" id="par_id5815588" xml-lang="en-US" localize="false"> End With</paragraph>
+<paragraph role="bascode" id="par_id3163808" xml-lang="en-US" localize="false"> oDialog1 = Tools.LoadDialog("Standard", "Dialog1")</paragraph>
+<paragraph role="bascode" id="par_id3145232" xml-lang="en-US"> REM get dialog model</paragraph>
+<paragraph role="bascode" id="par_id3146316" xml-lang="en-US" localize="false"> oDialog1Model = oDialog1.Model</paragraph>
+<paragraph role="bascode" id="par_id3154021" xml-lang="en-US"> REM display text of Label1</paragraph>
+<paragraph role="bascode" id="par_id3150301" xml-lang="en-US" localize="false"> oLabel1 = oDialog1.GetControl("Label1")</paragraph>
+<paragraph role="bascode" id="par_id3152584" xml-lang="en-US" localize="false"> MsgBox oLabel1.Text</paragraph>
+<paragraph role="bascode" id="par_id3151277" xml-lang="en-US"> REM set new text for control Label1</paragraph>
+<paragraph role="bascode" id="par_id3154119" xml-lang="en-US"> oLabel1.Text = "New Files"</paragraph>
+<paragraph role="bascode" id="par_id3155115" xml-lang="en-US"> REM display model properties for the control CheckBox1</paragraph>
+<paragraph role="bascode" id="par_id3166426" xml-lang="en-US" localize="false"> oCheckBox1Model = oDialog1Model.CheckBox1</paragraph>
+<paragraph role="bascode" id="par_id3153270" xml-lang="en-US" localize="false"> MsgBox oCheckBox1Model.Dbg_Properties</paragraph>
+<paragraph role="bascode" id="par_id3149817" xml-lang="en-US"> REM set new state for CheckBox1 for model of control</paragraph>
+<paragraph role="bascode" id="par_id3145134" xml-lang="en-US" localize="false"> oCheckBox1Model.State = 1</paragraph>
+<paragraph role="bascode" id="par_id3159102" xml-lang="en-US"> REM display model properties for control CommandButton1</paragraph>
+<paragraph role="bascode" id="par_id3152777" xml-lang="en-US" localize="false"> oCMD1Model = oDialog1Model.CommandButton1</paragraph>
+<paragraph role="bascode" id="par_id3149209" xml-lang="en-US" localize="false"> MsgBox oCMD1Model.Dbg_Properties</paragraph>
+<paragraph role="bascode" id="par_id3150368" xml-lang="en-US"> REM display properties of control CommandButton1</paragraph>
+<paragraph role="bascode" id="par_id3150883" xml-lang="en-US" localize="false"> oCMD1 = oDialog1.GetControl("CommandButton1")</paragraph>
+<paragraph role="bascode" id="par_id3155380" xml-lang="en-US" localize="false"> MsgBox oCMD1.Dbg_Properties</paragraph>
+<paragraph role="bascode" id="par_id3150201" xml-lang="en-US"> REM execute dialog</paragraph>
+<paragraph role="bascode" id="par_id3154485" xml-lang="en-US" localize="false"> oDialog1.Execute()</paragraph>
+<paragraph role="bascode" id="par_id3146115" xml-lang="en-US" localize="false">End Sub</paragraph>
+</bascode>
+<paragraph role="heading" id="hd_id3145387" xml-lang="en-US" level="3">Add an Entry to a ListBox</paragraph>
+<bascode>
+<paragraph role="bascode" id="par_id3155088" xml-lang="en-US" localize="false">Sub AddEntry</paragraph>
+<paragraph role="bascode" id="par_id6715589" xml-lang="en-US" localize="false"> With GlobalScope.Basiclibraries</paragraph>
+<paragraph role="bascode" id="par_id3148577" xml-lang="en-US" localize="false"> If Not .IsLibraryLoaded("Tools") Then .LoadLibrary("Tools")</paragraph>
+<paragraph role="bascode" id="par_id5815589" xml-lang="en-US" localize="false"> End With</paragraph>
+<paragraph role="bascode" id="par_id3159222" xml-lang="en-US" localize="false"> oDialog1 = ModuleControls.LoadDialog("Standard", "Dialog1")</paragraph>
+<paragraph role="bascode" id="par_id3148700" xml-lang="en-US"> REM adds a new entry to the ListBox</paragraph>
+<paragraph role="bascode" id="par_id3159173" xml-lang="en-US" localize="false"> oDialog1Model = oDialog1.Model</paragraph>
+<paragraph role="bascode" id="par_id3153305" xml-lang="en-US" localize="false"> oListBox = oDialog1.GetControl("ListBox1")</paragraph>
+<paragraph role="bascode" id="par_id3153914" xml-lang="en-US" localize="false"> Dim iCount as integer</paragraph>
+<paragraph role="bascode" id="par_id3151243" xml-lang="en-US" localize="false"> iCount = oListbox.ItemCount</paragraph>
+<paragraph role="bascode" id="par_id3144504" xml-lang="en-US"> oListbox.additem("New Item" &amp; iCount,0)</paragraph>
+<paragraph role="bascode" id="par_id3149328" xml-lang="en-US" localize="false">End Sub</paragraph>
+</bascode>
+<paragraph role="heading" id="hd_id3147071" xml-lang="en-US" level="3">Remove an Entry from a ListBox</paragraph>
+<bascode>
+<paragraph role="bascode" id="par_id3159095" xml-lang="en-US" localize="false">Sub RemoveEntry</paragraph>
+<paragraph role="bascode" id="par_id6715590" xml-lang="en-US" localize="false"> With GlobalScope.Basiclibraries</paragraph>
+<paragraph role="bascode" id="par_id3148578" xml-lang="en-US" localize="false"> If Not .IsLibraryLoaded("Tools") Then .LoadLibrary("Tools")</paragraph>
+<paragraph role="bascode" id="par_id5815590" xml-lang="en-US" localize="false"> End With</paragraph>
+<paragraph role="bascode" id="par_id3149443" xml-lang="en-US" localize="false"> oDialog1 = Tools.ModuleControls.LoadDialogLoadDialog("Standard", "Dialog1")</paragraph>
+<paragraph role="bascode" id="par_id3153247" xml-lang="en-US"> REM remove the first entry from the ListBox</paragraph>
+<paragraph role="bascode" id="par_id3151302" xml-lang="en-US" localize="false"> oDialog1Model = oDialog1.Model</paragraph>
+<paragraph role="bascode" id="par_id3153976" xml-lang="en-US" localize="false"> oListBox = oDialog1.GetControl("ListBox1")</paragraph>
+<paragraph role="bascode" id="par_id3155383" xml-lang="en-US" localize="false"> oListbox.removeitems(0,1)</paragraph>
+<paragraph role="bascode" id="par_id3150892" xml-lang="en-US" localize="false">End Sub</paragraph>
+</bascode>
+<section id="relatedtopics">
+<embed href="text/sbasic/guide/control_properties.xhp#control_properties"/>
+<embed href="text/sbasic/guide/create_dialog.xhp#create_dialog"/>
+<embed href="text/sbasic/guide/insert_control.xhp#insert_control"/>
+<embed href="text/sbasic/guide/show_dialog.xhp#show_dialog"/>
+</section>
+</body>
+</helpdocument>
diff --git a/helpcontent2/source/text/sbasic/guide/show_dialog.xhp b/helpcontent2/source/text/sbasic/guide/show_dialog.xhp
new file mode 100644
index 000000000..117ff796c
--- /dev/null
+++ b/helpcontent2/source/text/sbasic/guide/show_dialog.xhp
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ -->
+<helpdocument version="1.0">
+<meta>
+<topic id="textsbasicguideshow_dialogxml" indexer="include" status="PUBLISH">
+<title id="tit" xml-lang="en-US">Opening a Dialog With Basic</title>
+<filename>/text/sbasic/guide/show_dialog.xhp</filename>
+</topic>
+</meta>
+<body>
+<bookmark xml-lang="en-US" branch="index" id="bm_id3154140">
+ <bookmark_value>module/dialog toggle</bookmark_value>
+ <bookmark_value>dialogs;using Basic to show (example)</bookmark_value>
+ <bookmark_value>examples; showing a dialog with Basic</bookmark_value>
+ <bookmark_value>Tools;LoadDialog</bookmark_value>
+</bookmark>
+<paragraph role="heading" id="hd_id3154140" xml-lang="en-US" level="1"><variable id="show_dialog"><link href="text/sbasic/guide/show_dialog.xhp" name="Opening a Dialog With Basic">Opening a Dialog With Basic</link>
+</variable></paragraph>
+<paragraph role="paragraph" id="par_id3145171" xml-lang="en-US">In the <item type="productname">%PRODUCTNAME</item> BASIC window for a dialog that you created, leave the dialog editor by clicking the name tab of the Module that the dialog is assigned to. The name tab is at the bottom of the window.</paragraph>
+<paragraph role="paragraph" id="par_id3153968" xml-lang="en-US">Enter the following code for a subroutine called <emph>Dialog1Show</emph>. In this example, the name of the dialog that you created is "Dialog1":</paragraph>
+<bascode>
+<paragraph role="bascode" id="par_id3156443" xml-lang="en-US" localize="false">Sub Dialog1Show</paragraph>
+<paragraph role="bascode" id="par_id6715587" xml-lang="en-US" localize="false"> With GlobalScope.BasicLibraries</paragraph>
+<paragraph role="bascode" id="par_id3148575" xml-lang="en-US" localize="false"> If Not .IsLibraryLoaded("Tools") Then .LoadLibrary("Tools")</paragraph>
+<paragraph role="bascode" id="par_id5815587" xml-lang="en-US" localize="false"> End With</paragraph>
+<paragraph role="bascode" id="par_id3152463" xml-lang="en-US" localize="false"> oDialog1 = Tools.ModuleControls.LoadDialog("Standard", "Dialog1")</paragraph>
+<paragraph role="bascode" id="par_id3148646" xml-lang="en-US" localize="false"> oDialog1.Execute()</paragraph>
+<paragraph role="bascode" id="par_id3147349" xml-lang="en-US" localize="false">End Sub</paragraph>
+</bascode>
+<paragraph role="paragraph" id="par_id3152596" xml-lang="en-US">Without using "LoadDialog" you can call the code as follows:</paragraph>
+<bascode>
+<paragraph role="bascode" id="par_id3163710" xml-lang="en-US" localize="false">Sub Dialog1Show</paragraph>
+<paragraph role="bascode" id="par_id3146985" xml-lang="en-US" localize="false"> DialogLibraries.LoadLibrary("Standard")</paragraph>
+<paragraph role="bascode" id="par_id3155418" xml-lang="en-US" localize="false"> oDialog1 = CreateUnoDialog( DialogLibraries.Standard.Dialog1 )</paragraph>
+<paragraph role="bascode" id="par_id3154944" xml-lang="en-US" localize="false"> oDialog1.Execute()</paragraph>
+<paragraph role="bascode" id="par_id3145800" xml-lang="en-US" localize="false">End Sub</paragraph>
+</bascode>
+<paragraph role="paragraph" id="par_id3153157" xml-lang="en-US">When you execute this code, "Dialog1" opens. To close the dialog, click the close button (x) on its title bar.</paragraph>
+<section id="relatedtopics">
+<embed href="text/sbasic/guide/control_properties.xhp#control_properties"/>
+<embed href="text/sbasic/guide/create_dialog.xhp#create_dialog"/>
+<embed href="text/sbasic/guide/insert_control.xhp#insert_control"/>
+<embed href="text/sbasic/python/python_dialogs.xhp#pythondialog"/>
+<embed href="text/sbasic/guide/sample_code.xhp#sample_code"/>
+</section>
+</body>
+</helpdocument>
diff --git a/helpcontent2/source/text/sbasic/guide/translation.xhp b/helpcontent2/source/text/sbasic/guide/translation.xhp
new file mode 100644
index 000000000..38608ddea
--- /dev/null
+++ b/helpcontent2/source/text/sbasic/guide/translation.xhp
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ -->
+
+
+ <helpdocument version="1.0">
+<meta>
+<topic id="textsbasicguidetranslationxml" indexer="include" status="PUBLISH">
+<title id="tit" xml-lang="en-US">Translation of Controls in the Dialog Editor</title>
+<filename>/text/sbasic/guide/translation.xhp</filename>
+</topic>
+</meta>
+<body>
+<bookmark xml-lang="en-US" branch="index" id="bm_id8915372"><bookmark_value>dialogs;translating</bookmark_value>
+<bookmark_value>localizing dialogs</bookmark_value>
+<bookmark_value>translating dialogs</bookmark_value>
+</bookmark>
+<paragraph role="heading" id="hd_id3574896" xml-lang="en-US" level="1"><variable id="translation"><link href="text/sbasic/guide/translation.xhp">Translation of Controls in the Dialog Editor</link>
+</variable></paragraph>
+<paragraph role="paragraph" id="par_id4601940" xml-lang="en-US">The Language toolbar in the Basic IDE dialog editor shows controls to enable and manage localizable dialogs.</paragraph>
+<paragraph role="paragraph" id="par_id9538560" xml-lang="en-US">By default, any dialog that you create only contains string resources for one language. You may want to create dialogs that automatically show localized strings according to the user's language settings.</paragraph>
+<bookmark xml-lang="en-US" branch="hid/.uno:CurrentLanguage" id="bm_id9421979" localize="false"/><paragraph role="paragraph" id="par_id6998809" xml-lang="en-US"><ahelp hid="." visibility="hidden">Select the language for the strings that you want to edit. Click the Manage Languages icon to add languages.</ahelp></paragraph><comment>Manage Language icon is in sbasic/shared/02/20000000.xhp</comment>
+<bookmark xml-lang="en-US" branch="hid/modules/BasicIDE/ui/managelanguages/ManageLanguagesDialog" id="bm_id1646778" localize="false"/>
+<bookmark xml-lang="en-US" branch="hid/modules/BasicIDE/ui/managelanguages/@@nowidget@@" id="bm_id1646778" localize="false"/>
+<bookmark xml-lang="en-US" branch="hid/modules/BasicIDE/ui/managelanguages/treeview" id="bm_id16467781" localize="false"/><paragraph role="paragraph" id="par_id71413" xml-lang="en-US"><ahelp hid="." visibility="hidden">Click a language, then click Default to set the language as default, or click Delete to remove the language from the list.</ahelp></paragraph>
+<bookmark xml-lang="en-US" branch="hid/modules/BasicIDE/ui/managelanguages/add" id="bm_id1228370" localize="false"/><paragraph role="paragraph" id="par_id2924283" xml-lang="en-US"><ahelp hid="." visibility="hidden">Opens a dialog where you can add a language to the list.</ahelp></paragraph>
+<bookmark xml-lang="en-US" branch="hid/modules/BasicIDE/ui/managelanguages/delete" id="bm_id1601611" localize="false"/><paragraph role="paragraph" id="par_id5781731" xml-lang="en-US"><ahelp hid="." visibility="hidden">Select a language in the list and click Delete to remove that language. When you remove all languages, the string resources for localizable dialogs are removed from all dialogs in the current library.</ahelp></paragraph>
+<bookmark xml-lang="en-US" branch="hid/modules/BasicIDE/ui/managelanguages/default" id="bm_id733359" localize="false"/><paragraph role="paragraph" id="par_id6942045" xml-lang="en-US"><ahelp hid="." visibility="hidden">Select a language in the list and click Default to set the language as default language.</ahelp></paragraph>
+<bookmark xml-lang="en-US" branch="hid/modules/BasicIDE/ui/defaultlanguage/DefaultLanguageDialog" id="bm_id879849" localize="false"/>
+<bookmark xml-lang="en-US" branch="hid/modules/BasicIDE/ui/defaultlanguage/@@nowidget@@" id="bm_id879849" localize="false"/>
+<bookmark xml-lang="en-US" branch="hid/modules/BasicIDE/ui/defaultlanguage/entries" id="bm_id879848" localize="false"/><paragraph role="paragraph" id="par_id4721823" xml-lang="en-US"><ahelp hid="." visibility="hidden">The default language will be used as a source for all other language strings.</ahelp></paragraph>
+<bookmark xml-lang="en-US" branch="hid/modules/BasicIDE/ui/defaultlanguage/checkedentries" id="bm_id8675191" localize="false"/><paragraph role="paragraph" id="par_id5806756" xml-lang="en-US"><ahelp hid="." visibility="hidden">Add UI languages for your dialog strings.</ahelp></paragraph>
+<paragraph role="heading" id="hd_id6596881" xml-lang="en-US" level="2">To enable localizable dialogs</paragraph>
+<list type="ordered">
+<listitem>
+<paragraph role="paragraph" id="par_id8750572" xml-lang="en-US">In the Basic IDE dialog editor, open the Language toolbar choosing <item type="menuitem">View - Toolbars - Language</item>. </paragraph>
+<paragraph role="paragraph" id="par_id2224494" xml-lang="en-US">If the current library already contains a localizable dialog, the Language toolbar is shown automatically.</paragraph>
+</listitem>
+<listitem>
+<paragraph role="paragraph" id="par_id7359233" xml-lang="en-US">Click the <emph>Manage Languages</emph> icon
+<image id="img_id2526017" src="cmd/sc_managelanguage.png" width="0.1665inch" height="0.1665inch"><alt id="alt_id2526017" xml-lang="en-US">Manage Language icon</alt>
+ </image> on the Language toolbar or on the Toolbox bar.</paragraph>
+<paragraph role="paragraph" id="par_id6549272" xml-lang="en-US">You see the Manage User Interface Language dialog. The dialog manages languages for the current library. The name of the current library is shown on the title bar.</paragraph>
+</listitem>
+<listitem>
+<paragraph role="paragraph" id="par_id6529740" xml-lang="en-US">Click Add in the dialog to add a language entry. </paragraph>
+<paragraph role="paragraph" id="par_id7811822" xml-lang="en-US">This step enables all new dialogs to contain localizable string resources.</paragraph>
+</listitem>
+<listitem>
+<paragraph role="paragraph" id="par_id9121982" xml-lang="en-US">The first time you click Add, you see the Set Default User Interface Language dialog. The following times you click Add, this dialog has the name Add User Interface Language.</paragraph>
+<paragraph role="paragraph" id="par_id3640247" xml-lang="en-US">You can also change the default language in the Manage User Interface Language dialog.</paragraph>
+</listitem>
+<listitem>
+<paragraph role="paragraph" id="par_id3808404" xml-lang="en-US">Select a language. </paragraph>
+<paragraph role="paragraph" id="par_id4585100" xml-lang="en-US">This adds string resources to contain the translated versions of all strings to the dialog properties. The set of dialog strings of the default language is copied to the new set of strings. Later, you can switch to the new language and then translate the strings.</paragraph>
+</listitem>
+<listitem>
+<paragraph role="paragraph" id="par_id2394482" xml-lang="en-US">Close the dialog or add additional languages.</paragraph>
+</listitem>
+</list>
+<paragraph role="heading" id="hd_id631733" xml-lang="en-US" level="2">To edit localizable controls in your dialog</paragraph>
+<paragraph role="paragraph" id="par_id2334665" xml-lang="en-US">Once you have added the resources for localizable strings in your dialogs, you can select the current language from the Current Language listbox on the Language toolbar.</paragraph>
+<list type="ordered">
+<listitem>
+<paragraph role="paragraph" id="par_id8956572" xml-lang="en-US">Switch the Current Language listbox to display the default language.</paragraph>
+</listitem>
+<listitem>
+<paragraph role="paragraph" id="par_id500808" xml-lang="en-US">Insert any number of controls to your dialog and enter all strings you want.</paragraph>
+</listitem>
+<listitem>
+<paragraph role="paragraph" id="par_id8366649" xml-lang="en-US">Select another language in the Current Language listbox.</paragraph>
+</listitem>
+<listitem>
+<paragraph role="paragraph" id="par_id476393" xml-lang="en-US">Using the control's property dialogs, edit all strings to the other language.</paragraph>
+</listitem>
+<listitem>
+<paragraph role="paragraph" id="par_id2655720" xml-lang="en-US">Repeat for all languages that you added.</paragraph>
+</listitem>
+</list>
+<paragraph role="paragraph" id="par_id3682058" xml-lang="en-US">The user of your dialog will see the strings of the user interface language of the user's version of %PRODUCTNAME, if you did provide strings in that language. </paragraph>
+<paragraph role="paragraph" id="par_id5977965" xml-lang="en-US">If no language matches the user's version, the user will see the default language strings. </paragraph>
+<paragraph role="paragraph" id="par_id3050325" xml-lang="en-US">If the user has an older version of %PRODUCTNAME that does not know localizable string resources for Basic dialogs, the user will see the default language strings.</paragraph>
+<section id="relatedtopics">
+<embed href="text/sbasic/guide/create_dialog.xhp#create_dialog"/>
+<embed href="text/sbasic/guide/insert_control.xhp#insert_control"/>
+<embed href="text/sbasic/guide/show_dialog.xhp#show_dialog"/>
+<embed href="text/sbasic/guide/sample_code.xhp#sample_code"/>
+</section>
+</body>
+</helpdocument>