Files
help/source/text/sbasic/shared/03/sf_dialogcontrol.xhp
Alain Romedenne 6eca503da7 sf_Dialog(Control) Python support - part 2/2
- lowercased arguments reflect Python conventions
- supplemental Python code snippets

Change-Id: I8a8b10c3b56f539b5f7d75c389654a6772b0b659
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/115083
Tested-by: Jenkins
Tested-by: Jean-Pierre Ledure <jp@ledure.be>
Reviewed-by: Rafael Lima <rafael.palma.lima@gmail.com>
2021-05-19 13:59:19 +02:00

1178 lines
74 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" name="SFDialogs.DialogControl service"><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" name="Dialog Editor">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" name="Dialog service"><literal>SFDialogs.Dialog</literal></link> service.</tip>
<h2 id="hd_id581582885621841" xml-lang="en-US">Service invocation</h2>
<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>
<paragraph role="paragraph" id="par_id951598174966322" xml-lang="en-US">Alternatively a control instance can be retrieved via the <literal>SFDialogs.DialogEvent</literal> service, providing the dialog was initiated with the <literal>Dialog</literal> service. <literal>DialogEvent</literal> returns the <literal>SFDialogs.DialogControl</literal> class instance that triggered the event.</paragraph>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id311598175259794">Sub SomeEvent(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>
<pycode>
<paragraph role="pycode" localize="false" id="pyc_id921620228762243">def some_event(event: uno):</paragraph>
<paragraph role="pycode" localize="false" id="pyc_id181620228763531"> ctrl = 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 previous examples, the prefix <literal>"SFDialogs."</literal> may be omitted.</paragraph>
<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>
<list type="unordered">
<listitem>
<paragraph id="par_id121598455880500" localize="false" role="listitem">Button</paragraph>
</listitem>
<listitem>
<paragraph id="par_id441598455934376" localize="false" role="listitem">CheckBox</paragraph>
</listitem>
<listitem>
<paragraph id="par_id471598455940400" localize="false" role="listitem">ComboBox</paragraph>
</listitem>
<listitem>
<paragraph id="par_id181598455945642" localize="false" role="listitem">CurrencyField</paragraph>
</listitem>
<listitem>
<paragraph id="par_id181598455949653" localize="false" role="listitem">DateField</paragraph>
</listitem>
<listitem>
<paragraph id="par_id541598455953714" localize="false" role="listitem">FileControl</paragraph>
</listitem>
<listitem>
<paragraph id="par_id441598455957858" localize="false" role="listitem">FixedLine</paragraph>
</listitem>
<listitem>
<paragraph id="par_id971598455961404" localize="false" role="listitem">FixedText</paragraph>
</listitem>
<listitem>
<paragraph id="par_id721598455965612" localize="false" role="listitem">FormattedField</paragraph>
</listitem>
<listitem>
<paragraph id="par_id291598455969826" localize="false" role="listitem">GroupBox</paragraph>
</listitem>
<listitem>
<paragraph id="par_id861598455974724" localize="false" role="listitem">ImageControl</paragraph>
</listitem>
<listitem>
<paragraph id="par_id851598455979572" localize="false" role="listitem">ListBox</paragraph>
</listitem>
<listitem>
<paragraph id="par_id321598455984243" localize="false" role="listitem">NumericField</paragraph>
</listitem>
<listitem>
<paragraph id="par_id981598455990524" localize="false" role="listitem">PatternField</paragraph>
</listitem>
<listitem>
<paragraph id="par_id991598455998589" localize="false" role="listitem">ProgressBar</paragraph>
</listitem>
<listitem>
<paragraph id="par_id281598456002561" localize="false" role="listitem">RadioButton</paragraph>
</listitem>
<listitem>
<paragraph id="par_id91598456007438" localize="false" role="listitem">ScrollBar</paragraph>
</listitem>
<listitem>
<paragraph id="par_id271598456011504" localize="false" role="listitem">TextField</paragraph>
</listitem>
<listitem>
<paragraph id="par_id661598456015339" localize="false" role="listitem">TimeField</paragraph>
</listitem>
<listitem>
<paragraph id="par_id171612698897514" localize="false" role="listitem">TreeControl</paragraph>
<embed href="text/sbasic/shared/03/avail_release.xhp#7.2.control"/>
</listitem>
</list>
<h2 id="hd_id651583668365757" xml-lang="en-US">Properties</h2>
<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_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, 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" name="awt.tree.XMutableTreeNode">XmutableTreeNode</link> in Application Programming Interface (API) documentation for detailed information.</paragraph>
<embed href="text/sbasic/shared/03/avail_release.xhp#7.2.property"/>
</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</paragraph>
</tablecell>
<tablecell>
<paragraph role="paragraph" id="par_id151598177605296" xml-lang="en-US">Specifies the number of rows in a list box or a combo box.</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</paragraph>
</tablecell>
<tablecell>
<paragraph id="par_id251588334016874" role="tablecontent" xml-lang="en-US">Specifies which item is selected in a list box or combo box.</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" name="awt.tree.XMutableTreeNode">XmutableTreeNode</link> in Application Programming Interface (API) documentation for detailed information.</paragraph>
<embed href="text/sbasic/shared/03/avail_release.xhp#7.2.property"/>
</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_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_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_id81598540704978" name="Value property">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" name="awt.XControlModel">XControlModel</link> and <link href="https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1awt_1_1UnoControlDialogModel.html)" name="awt.XControlDialogModel">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" name="awt.XControl">XControl</link> and <link href="https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1awt_1_1UnoControlDialog.html)" name="awt.UnoControlDialog">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" name="awt.tree.XMutableTreeDataModel">XMutableTreeDataModel</link> in Application Programming Interface (API) documentation for detailed information.</paragraph>
<embed href="text/sbasic/shared/03/avail_release.xhp#7.2.property"/>
</tablecell>
</tablerow>
</table>
<h2 id="hd_id81598540704978" 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>
<paragraph id="par_id90159854325450" role="tablecontent" xml-lang="en-US"></paragraph>
</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>
<paragraph id="par_id421598543254587" role="tablecontent" xml-lang="en-US"></paragraph>
</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>
<paragraph id="par_id651598543254212" role="tablecontent" xml-lang="en-US"></paragraph>
</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>
<paragraph id="par_id161598543254662" role="tablecontent" xml-lang="en-US"></paragraph>
</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>
<paragraph id="par_id911598543254335" role="tablecontent" xml-lang="en-US"></paragraph>
</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_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>
<paragraph id="par_id881598543254964" role="tablecontent" xml-lang="en-US"></paragraph>
</tablecell>
</tablerow>
</table>
<h2 id="hd_id421612628828054" xml-lang="en-US">Event properties</h2>
<paragraph role="paragraph" id="par_id41612629140856" xml-lang="en-US">Returns a URI string with the reference to the script triggered by the event. Read its specification in the <link href="https://wiki.openoffice.org/wiki/Documentation/DevGuide/Scripting/Scripting_Framework_URI_Specification" name="URI specification">scripting framework URI specification</link>.</paragraph>
<embed href="text/sbasic/shared/03/avail_release.xhp#7.2.events"/>
<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>
<h2 id="hd_id421583670049913" xml-lang="en-US">Methods</h2>
<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" name="AddSubNode method">AddSubNode</link><br/>
<link href="text/sbasic/shared/03/sf_dialogcontrol.xhp#AddSubTree" name="AddSubTree method">AddSubTree</link>
</paragraph></tablecell>
<tablecell><paragraph id="par_id63161270911712" role="tablecontent" localize="false">
<link href="text/sbasic/shared/03/sf_dialogcontrol.xhp#CreateRoot" name="CreateRoot method">CreateRoot</link><br/>
<link href="text/sbasic/shared/03/sf_dialogcontrol.xhp#FindNode" name="FindNode method">FindNode</link>
</paragraph></tablecell>
<tablecell><paragraph id="par_id651612709117457" role="tablecontent" localize="false">
<link href="text/sbasic/shared/03/sf_dialogcontrol.xhp#SetFocus" name="SetFocus method">SetFocus</link><br/>
<link href="text/sbasic/shared/03/sf_dialogcontrol.xhp#WriteLine" name="WriteLine method">WriteLine</link>
</paragraph></tablecell>
</tablerow>
</table>
<embed href="text/sbasic/shared/03/avail_release.xhp#7.2.methods"/>
<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" name="awt.tree.XMutableTreeNode">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>
<h3 id="hd_id841612711823995" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
<paragraph role="paragraph" localize="false" id="par_id781620224364283"><input>svc.AddSubNode(parentnode: uno, displayvalue: str, opt datavalue: any): uno</input></paragraph>
<h3 id="hd_id261612711823446" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
<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>
<h3 id="hd_id931612711823178" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
<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>
<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>
<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"/>
<h3 id="hd_id781612713087790" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
<paragraph role="paragraph" localize="false" id="par_id731620308640671"><input>svc.AddSubTree(parentnode: uno, flattree: any, opt withdatavalue: bool): bool</input></paragraph>
<h3 id="hd_id791612713087478" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
<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>
<h3 id="hd_id781612713087851" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
<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>
<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>
<h3 id="hd_id211612780723578" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
<paragraph role="paragraph" localize="false" id="par_id991620309297239"><input>svc.CreateRoot(displayvalue: str, opt datavalue: any): uno</input></paragraph>
<h3 id="hd_id871612780723668" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
<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"/>
<h3 id="hd_id241612780723961" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
<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>
<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>
<h3 id="hd_id60161278158981" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
<paragraph role="paragraph" localize="false" id="par_id61620309668544"><input>svc.FindNode(displayvalue: str = '', opt datavalue: any, casesensitive = False): uno</input></paragraph>
<h3 id="hd_id771612781589667" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
<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" name="String service IsLike() method"><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>
<h3 id="hd_id41612781589546" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
<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>
<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="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>
<h3 id="hd_id61583933076171" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
<paragraph role="paragraph" localize="false" id="par_id11620310325234"><input>svc.SetFocus(): bool</input></paragraph>
<h3 id="hd_id26158393307687" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
<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>
<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="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>
<h3 id="hd_id761598619892682" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
<paragraph role="paragraph" localize="false" id="par_id841620310387185"><input>svc.WriteLine(opt line: str): bool</input></paragraph>
<bascode>
<paragraph role="bascode" localize="false" id="bas_id821598619892939">oControl.WriteLine([Line As String]) As Boolean</paragraph>
</bascode>
<h3 id="hd_id291584541257237" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
<paragraph role="paragraph" id="par_id1001584541257789"><emph>Line</emph>: The string to insert. Default is an empty line.</paragraph>
<h3 id="hd_id391598619892559" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
<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>
<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>