1
0
Fork 0
libreoffice/helpcontent2/source/text/sbasic/shared/03/sf_dialogcontrol.xhp
Daniel Baumann 8e63e14cf6
Adding upstream version 4:25.2.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-22 16:20:04 +02:00

1353 lines
88 KiB
XML

<?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_DialogControl" indexer="include" status="PUBLISH">
<title id="tit" xml-lang="en-US">SFDialogs.DialogControl service</title>
<filename>/text/sbasic/shared/03/sf_dialogcontrol.xhp</filename>
</topic>
</meta>
<body>
<section id="abstract">
<bookmark localize="false" branch="index" id="bm_id41582391760252">
<bookmark_value>DialogControl service</bookmark_value>
</bookmark>
<h1 id="bm_id781582391760253" xml-lang="en-US"><variable id="ctrls_h1"><link href="text/sbasic/shared/03/sf_dialogcontrol.xhp"><literal>SFDialogs</literal>.<literal>DialogControl</literal> service</link></variable></h1>
<paragraph role="paragraph" id="par_id931583589764919" xml-lang="en-US">The <literal>DialogControl</literal> service manages the controls belonging to a dialog defined with the Basic <link href="text/sbasic/guide/create_dialog.xhp">Dialog Editor</link>. Each instance of the current service represents a single control within a dialog box.</paragraph>
<bookmark xml-lang="en-US" branch="index" id="bm_id331612167249331" localize="false">
<bookmark_value>API;awt.XControl</bookmark_value>
<bookmark_value>API;awt.XControlModel</bookmark_value>
</bookmark>
<paragraph role="paragraph" id="par_id701598191157426" xml-lang="en-US">The focus is set on getting and setting the values displayed by the controls of the dialog box. Formatting is accessible via the <literal>XControlModel</literal> and <literal>XControlView</literal> properties.</paragraph>
<paragraph role="paragraph" id="par_id981598191184526" xml-lang="en-US">Note that the unique <literal>DialogControl.Value</literal> property content varies according to the control type.</paragraph>
<paragraph role="paragraph" id="par_id991612698027551" xml-lang="en-US">A special attention is given to controls of type tree control. It is easy to populate a tree, either branch by branch, or with a set of branches at once. Populating a tree control can be performed statically or dynamically.</paragraph>
</section>
<tip id="par_id891598188164936" xml-lang="en-US">The <literal>SFDialogs.DialogControl</literal> service is closely related to the <link href="text/sbasic/shared/03/sf_dialog.xhp"><literal>SFDialogs.Dialog</literal></link> service.</tip>
<h2 id="hd_id581582885621841" xml-lang="en-US">Service invocation</h2>
<paragraph role="paragraph" id="par_id141609955500101">Before using the <literal>DialogControl</literal> service the <literal>ScriptForge</literal> library needs to be loaded or imported:</paragraph>
<embed href="text/sbasic/shared/03/lib_ScriptForge.xhp#importLibs"/>
<paragraph role="paragraph" id="par_id361598174756160" xml-lang="en-US">The <literal>DialogControl</literal> service is invoked from an existing <literal>Dialog</literal> service instance through its <literal>Controls()</literal> method. The dialog must be initiated with the <literal>SFDialogs.Dialog</literal> service.</paragraph>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id791598453192421">Dim myDialog As Object, myControl As Object</paragraph>
<paragraph role="bascode" localize="false" id="bas_id251598453197473">Set myDialog = CreateScriptService("SFDialogs.Dialog", "GlobalScope", myLibrary, DialogName)</paragraph>
<paragraph role="bascode" localize="false" id="bas_id421598453203458">Set myControl = myDialog.Controls("myTextBox")</paragraph>
<paragraph role="bascode" xml-lang="en-US" id="bas_id581598453210170">myControl.Value = "Dialog started at " &amp; Now()</paragraph>
<paragraph role="bascode" localize="false" id="bas_id11598453215943">myDialog.Execute()</paragraph>
<paragraph role="bascode" xml-lang="en-US" id="bas_id961598453222539">' ... process the controls actual values</paragraph>
<paragraph role="bascode" localize="false" id="bas_id981598453230245">myDialog.Terminate()</paragraph>
</bascode>
<pycode>
<paragraph role="pycode" localize="false" id="pyc_id481026225234594">from time import localtime, strftime</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id481620225234594">dlg = CreateScriptService('SFDialogs.Dialog', 'GlobalScope', lib_name, dlg_name)</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id811620225234785">text = dlg.Controls('myTextBox')</paragraph>
<paragraph role="pycode" xml-lang="en-US" id="pyc_id861620225235002">text.Value = "Dialog started at " + strftime("%a, %d %b %Y %H:%M:%S", localtime())</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id361620225235185">dlg.Execute()</paragraph>
<paragraph role="pycode" xml-lang="en-US" id="pyc_id841620225235377"># ... process the controls actual values</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id411620225235569">dlg.Terminate()</paragraph>
</pycode>
<h2 id="hd_id141670854511382">Retrieving the DialogControl instance that triggered a control event</h2>
<paragraph role="paragraph" id="par_id951598174966322" xml-lang="en-US">An instance of the <literal>DialogControl</literal> service can be retrieved via the <literal>SFDialogs.DialogEvent</literal> service, provided that the dialog was initiated with the <literal>Dialog</literal> service. In the example below, <literal>oControl</literal> contains the <literal>DialogControl</literal> instance that triggered the control event.</paragraph>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id311598175259794">Sub aControlEventHandler(ByRef poEvent As Object)</paragraph>
<paragraph role="bascode" localize="false" id="bas_id781598175253859"> Dim oControl As Object</paragraph>
<paragraph role="bascode" localize="false" id="bas_id921598175248581"> Set oControl = CreateScriptService("SFDialogs.DialogEvent", poEvent)</paragraph>
<paragraph role="bascode" localize="false" id="bas_id711598175146308"> ' ...</paragraph>
<paragraph role="bascode" localize="false" id="bas_id421598175139021">End Sub</paragraph>
</bascode>
<paragraph role="paragraph" id="par_id741619625211462">Or using Python:</paragraph>
<pycode>
<paragraph role="pycode" localize="false" id="pyc_id921620228762243">def control_event_handler(event: uno):</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id181620228763531"> oControl = CreateScriptService('SFDialogs.DialogEvent', event)</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id731620228763715"> # ...</paragraph>
</pycode>
<paragraph role="paragraph" id="par_id251598176312571" xml-lang="en-US">Note that in the previous examples, the prefix <literal>"SFDialogs."</literal> may be omitted when deemed appropriate.</paragraph>
<h2 id="hd_id681670854491710">Handling exceptions in event handlers</h2>
<paragraph role="paragraph" id="par_id971670855125683">When creating an event handler for control events it is good practice to handle errors inside the subroutine itself. For instance, suppose the event handler below is called when button is clicked.</paragraph>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id841670857159416">Sub OnButtonClicked(ByRef oEvent As Object)</paragraph>
<paragraph role="bascode" localize="false" id="bas_id401670857159673">On Local Error GoTo Catch</paragraph>
<paragraph role="bascode" localize="false" id="bas_id941670857159896"> Dim oControl As Object</paragraph>
<paragraph role="bascode" localize="false" id="bas_id311670857160096"> oControl = CreateScriptService("DialogEvent", oEvent)</paragraph>
<paragraph role="bascode" id="bas_id261670857160312"> ' Process the event</paragraph>
<paragraph role="bascode" localize="false" id="bas_id521670857237087"> Exit Sub</paragraph>
<paragraph role="bascode" localize="false" id="bas_id211670857160512">Catch:</paragraph>
<paragraph role="bascode" localize="false" id="bas_id716708571060704"> MsgBox SF_Exception.Description</paragraph>
<paragraph role="bascode" localize="false" id="bas_id361670857160919"> SF_Exception.Clear</paragraph>
<paragraph role="bascode" localize="false" id="bas_id371670857161112">End Sub</paragraph>
</bascode>
<tip id="par_id691670857377446">Call <literal>SF_Exception.Clear</literal> if you do not want the error to propagate after the dialog execution ended.</tip>
<paragraph role="paragraph" id="par_id741619625211445">In Python use native <literal>try/except</literal> blocks for exception handling as shown below:</paragraph>
<pycode>
<paragraph role="pycode" localize="false" id="pyc_id111670866555779">def on_button_clicked(event=None):</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id871670866556117"> try:</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id721670866556311"> oControl = CreateScriptService("DialogEvent", event)</paragraph>
<paragraph role="pycode" id="pyc_id491670866556493"> # Process the event</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id521670866556680"> except Exception as e:</paragraph>
<paragraph role="pycode" id="pyc_id416708660557072"> # The object "bas" below is an instance of the Basic service</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id491670866556877"> bas.MsgBox(str(e))</paragraph>
</pycode>
<h2 id="hd_id71598455687512" xml-lang="en-US">Control types</h2>
<paragraph role="paragraph" id="par_id851598455863395" xml-lang="en-US">The <literal>DialogControl</literal> service is available for these control types:</paragraph>
<table id="tab_ControlTypes">
<tablerow>
<tablecell>
<paragraph id="par_id891687788755743" role="tablecontent" localize="false">&#8226; Button<br/>&#8226; CheckBox<br/>&#8226; ComboBox<br/>&#8226; CurrencyField<br/>&#8226; DateField<br/>&#8226; FileControl</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id461687788755743" role="tablecontent" localize="false">&#8226; FixedLine<br/>&#8226; FixedText<br/>&#8226; FormattedField<br/>&#8226; GroupBox<br/>&#8226; Hyperlink<br/>&#8226; ImageControl</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id641687788755743" role="tablecontent" localize="false">&#8226; ListBox<br/>&#8226; NumericField<br/>&#8226; PatternField<br/>&#8226; ProgressBar<br/>&#8226; RadioButton<br/>&#8226; ScrollBar</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id271687789435391" role="tablecontent" localize="false">&#8226; TableControl<br/>&#8226; TextField<br/>&#8226; TimeField<br/>&#8226; TreeControl<br/> <br/> </paragraph>
</tablecell>
</tablerow>
</table>
<h2 id="hd_id651583668365757" xml-lang="en-US">Properties</h2>
<section id="properties_toc">
<table id="tab_id381583668386455">
<tablerow>
<tablecell>
<paragraph id="par_id871583668386455" role="tablehead" xml-lang="en-US">Name</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id491583668386455" role="tablehead" xml-lang="en-US">ReadOnly</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id271583668474014" role="tablehead" xml-lang="en-US">Type</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id291598538799794" role="tablehead" xml-lang="en-US">Applicable to</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id401583668386455" role="tablehead" xml-lang="en-US">Description</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id151594768386455" role="tablecontent" localize="false">Border</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id372693668519172" role="tablecontent" xml-lang="en-US">Yes</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id271583679486455" role="tablecontent" localize="false">String</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id231589538847029" role="tablecontent" localize="false" xml-lang="en-US">Button, …</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id771583778386455" role="tablecontent" xml-lang="en-US">The <literal>Border</literal> property refers to the surrounding of the control: "3D", "FLAT" or "NONE".</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id151583668386455" role="tablecontent" localize="false">Cancel</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id371583668519172" role="tablecontent" xml-lang="en-US">No</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id271583668386455" role="tablecontent" localize="false">Boolean</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id231598538847029" role="tablecontent" localize="false" xml-lang="en-US">Button</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id771583668386455" role="tablecontent" xml-lang="en-US">Specifies if a command button has or not the behaviour of a Cancel button.</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id951583839708571" role="tablecontent" localize="false">Caption</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id541583839708548" role="tablecontent" xml-lang="en-US">No</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id751583839708362" role="tablecontent" localize="false">String</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id351598538934413" role="tablecontent" localize="false">Button, CheckBox, FixedLine, FixedText, GroupBox, Hyperlink, RadioButton</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id731583839708412" role="tablecontent" xml-lang="en-US">Specifies the text associated with the control.</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id511584027709311" role="tablecontent" localize="false">ControlType</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id761584027709516" role="tablecontent" xml-lang="en-US">Yes</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id491584027709825" role="tablecontent" localize="false">String</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id261598539120502" role="tablecontent" xml-lang="en-US">All</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id971584027709752" role="tablecontent" xml-lang="en-US">One of the types listed above.</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id141612705482724" role="tablecontent" localize="false">CurrentNode</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id67161270548283" role="tablecontent" xml-lang="en-US">No</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id341612705482566" role="tablecontent" xml-lang="en-US">UNO<br/>object</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id51612705482172" role="tablecontent" localize="false">TreeControl</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id1001612705482919" role="tablecontent" xml-lang="en-US">The currently upmost node selected in the tree control. Refer to <link href="https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1awt_1_1tree_1_1XMutableTreeNode.html">XmutableTreeNode</link> in Application Programming Interface (API) documentation for detailed information.</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id491583839767611" role="tablecontent" localize="false">Default</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id31583839767743" role="tablecontent" xml-lang="en-US">No</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id741583839767926" role="tablecontent" localize="false">Boolean</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id71598539168348" role="tablecontent" localize="false">Button</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id111583839767195" role="tablecontent" xml-lang="en-US">Specifies whether a command button is the default (OK) button.</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id83158383992056" role="tablecontent" localize="false">Enabled</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id771583839920487" role="tablecontent" xml-lang="en-US">No</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id971583839920282" role="tablecontent" localize="false">Boolean</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id891598539196786" role="tablecontent" xml-lang="en-US">All</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id451583839920858" role="tablecontent" xml-lang="en-US">Specifies if the control is accessible with the cursor.</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id751588333908795" role="tablecontent" localize="false">Format</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id571588333908716" role="tablecontent" xml-lang="en-US">No</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id781588333908500" role="tablecontent" localize="false">String</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id491598539231618" role="tablecontent" localize="false">DateField, TimeField, FormattedField</paragraph>
<paragraph id="par_id491598529331618" role="tablecontent" xml-lang="en-US">(read-only)</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id721588333908708" role="tablecontent" xml-lang="en-US">Specifies the format used to display dates and times. It must be one these strings:</paragraph>
<paragraph role="paragraph" id="par_id891598456980194" xml-lang="en-US">For dates: "Standard (short)", "Standard (short YY)", "Standard (short YYYY)", "Standard (long)", "DD/MM/YY", "MM/DD/YY", "YY/MM/DD", "DD/MM/YYYY", "MM/DD/YYYY" , "YYYY/MM/DD", "YY-MM-DD", "YYYY-MM-DD".</paragraph>
<paragraph role="paragraph" id="par_id221598456991070" xml-lang="en-US">For times: "24h short", "24h long", "12h short", "12h long".</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id251583774433989" role="tablecontent" localize="false">ListCount</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id501583774433513" role="tablecontent" xml-lang="en-US">Yes</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id411583774433779" role="tablecontent" localize="false">Long</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id531598539561342" role="tablecontent" localize="false">ComboBox, ListBox, TableControl</paragraph>
</tablecell>
<tablecell>
<paragraph role="paragraph" id="par_id151598177605296" xml-lang="en-US">Specifies the number of rows in a ListBox, a ComboBox or a TableControl.</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id731588334016220" role="tablecontent" localize="false">ListIndex</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id271588334016191" role="tablecontent" xml-lang="en-US">No</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id991588334016273" role="tablecontent" localize="false">Long</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id451598539598242" role="tablecontent" localize="false">ComboBox, ListBox, TableControl</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id251588334016874" role="tablecontent" xml-lang="en-US">Specifies which item is selected in a ListBox, a ComboBox or a TableControl.</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id451598457655392" role="tablecontent" localize="false">Locked</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id961598457655506" role="tablecontent" xml-lang="en-US">No</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id571598457655365" role="tablecontent" localize="false">Boolean</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id111598539631340" role="tablecontent" localize="false">ComboBox, CurrencyField, DateField, FileControl, FormattedField, ListBox, NumericField, PatternField, TextField, TimeField</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id2159845765568" role="tablecontent" xml-lang="en-US">Specifies if the control is read-only.</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id21159845795140" role="tablecontent" localize="false">MultiSelect</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id621598457951781" role="tablecontent" xml-lang="en-US">No</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id311598457951281" role="tablecontent" localize="false">Boolean</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id361598539747680" role="tablecontent" localize="false">ListBox</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id821598457951782" role="tablecontent" xml-lang="en-US">Specifies whether a user can make multiple selections in a listbox.</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id421598458170141" role="tablecontent" localize="false">Name</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id351598458170114" role="tablecontent" xml-lang="en-US">Yes</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id391598458170757" role="tablecontent" localize="false">String</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id151598539764402" role="tablecontent" xml-lang="en-US">All</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id621598458170392" role="tablecontent" xml-lang="en-US">The name of the control.</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id281598458357593" role="tablecontent" localize="false">Page</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id80159845835726" role="tablecontent" xml-lang="en-US">No</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id191598458357402" role="tablecontent" localize="false">Integer</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id841598539781888" role="tablecontent" xml-lang="en-US">All</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id791598458357756" role="tablecontent" xml-lang="en-US">A dialog may have several pages that can be traversed by the user step by step. The Page property of the Dialog object defines which page of the dialog is active.</paragraph>
<paragraph role="paragraph" id="par_id441598458459145" xml-lang="en-US">The Page property of a control defines the page of the dialog on which the control is visible.</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id2915984585802" role="tablecontent" localize="false">Parent</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id161598458580581" role="tablecontent" xml-lang="en-US">Yes</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id921598458580608" role="tablecontent" xml-lang="en-US"><literal>Dialog</literal><br/>service</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id181598539807426" role="tablecontent" xml-lang="en-US">All</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id801598458580456" role="tablecontent" xml-lang="en-US">The parent <literal>SFDialogs.Dialog</literal> class object instance.</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id181598458773220" role="tablecontent" localize="false">Picture</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id971598458773352" role="tablecontent" xml-lang="en-US">No</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id471598458773993" role="tablecontent" localize="false">String</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id831598539848472" role="tablecontent" localize="false">Button, ImageControl</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id451598458773588" role="tablecontent" xml-lang="en-US">Specifies the file name containing a bitmap or other type of graphic to be displayed on the specified control. The filename must comply with the <literal>FileNaming</literal> attribute of the <literal>ScriptForge.FileSystem</literal> service.</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id791612700624395" role="tablecontent" localize="false">RootNode</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id831612700624650" role="tablecontent" xml-lang="en-US">Yes</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id711612700624483" role="tablecontent" xml-lang="en-US">UNO<br/>object</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id581612700624717" role="tablecontent" localize="false">TreeControl</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id11612700624514" role="tablecontent" xml-lang="en-US">An object representing the lowest root node (usually there is only one such root node). Refer to <link href="https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1awt_1_1tree_1_1XMutableTreeNode.html">XmutableTreeNode</link> in Application Programming Interface (API) documentation for detailed information.</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id681598516577774" role="tablecontent" localize="false">RowSource</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id401598516577225" role="tablecontent" xml-lang="en-US">No</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id59159851657754" role="tablecontent" localize="false">Array of strings</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id131598539880024" role="tablecontent" localize="false">ComboBox, ListBox</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id311598516577712" role="tablecontent" xml-lang="en-US">Specifies the data contained in a combobox or a listbox.</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id491598516746653" role="tablecontent" localize="false">TabIndex</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id781598516674550" role="tablecontent" xml-lang="en-US">Yes</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id741598561764696" role="tablecontent" localize="false">Numeric</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id761598359912452" role="tablecontent" localize="false">All</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id11159815676440" role="tablecontent" xml-lang="en-US">The <literal>TabIndex</literal> property specifies a control&apos;s place in the tab order in the dialog.</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id491598516764653" role="tablecontent" localize="false">Text</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id781598516764550" role="tablecontent" xml-lang="en-US">Yes</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id741598516764696" role="tablecontent" localize="false">String</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id761598539912452" role="tablecontent" localize="false">ComboBox, FileControl, FormattedField, PatternField, TextField</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id11159851676440" role="tablecontent" xml-lang="en-US">Gives access to the text being displayed by the control.</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id311598517275908" role="tablecontent" localize="false">TipText</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id411598517275112" role="tablecontent" xml-lang="en-US">No</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id971598517275920" role="tablecontent" localize="false">String</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id171598539985022" role="tablecontent" xml-lang="en-US">All</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id651598517275384" role="tablecontent" xml-lang="en-US">Specifies the text that appears as a tooltip when you hold the mouse pointer over the control.</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id951598517418614" role="tablecontent" localize="false">TripleState</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id821598517418463" role="tablecontent" xml-lang="en-US">No</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id231598517418608" role="tablecontent" localize="false">Boolean</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id81598540007035" role="tablecontent" localize="false">CheckBox</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id141598517418822" role="tablecontent" xml-lang="en-US">Specifies if the checkbox control may appear dimmed (grayed) or not.</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id31598517671451" role="tablecontent" localize="false">URL</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id701598517671337" role="tablecontent" xml-lang="en-US">No</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id2159851767131" role="tablecontent" localize="false">String</paragraph>
</tablecell>
<tablecell>
<paragraph role="paragraph" id="par_id481687785271551" localize="false">Hyperlink</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id1001598540024252" role="tablecontent" xml-lang="en-US">The URL to open when the control is clicked.</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id31598517671415" role="tablecontent" localize="false">Value</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id701598517671373" role="tablecontent" xml-lang="en-US">No</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id2159851767113" role="tablecontent" localize="false">Variant</paragraph>
</tablecell>
<tablecell></tablecell>
<tablecell>
<paragraph id="par_id1001598540024225" role="tablecontent" xml-lang="en-US">Refer to <link href="text/sbasic/shared/03/sf_dialogcontrol.xhp#hd_ValueProperty">Value property</link></paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id571598517730264" role="tablecontent" localize="false">Visible</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id661598517730941" role="tablecontent" xml-lang="en-US">No</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id981598517730694" role="tablecontent" localize="false">Boolean</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id761598540042290" role="tablecontent" xml-lang="en-US">All</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id881598517730836" role="tablecontent" xml-lang="en-US">Specifies if the control is hidden or visible.</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id741598177924441" role="tablecontent" localize="false">XControlModel</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id451598177924437" role="tablecontent" xml-lang="en-US">Yes</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id94159817792441" role="tablecontent" xml-lang="en-US">UNO<br/>object</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id311598540066789" role="tablecontent" xml-lang="en-US">All</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id191598177924897" role="tablecontent" xml-lang="en-US">The UNO object representing the control model. Refer to <link href="https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1awt_1_1XControlModel.html">XControlModel</link> and <link href="https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1awt_1_1UnoControlDialogModel.html)">UnoControlDialogModel</link> in Application Programming Interface (API) documentation for detailed information.</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id801598178083859" role="tablecontent" localize="false">XControlView</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id811598178083501" role="tablecontent" xml-lang="en-US">Yes</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id981598178083938" role="tablecontent" xml-lang="en-US">UNO<br/>object</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id551598540079329" role="tablecontent" xml-lang="en-US">All</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id731598178083442" role="tablecontent" xml-lang="en-US">The UNO object representing the control view. Refer to <link href="https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1awt_1_1XControl.html">XControl</link> and <link href="https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1awt_1_1UnoControlDialog.html)">UnoControlDialog</link> in Application Programming Interface (API) documentation for detailed information.</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id55161269944658" role="tablecontent" localize="false">XTreeDataModel</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id741612699446459" role="tablecontent" xml-lang="en-US">Yes</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id311612699446893" role="tablecontent" xml-lang="en-US">UNO<br/>object</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id25161269944611" role="tablecontent" localize="false">TreeControl</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id691612699446892" role="tablecontent" xml-lang="en-US">The UNO object representing the tree control data model. Refer to <link href="https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1awt_1_1tree_1_1XMutableTreeDataModel.html">XMutableTreeDataModel</link> in Application Programming Interface (API) documentation for detailed information.</paragraph>
</tablecell>
</tablerow>
</table>
</section>
<h2 id="hd_ValueProperty" xml-lang="en-US">The <variable id="ValueProperty">Value property</variable></h2>
<table id="tab_id48159854325479">
<tablerow>
<tablecell>
<paragraph id="par_id10159854325492" role="tablehead" xml-lang="en-US">Control type</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id741598543254158" role="tablehead" xml-lang="en-US">Type</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id961598543254444" role="tablehead" xml-lang="en-US">Description</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id461598543254494" role="tablecontent" localize="false">Button</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id271598543254590" role="tablecontent" localize="false">Boolean</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id741598543254108" role="tablecontent" xml-lang="en-US">For toggle buttons only</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id131598543254931" role="tablecontent" localize="false">CheckBox</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id741598543254376" role="tablecontent" xml-lang="en-US">Boolean or Integer</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id521598543254630" role="tablecontent" xml-lang="en-US">0, False: not checked<br />1, True: checked<br />2: grayed, don't know</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id891598543254563" role="tablecontent" localize="false">ComboBox</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id781598543254887" role="tablecontent" localize="false">String</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id331598543254947" role="tablecontent" xml-lang="en-US">The selected value. The <literal>ListIndex</literal> property is an alternate option.</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id58159854325446" role="tablecontent" localize="false">CurrencyField</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id5159854325443" role="tablecontent" xml-lang="en-US">Numeric</paragraph>
</tablecell>
<tablecell>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id241598543254415" role="tablecontent" localize="false">DateField</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id401598543254743" role="tablecontent" localize="false">Date</paragraph>
</tablecell>
<tablecell>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id851598543254508" role="tablecontent" localize="false">FileControl</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id731598543254544" role="tablecontent" localize="false">String</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id971598543254757" role="tablecontent" xml-lang="en-US">A file name formatted in accordance with the <literal>FileNaming</literal> property of the <literal>ScriptForge.FileSystem</literal> service</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id921598543254323" role="tablecontent" localize="false">FormattedField</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id221598543254760" role="tablecontent" xml-lang="en-US">String or Numeric</paragraph>
</tablecell>
<tablecell>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id151598543254318" role="tablecontent" localize="false">ListBox</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id42159854325422" role="tablecontent" xml-lang="en-US">String or array of strings</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id601598543254780" role="tablecontent" xml-lang="en-US">The selected row(s) as a scalar or as an array depending on the <literal>MultiSelect</literal> attribute</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id771598543254973" role="tablecontent" localize="false">NumericField</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id461598543254909" role="tablecontent" xml-lang="en-US">Numeric</paragraph>
</tablecell>
<tablecell>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id38159854325480" role="tablecontent" localize="false">PatternField</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id81598543254625" role="tablecontent" localize="false">String</paragraph>
</tablecell>
<tablecell>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id951598543254998" role="tablecontent" localize="false">ProgressBar</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id631598543254771" role="tablecontent" xml-lang="en-US">Numeric</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id91598543254766" role="tablecontent" xml-lang="en-US">Must be within the predefined bounds</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id791598543254779" role="tablecontent" localize="false">RadioButton</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id561598543254115" role="tablecontent" localize="false">Boolean</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id851598543254624" role="tablecontent" xml-lang="en-US">Each button has its own name. They are linked together if their TAB positions are contiguous. If a radiobutton is set to <literal>True</literal>, the other related buttons are automatically set to <literal>False</literal></paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id141598543254361" role="tablecontent" localize="false">ScrollBar</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id531598543254869" role="tablecontent" xml-lang="en-US">Numeric</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id21598543254994" role="tablecontent" xml-lang="en-US">Must be within the predefined bounds</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id811598543254007" role="tablecontent" localize="false">TableControl</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id751598543254805" role="tablecontent" localize="false">Array</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id441598543254951" role="tablecontent" xml-lang="en-US">One-dimensional array with the data of the currently selected row.</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id811598543254140" role="tablecontent" localize="false">TextField</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id751598543254299" role="tablecontent" localize="false">String</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id441598543254738" role="tablecontent" xml-lang="en-US">The text appearing in the field</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id89159854325478" role="tablecontent" localize="false">TimeField</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id341598543254600" role="tablecontent" localize="false">Date</paragraph>
</tablecell>
<tablecell>
</tablecell>
</tablerow>
</table>
<note id="par_id61687963745108">There is no <literal>Value</literal> property for <literal>GroupBox</literal>, <literal>Hyperlink</literal>, <literal>ImageControl</literal> and <literal>TreeControl</literal> dialog controls.</note>
<h2 id="hd_id421612628828054" xml-lang="en-US">Event properties</h2>
<embed href="text/sbasic/shared/03/sf_dialog.xhp#OnEventsDefinition"/>
<table id="tab_id951612628879819">
<tablerow>
<tablecell>
<paragraph id="par_id961612628879819" role="tablehead" xml-lang="en-US">Name</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id401612628879819" role="tablehead" xml-lang="en-US">ReadOnly</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id281612628879819" role="tablehead" xml-lang="en-US">Description as labeled in the Basic IDE</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id801612707166342" localize="false" role="tablecontent" xml-lang="en-US">OnActionPerformed</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id91612707166532" role="tablecontent" xml-lang="en-US">Yes</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id291612707166258" role="tablecontent" xml-lang="en-US">Execute action</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id261612707166662" localize="false" role="tablecontent" xml-lang="en-US">OnAdjustmentValueChanged</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id79161270716675" role="tablecontent" xml-lang="en-US">Yes</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id831612707166731" role="tablecontent" xml-lang="en-US">While adjusting</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id431612629836735" localize="false" role="tablecontent" xml-lang="en-US">OnFocusGained</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id111612629836630" role="tablecontent" xml-lang="en-US">Yes</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id1001612629836902" role="tablecontent" xml-lang="en-US">When receiving focus</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id701612629836389" localize="false" role="tablecontent" xml-lang="en-US">OnFocusLost</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id291612629836294" role="tablecontent" xml-lang="en-US">Yes</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id62161262983683" role="tablecontent" xml-lang="en-US">When losing focus</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id10161270735471" localize="false" role="tablecontent" xml-lang="en-US">OnItemStateChanged</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id51612707354544" role="tablecontent" xml-lang="en-US">Yes</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id211612707354899" role="tablecontent" xml-lang="en-US">Item status changed</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id241612629836863" localize="false" role="tablecontent" xml-lang="en-US">OnKeyPressed</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id81612629836634" role="tablecontent" xml-lang="en-US">Yes</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id881612629836744" role="tablecontent" xml-lang="en-US">Key pressed</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id201612629836996" localize="false" role="tablecontent" xml-lang="en-US">OnKeyReleased</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id591612629836830" role="tablecontent" xml-lang="en-US">Yes</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id161612629836775" role="tablecontent" xml-lang="en-US">Key released</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id111612629836950" localize="false" role="tablecontent" xml-lang="en-US">OnMouseDragged</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id891612629836630" role="tablecontent" xml-lang="en-US">Yes</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id461612629836679" role="tablecontent" xml-lang="en-US">Mouse moved while key presses</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id711612629836495" localize="false" role="tablecontent" xml-lang="en-US">OnMouseEntered</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id131612629836291" role="tablecontent" xml-lang="en-US">Yes</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id151612629836151" role="tablecontent" xml-lang="en-US">Mouse inside</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id971612629836286" localize="false" role="tablecontent" xml-lang="en-US">OnMouseExited</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id211612629836725" role="tablecontent" xml-lang="en-US">Yes</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id361612629836624" role="tablecontent" xml-lang="en-US">Mouse outside</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id721612629836537" localize="false" role="tablecontent" xml-lang="en-US">OnMouseMoved</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id311612629836481" role="tablecontent" xml-lang="en-US">Yes</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id721612629836752" role="tablecontent" xml-lang="en-US">Mouse moved</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id55161262983695" localize="false" role="tablecontent" xml-lang="en-US">OnMousePressed</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id981612629836116" role="tablecontent" xml-lang="en-US">Yes</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id381612629836635" role="tablecontent" xml-lang="en-US">Mouse button pressed</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id621612629836155" localize="false" role="tablecontent" xml-lang="en-US">OnMouseReleased</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id711612629836704" role="tablecontent" xml-lang="en-US">Yes</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id35161262983642" role="tablecontent" xml-lang="en-US">Mouse button released</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id671612707606983" localize="false" role="tablecontent" xml-lang="en-US">OnNodeExpanded</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id851612707606863" role="tablecontent" xml-lang="en-US">No</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id351612707606197" role="tablecontent" xml-lang="en-US">(Not in Basic IDE) when the expansion button is pressed on a node in a tree control</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id331612707606104" localize="false" role="tablecontent" xml-lang="en-US">OnNodeSelected</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id121612707606251" role="tablecontent" xml-lang="en-US">No</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id881612707606121" role="tablecontent" xml-lang="en-US">(Not in Basic IDE) when a node in a tree control is selected</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id84161270760678" localize="false" role="tablecontent" xml-lang="en-US">OnTextChanged</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id811612707606330" role="tablecontent" xml-lang="en-US">Yes</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id621612707606219" role="tablecontent" xml-lang="en-US">Text modified</paragraph>
</tablecell>
</tablerow>
</table>
<embed href="text/sbasic/shared/03/sf_dialog.xhp#OnEventsWarning"/>
<h2 id="hd_id421583670049913" xml-lang="en-US">Methods</h2>
<section id="methods_toc">
<table id="tab_id891606472825856">
<tablerow>
<tablecell colspan="3">
<paragraph id="par_id891611613601554" role="tablehead" xml-lang="en-US">List of Methods in the DialogControl Service</paragraph>
</tablecell>
</tablerow>
<tablerow>
<tablecell>
<paragraph id="par_id751612709117248" role="tablecontent" localize="false">
<link href="text/sbasic/shared/03/sf_dialogcontrol.xhp#AddSubNode">AddSubNode</link><br/>
<link href="text/sbasic/shared/03/sf_dialogcontrol.xhp#AddSubTree">AddSubTree</link><br/>
<link href="text/sbasic/shared/03/sf_dialogcontrol.xhp#CreateRoot">CreateRoot</link><br/>
</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id63161270911712" role="tablecontent" localize="false">
<link href="text/sbasic/shared/03/sf_dialogcontrol.xhp#FindNode">FindNode</link><br/>
<link href="text/sbasic/shared/03/sf_dialogcontrol.xhp#Resize">Resize</link><br/>
<link href="text/sbasic/shared/03/sf_dialogcontrol.xhp#SetFocus">SetFocus</link><br/>
</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id651612709117457" role="tablecontent" localize="false">
<link href="text/sbasic/shared/03/sf_dialogcontrol.xhp#SetTableData">SetTableData</link><br/>
<link href="text/sbasic/shared/03/sf_dialogcontrol.xhp#WriteLine">WriteLine</link><br/><br/>
</paragraph>
</tablecell>
</tablerow>
</table>
</section>
<section id="AddSubNode">
<comment> AddSubNode -------------------------------------------------------------------------------------------- </comment>
<bookmark localize="false" branch="index" id="bm_id1516127118236">
<bookmark_value>DialogControl service;AddSubNode</bookmark_value>
</bookmark>
<h2 id="hd_id791612711823914" localize="false">AddSubNode</h2>
<paragraph role="paragraph" id="par_id831612711823126">Create and return a new node of the tree control as a UNO object subordinate to a parent node. <variable id="XMutableTreeNode">Refer to <link href="https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1awt_1_1tree_1_1XMutableTreeNode.html">XMutableTreeNode</link> in Application Programming Interface (API) documentation for detailed information.</variable></paragraph>
<section id="OnNodeExpanded">
<paragraph role="paragraph" id="par_id741612711823706" xml-lang="en-US">This method may be called before displaying the dialog box to build the initial tree. It may also be called from a dialog or control event - using the <literal>OnNodeExpanded</literal> event - to complete the tree dynamically.</paragraph>
</section>
<embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
<paragraph role="paragraph" localize="false" id="par_id781620224364283">
<input>svc.AddSubNode(parentnode: uno, displayvalue: str, opt datavalue: any): uno</input>
</paragraph>
<embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
<paragraph role="paragraph" id="par_id761612711823834"><emph>parentnode</emph>: A node UNO object, of type <literal>com.sun.star.awt.tree.XMutableTreeNode</literal>.</paragraph>
<paragraph role="paragraph" id="par_id791612711823819"><emph>displayvalue</emph>: The text appearing in the tree control box.</paragraph>
<section id="datavalue">
<paragraph role="paragraph" id="par_id911612711823382"><emph>datavalue</emph>: Any value associated with the new node. <literal>datavalue</literal> may be a string, a number or a date. Omit the argument when not applicable.</paragraph>
</section>
<embed href="text/sbasic/shared/00000003.xhp#functexample"/>
<paragraph role="paragraph" id="par_id901620317110685">%PRODUCTNAME Basic and Python examples pick up current document's <literal>myDialog</literal> dialog from <literal>Standard</literal> library.</paragraph>
<embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id781612711823502">Dim oDlg As Object, myTree As Object, myNode As Object, theRoot As Object</paragraph>
<paragraph role="bascode" localize="false" id="bas_id811612711823106">Set oDlg = CreateScriptService("Dialog",,, "myDialog")</paragraph>
<paragraph role="bascode" localize="false" id="bas_id751612711823763">Set myTree = oDlg.Controls("myTreeControl")</paragraph>
<paragraph role="bascode" localize="false" id="bas_id31612711823423">Set theRoot = myTree.CreateRoot("Tree top")</paragraph>
<paragraph role="bascode" localize="false" id="bas_id211612712366538">Set myNode = myTree.AddSubNode(theRoot, "A branch ...")</paragraph>
</bascode>
<embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
<pycode>
<paragraph role="pycode" localize="false" id="pyc_id771620316787550">dlg = CreateScriptService('SFDialogs.Dialog', None, None, 'myDialog')</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id511620316787792">tree = dlg.Controls('myTreeControl')</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id291620316787950">root = tree.CreateRoot('Tree top')</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id201620316788142">node = tree.AddSubNode(root, 'A branch ...')</paragraph>
</pycode>
</section>
<section id="AddSubTree">
<comment> AddSubTree -------------------------------------------------------------------------------------------- </comment>
<bookmark localize="false" branch="index" id="bm_id481612713087784">
<bookmark_value>DialogControl service;AddSubTree</bookmark_value>
</bookmark>
<h2 id="hd_id81161271308746" localize="false">AddSubTree</h2>
<paragraph role="paragraph" id="par_id221612713087885">Return <literal>True</literal> when a subtree, subordinate to a parent node, could be inserted successfully in a tree control. If the parent node had already child nodes before calling this method, the child nodes are erased.</paragraph>
<embed href="text/sbasic/shared/03/sf_dialogcontrol.xhp#OnNodeExpanded"/>
<embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
<paragraph role="paragraph" localize="false" id="par_id731620308640671">
<input>svc.AddSubTree(parentnode: uno, flattree: any, opt withdatavalue: bool): bool</input>
</paragraph>
<embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
<paragraph role="paragraph" id="par_id781612713087722"><emph>parentnode</emph>: A node UNO object, of type <literal>com.sun.star.awt.tree.XMutableTreeNode</literal>.</paragraph>
<paragraph role="paragraph" id="par_id36161271308759"><emph>flattree</emph>: a two dimension array sorted on the columns containing the display values. Such an array can be issued by the <literal>GetRows</literal> method applied on the <literal>SFDatabases.Database</literal> service. When an array item containing the text to be displayed is <literal>Empty</literal> or <literal>Null</literal>, no new subnode is created and the remainder of the row is skipped.</paragraph>
<bascode>
<paragraph role="bascode" id="bas_id61612716027443">Flat tree >>>> Resulting subtree</paragraph>
<paragraph role="bascode" localize="false" id="bas_id881612716035711">A1 B1 C1 |__ A1 </paragraph>
<paragraph role="bascode" localize="false" id="bas_id221612716043100">A1 B1 C2 |__ B1</paragraph>
<paragraph role="bascode" localize="false" id="bas_id861612716050132">A1 B2 C3 |__ C1</paragraph>
<paragraph role="bascode" localize="false" id="bas_id251612716057266">A2 B3 C4 |__ C2</paragraph>
<paragraph role="bascode" localize="false" id="bas_id316127156064145">A2 B3 C5 |__ B2</paragraph>
<paragraph role="bascode" localize="false" id="bas_id321612716075452">A3 B4 C6 |__ C3</paragraph>
<paragraph role="bascode" localize="false" id="bas_id171612716083505"> |__ A2</paragraph>
<paragraph role="bascode" localize="false" id="bas_id231612716092043"> |__ B3</paragraph>
<paragraph role="bascode" localize="false" id="bas_id216124716100898"> |__ C4</paragraph>
<paragraph role="bascode" localize="false" id="bas_id241612716108208"> |__ C5</paragraph>
<paragraph role="bascode" localize="false" id="bas_id531612716115408"> |__ A3</paragraph>
<paragraph role="bascode" localize="false" id="bas_id621612716122130"> |__ B4</paragraph>
<paragraph role="bascode" localize="false" id="bas_id212612716132791"> |__ C6</paragraph>
</bascode>
<paragraph role="paragraph" id="par_id51612713087915"><emph>withdatavalue</emph>: When <literal>False</literal> default value is used, every column of <literal>flattree</literal> contains the text to be displayed in the tree control. When <literal>True</literal>, the texts to be displayed (<literal>displayvalue</literal>) are in columns 0, 2, 4, ... while the data values (<literal>datavalue</literal>) are in columns 1, 3, 5, ...</paragraph>
<embed href="text/sbasic/shared/00000003.xhp#functexample"/>
<embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id531612713087285">Dim myTree As Object, theRoot As Object, oDb As Object, vData As Variant</paragraph>
<paragraph role="bascode" localize="false" id="bas_id991612713087724">Set myTree = myDialog.Controls("myTreeControl")</paragraph>
<paragraph role="bascode" localize="false" id="bas_id581612713087989">Set theRoot = myTree.CreateRoot("By product category")</paragraph>
<paragraph role="bascode" localize="false" id="bas_id771612713087670">Set oDb = CreateScriptService("SFDatabases.Database", "/home/.../mydatabase.odb")</paragraph>
<paragraph role="bascode" localize="false" id="bas_id731612713087683">vData = oDb.GetRows("SELECT [Category].[Name], [Category].[ID], [Product].[Name], [Product].[ID] " _</paragraph>
<paragraph role="bascode" localize="false" id="bas_id551612714130895"> &amp; "FROM [Category], [Product] WHERE [Product].[CategoryID] = [Category].[ID] " _</paragraph>
<paragraph role="bascode" localize="false" id="bas_id551612714139429"> &amp; "ORDER BY [Category].[Name], [Product].[Name]")</paragraph>
<paragraph role="bascode" localize="false" id="bas_id361612714193588">myTree.AddSubTree(theRoot, vData, WithDataValue := True)</paragraph>
</bascode>
<embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
<pycode>
<paragraph role="pycode" localize="false" id="pyc_id671620317364456">SQL_STMT = "SELECT [Category].[Name], [Category].[ID], [Product].[Name], [Product].[ID] \</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id51620317364911"> FROM [Category], [Product] WHERE [Product].[CategoryID] = [Category].[ID] \</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id101620318087874"> ORDER BY [Category].[Name], [Product].[Name]"</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id901620317363542">tree = dlg.Controls('myTreeControl')</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id361620317363735">root = tree.CreateRoot('By Product category')</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id361620317363903">db = CreateScriptService('SFDatabases.Database', '/home/.../mydatabase.odb')</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id911620317364071">sub_tree = db.GetRows(SQL_STMT)</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id221620317364271">tree.AddSubTree(root, sub_tree, withdatavalue=True)</paragraph>
</pycode>
</section>
<section id="CreateRoot">
<comment> CreateRoot ------------------------------------------------------------------------------------------- </comment>
<bookmark localize="false" branch="index" id="bm_id791612780723864">
<bookmark_value>DialogControl service;CreateRoot</bookmark_value>
</bookmark>
<h2 id="hd_id291612780723671" localize="false">CreateRoot</h2>
<paragraph role="paragraph" id="par_id151612780723320">Returns a new root node of the tree control, as a node UNO object of type <literal>com.sun.star.awt.tree.XMutableTreeNode</literal>. The new tree root is inserted below pre-existing root nodes. <embedvar href="text/sbasic/shared/03/sf_dialogcontrol.xhp#XMutableTreeNode"/></paragraph>
<paragraph role="paragraph" id="par_id821612780723965" xml-lang="en-US">This method may be called before displaying the dialog box to build the initial tree. It may also be called from a dialog or control event to complete the tree dynamically.</paragraph>
<embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
<paragraph role="paragraph" localize="false" id="par_id991620309297239">
<input>svc.CreateRoot(displayvalue: str, opt datavalue: any): uno</input>
</paragraph>
<embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
<paragraph role="paragraph" id="par_id791612117823819"><emph>displayvalue</emph>: The text appearing in the tree control box.</paragraph>
<embed href="text/sbasic/shared/03/sf_dialogcontrol.xhp#datavalue"/>
<embed href="text/sbasic/shared/00000003.xhp#functexample"/>
<embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id491612780723925">Dim myTree As Object, myNode As Object</paragraph>
<paragraph role="bascode" localize="false" id="bas_id241612780723722">Set myTree = myDialog.Controls("myTreeControl")</paragraph>
<paragraph role="bascode" localize="false" id="bas_id441612780723817">Set myNode = myTree.CreateRoot("Tree starts here ...")</paragraph>
</bascode>
<embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
<pycode>
<paragraph role="pycode" localize="false" id="pyc_id441620318437138">tree = dlg.Controls('myTreeControl')</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id301620318437324">node = tree.CreateRoot('Tree starts here ...')</paragraph>
</pycode>
</section>
<section id="FindNode">
<comment> FindNode ---------------------------------------------------------------------------------------------- </comment>
<bookmark localize="false" branch="index" id="bm_id741612781589926">
<bookmark_value>DialogControl service;FindNode</bookmark_value>
</bookmark>
<h2 id="hd_id801612781589891" localize="false">FindNode</h2>
<paragraph role="paragraph" id="par_id171612781589503">Traverses the tree and finds recursively, starting from the root, a node meeting some criteria. Either - 1 match is enough - having its display value matching <literal>displayvalue</literal> pattern or having its data value equal to <literal>datavalue</literal>. The comparisons may be or not case-sensitive. The first matching occurrence is returned as a node UNO object of type <literal>com.sun.star.awt.tree.XMutableTreeNode</literal>. <embedvar href="text/sbasic/shared/03/sf_dialogcontrol.xhp#XMutableTreeNode"/></paragraph>
<paragraph role="paragraph" id="par_id741612782475457" xml-lang="en-US">When not found, the method returns <literal>Nothing</literal>, to be tested with the <literal>IsNull()</literal> builtin function.</paragraph>
<paragraph role="paragraph" id="par_id41612781589363" xml-lang="en-US">This method may be called before displaying the dialog box to build the initial tree. It may also be called from a dialog or control event.</paragraph>
<embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
<paragraph role="paragraph" localize="false" id="par_id61620309668544">
<input>svc.FindNode(displayvalue: str = '', opt datavalue: any, casesensitive = False): uno</input>
</paragraph>
<embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
<paragraph role="paragraph" id="par_id541613670199211">One argument out of <literal>displayvalue</literal> or <literal>datavalue</literal> must be specified. If both present, one match is sufficient to select the node.</paragraph>
<paragraph role="paragraph" id="par_id591612781589560"><emph>displayvalue</emph>: The pattern to be matched. Refer to <link href="text/sbasic/shared/03/sf_string.xhp#IsLike"><literal>SF_String.IsLike()</literal></link> method for the list of possible wildcards. When equal to the zero-length string (default), this display value is not searched for.</paragraph>
<embed href="text/sbasic/shared/03/sf_dialogcontrol.xhp#datavalue"/>
<paragraph role="paragraph" id="par_id141582384726168"><emph>casesensitive</emph>: Default value is <literal>False</literal></paragraph>
<embed href="text/sbasic/shared/00000003.xhp#functexample"/>
<embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id61612781589464">Dim myTree As Object, myNode As Object</paragraph>
<paragraph role="bascode" localize="false" id="bas_id991612781589903">Set myTree = myDialog.Controls("myTreeControl")</paragraph>
<paragraph role="bascode" localize="false" id="bas_id461612781589942">Set myNode = myTree.FindNode("*Sophie*", CaseSensitive := True)</paragraph>
</bascode>
<embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
<pycode>
<paragraph role="pycode" localize="false" id="pyc_id191620318816450">tree = dlg.Controls('myTreeControl')</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id281620318817089">node = FindNode('*Sophie*', casesensitive=True)</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id861620319785763">if node is None:</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id471620319809524"> # ...</paragraph>
</pycode>
</section>
<section id="Resize">
<comment> Resize ---------------------------------------------------------------------------------------------- </comment>
<bookmark localize="false" branch="index" id="bm_id721583393076548">
<bookmark_value>DialogControl service;Resize</bookmark_value>
</bookmark>
<h2 id="hd_id681583933067692" localize="false">Resize</h2>
<paragraph role="paragraph" id="par_id871583933076484">Move the top-left corner of a dialog control to new coordinates and/or modify its dimensions. Return <literal>True</literal> if resizing was successful.</paragraph>
<embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
<paragraph role="paragraph" localize="false" id="par_id11620310322534">
<input>svc.Resize(opt Left: int, opt Top: int, opt Width: int, opt Height: int): bool</input>
</paragraph>
<embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
<paragraph role="paragraph" id="par_id351687783159237">All distances are expressed in <link href="text/sbasic/shared/00000002.xhp#AppFontUnits">Map AppFont units</link> and are measured from the top-left corner of the parent dialog. Without arguments the method resizes the control to its "preferred size", a size adjusted depending on its actual content. Missing arguments are left unchanged.</paragraph>
<paragraph role="paragraph" id="par_id911687783094143"><emph>Left</emph>: The horizontal distance from the top-left corner</paragraph>
<paragraph role="paragraph" id="par_id251687783287236"><emph>Top</emph>: The vertical distance from the top-left corner</paragraph>
<paragraph role="paragraph" id="par_id291687783328508"><emph>Width</emph>: the horizontal width of the rectangle containing the control</paragraph>
<paragraph role="paragraph" id="par_id901687783339292"><emph>Height</emph>: the vertical height of the rectangle containing the control</paragraph>
<embed href="text/sbasic/shared/00000003.xhp#functexample"/>
<embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id221598179015596">Dim oControl As Object</paragraph>
<paragraph role="bascode" localize="false" id="bas_id171598171911121">Set oDlg = CreateScriptService("SFDialogs.Dialog",,, "myDialog")</paragraph>
<paragraph role="bascode" localize="false" id="bas_id681598179132436">Set oControl = oDlg.Controls("thisControl")</paragraph>
<paragraph role="bascode" xml-lang="en-US" id="bas_id361598179153096">oControl.Resize(100, 200, Height:=6000) ' Width is unchanged</paragraph>
</bascode>
<embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
<pycode>
<paragraph role="pycode" localize="false" id="pyc_id591620319189602">dlg = CreateScriptService('Dialog', None, None, 'myDialog')</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id201620319172098">ctrl = dlg.Controls('thisControl')</paragraph>
<paragraph role="pycode" xml-lang="en-US" id="pyc_id821620319176082">ctrl.Resize(300, 200, 1500) # Height is unchanged</paragraph>
</pycode>
</section>
<section id="SetFocus">
<comment> SetFocus ---------------------------------------------------------------------------------------------- </comment>
<bookmark localize="false" branch="index" id="bm_id721583933076548">
<bookmark_value>DialogControl service;SetFocus</bookmark_value>
</bookmark>
<h2 id="hd_id681583933076692" localize="false">SetFocus</h2>
<paragraph role="paragraph" id="par_id871583933076448">Set the focus on the control. Return <literal>True</literal> if focusing was successful.</paragraph>
<paragraph role="paragraph" id="par_id151598178880227" xml-lang="en-US">This method is often called from a dialog or control event.</paragraph>
<embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
<paragraph role="paragraph" localize="false" id="par_id11620310325234">
<input>svc.SetFocus(): bool</input>
</paragraph>
<embed href="text/sbasic/shared/00000003.xhp#functexample"/>
<embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id221598179105596">Dim oControl As Object</paragraph>
<paragraph role="bascode" localize="false" id="bas_id171598179111121">Set oDlg = CreateScriptService("SFDialogs.Dialog",,, "myDialog")</paragraph>
<paragraph role="bascode" localize="false" id="bas_id681598179123436">Set oControl = oDlg.Controls("thisControl")</paragraph>
<paragraph role="bascode" localize="false" id="bas_id361598179135096">oControl.SetFocus()</paragraph>
</bascode>
<embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
<pycode>
<paragraph role="pycode" localize="false" id="pyc_id591620319169802">dlg = CreateScriptService('Dialog', None, None, 'myDialog')</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id201620319170298">ctrl = dlg.Controls('thisControl')</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id821620319170682">ctrl.SetFocus()</paragraph>
</pycode>
</section>
<section id="SetTableData">
<comment> SetTableData ------------------------------------------------------------------------------------------ </comment>
<bookmark localize="false" branch="index" id="bm_id761598619892024">
<bookmark_value>DialogControl service;SetTableData</bookmark_value>
</bookmark>
<h2 id="hd_id961598619890364" localize="false">SetTableData</h2>
<paragraph role="paragraph" id="par_id541638553960464">Fills a <literal>TableControl</literal> with the given data. All preexisting data is cleared before inserting the new data passed as argument.</paragraph>
<paragraph role="paragraph" id="par_id551638554058131">When the <literal>TableControl</literal> is added to the dialog, it is possible to use the Basic IDE to define whether column and row headers will be shown in the table. If the <literal>TableControl</literal> has column and/or row headers, the first column and/or row in the provided data array are used as labels for the table headers.</paragraph>
<paragraph role="paragraph" id="par_id411638569396108">This method returns <literal>True</literal> when successful.</paragraph>
<embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
<paragraph role="paragraph" localize="false" id="par_id841620310380255">
<input>svc.SetTableData(dataarray: any[0..*, 0..*], widths: int[0..*], alignments: str, RowHeaderWidth = 10): bool</input>
</paragraph>
<embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
<paragraph role="paragraph" id="par_id1001584541257133"><emph>dataarray</emph>: Data to be entered into the table represented as an Array of Arrays in Basic or a tuple of tuples in Python. The data must include column and row headers if they are to be displayed by the <literal>TableControl</literal>.</paragraph>
<paragraph role="paragraph" id="par_id1001584541257025"><emph>widths</emph>: Array containing the relative widths of each column. In other words, <literal>widths = (1, 2)</literal> means that the second column is twice as wide as the first one. If the number of values in the array is smaller than the number of columns in the table, then the last value in the array is used to define the width of the remaining columns.</paragraph>
<paragraph role="paragraph" id="par_id1001584541257007"><emph>alignments</emph>: Defines the alignment in each column as a string in which each character can be "L" (Left), "C" (Center), "R" (Right) or " " (whitespace, default, meaning left for strings and right for numeric values). If the length of the string is shorter than the number of columns in the table, then the last character in the string is used to define the alignment of the remaining columns.</paragraph>
<paragraph role="paragraph" id="par_id551688397846388"><emph>RowHeaderWidth</emph>: width of the row header column expressed in <link href="text/sbasic/shared/00000002.xhp#AppFontUnits">Map AppFont units</link>. Default = 10. The argument is ignored when the <literal>TableControl</literal> has no row header.</paragraph>
<embed href="text/sbasic/shared/00000003.xhp#functexample"/>
<embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
<paragraph role="paragraph" id="par_id381638569172413">The following example assumes that the dialog <literal>myDialog</literal> has a <literal>TableControl</literal> named <literal>Grid1</literal> with "Show row header" and "Show column header" properties set to "Yes".</paragraph>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id901638569052132">Dim myDialog As Object, oTable As Object, tableData As Variant</paragraph>
<paragraph role="bascode" localize="false" id="bas_id781638569039123">myDialog = CreateScriptService("Dialog", "GlobalScope", "Standard", "myDialog")</paragraph>
<paragraph role="bascode" localize="false" id="bas_id281638569051918">oTable = myDialog.Controls("Grid1")</paragraph>
<paragraph role="bascode" localize="false" id="bas_id361638569052324">tableData = Array("Column A", "Column B", "Column C")</paragraph>
<paragraph role="bascode" localize="false" id="bas_id291638569052525">tableData = SF_Array.AppendRow(tableData, Array("Row 1", 1, 2))</paragraph>
<paragraph role="bascode" localize="false" id="bas_id631638569052740">tableData = SF_Array.AppendRow(tableData, Array("Row 2", 3, 4))</paragraph>
<paragraph role="bascode" localize="false" id="bas_id371638569052941">tableData = SF_Array.AppendRow(tableData, Array("Row 3", 5, 6))</paragraph>
<paragraph role="bascode" localize="false" id="bas_id781638569053179">vAlignments = "LCC"</paragraph>
<paragraph role="bascode" localize="false" id="bas_id181638569053413">vWidths = Array(2, 1, 1)</paragraph>
<paragraph role="bascode" localize="false" id="bas_id191638569053613">oTable.SetTableData(tableData, vWidths, vAlignments)</paragraph>
<paragraph role="bascode" localize="false" id="bas_id981638569053837">myDialog.Execute()</paragraph>
</bascode>
<paragraph role="paragraph" id="par_id171638650502346">The <literal>Value</literal> property returns the selected row in the table. If no row is selected, an empty Array object is returned. The following code snippet shows how to test if any row is selected in the table.</paragraph>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id891638651540245">rowValues = oTable.Value</paragraph>
<paragraph role="bascode" localize="false" id="bas_id431638651540427">If UBound(rowValues) &lt; 0 Then</paragraph>
<paragraph role="bascode" id="bas_id361638651540588"> MsgBox "No row selected."</paragraph>
<paragraph role="bascode" localize="false" id="bas_id121638651540820">Else</paragraph>
<paragraph role="bascode" id="bas_id781638651541028"> MsgBox "Row " &amp; oTable.ListIndex &amp; " is selected."</paragraph>
<paragraph role="bascode" localize="false" id="bas_id601638651541333">End If</paragraph>
</bascode>
<embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
<pycode>
<paragraph role="pycode" localize="false" id="pyc_id111638569958471">dlg = CreateScriptService("Dialog", "GlobalScope", "Standard", "myDialog")</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id871638569958742">table_control = dlg.Controls("Grid1")</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id141638569958918">table_data = (("Column A", "Column B", "Column C"),</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id616385699590945"> ("Row 1", 1, 2),</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id991638569959270"> ("Row 2", 3, 4),</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id381638569959454"> ("Row 3", 5, 6))</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id251638569959654">alignments = "LCC"</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id971638569959870">widths = (100, 50, 50)</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id571638569960094">table_control.SetTableData(table_data, widths, alignments)</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id601638569960326">dlg.Execute()</paragraph>
</pycode>
<pycode>
<paragraph role="pycode" localize="false" id="pyc_id311638651802570">bas = CreateScriptService("Basic")</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id121638651802186">row_values = table_control.Value</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id216386518024106">if len(row_values) == 0:</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id941638651802762"> bas.MsgBox("No row selected.")</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id491638651803057">else:</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id261638651804210"> bas.MsgBox(f"Row {table_control.ListIndex} is selected.")</paragraph>
</pycode>
</section>
<section id="WriteLine">
<comment> WriteLine -------------------------------------------------------------------------------------------- </comment>
<bookmark localize="false" branch="index" id="bm_id761598619892798">
<bookmark_value>DialogControl service;WriteLine</bookmark_value>
</bookmark>
<h2 id="hd_id961598619892816" localize="false">WriteLine</h2>
<paragraph role="paragraph" id="par_id671598619892378">Add a new line at the end of a multiline text field. A newline character will be inserted when appropriate. The method returns <literal>True</literal> when successful.</paragraph>
<paragraph role="paragraph" id="par_id941598619892915" xml-lang="en-US">An error is raised if the actual control is not of the type <literal>TextField</literal> or is not multiline.</paragraph>
<embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
<paragraph role="paragraph" localize="false" id="par_id841620310387185">
<input>svc.WriteLine(opt line: str): bool</input>
</paragraph>
<embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
<paragraph role="paragraph" id="par_id1001584541257789"><emph>Line</emph>: The string to insert. Default is an empty line.</paragraph>
<embed href="text/sbasic/shared/00000003.xhp#functexample"/>
<embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id681598619892624">Dim oDlg As Object, oControl As Object</paragraph>
<paragraph role="bascode" localize="false" id="bas_id521598619892148">Set oDlg = CreateScriptService("SFDialogs.Dialog",,, "myDialog")</paragraph>
<paragraph role="bascode" localize="false" id="bas_id391598619892465">Set oControl = oDlg.Controls("thisControl")</paragraph>
<paragraph role="bascode" localize="false" id="bas_id281598619892850">oControl.WriteLine("a new line")</paragraph>
</bascode>
<embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
<pycode>
<paragraph role="pycode" localize="false" id="pyc_id61620319410491">dlg = CreateScriptService('SFDialogs.Dialog', None, None, 'myDialog')</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id701620319411995">ctrl = dlg.Controls('thisControl')</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id591620319412507">ctr.WriteLine("a new line")</paragraph>
</pycode>
</section>
<embed href="text/sbasic/shared/03/lib_ScriptForge.xhp#SF_InternalUse"/>
<section id="relatedtopics">
<embed href="text/sbasic/shared/03/sf_dialog.xhp#dlg_h1"/>
<embed href="text/sbasic/shared/03/sf_string.xhp#StringService"/>
<embed href="text/sbasic/shared/03/sf_ui.xhp#UIService"/>
</section>
</body>
</helpdocument>