diff options
author | flywire <flywire0@gmail.com> | 2021-11-30 04:50:48 +0200 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@libreoffice.org> | 2021-12-16 14:43:43 +0100 |
commit | 35a43adc47edcaeecaae1db790edefb3f181d948 (patch) | |
tree | 84ea18a5baa1f1a032e8d14065064f0505926015 /source | |
parent | 764b7d243a5b02b0beb981633291f4f73854197c (diff) |
Consistent ScriptForge Examples Variable Names
- ui for UI service
- bas for Basic service
Change-Id: I0eb4fbdd021db1149985bb37ba8b29a57297a6eb
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/126092
Tested-by: Jenkins
Reviewed-by: Rafael Lima <rafael.palma.lima@gmail.com>
(cherry picked from commit 4156bb3b6cfcecb9ccce1ef5c7656d67df93b5c9)
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/126934
Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Diffstat (limited to 'source')
-rw-r--r-- | source/text/sbasic/shared/03/sf_basic.xhp | 76 | ||||
-rw-r--r-- | source/text/sbasic/shared/03/sf_calc.xhp | 28 | ||||
-rw-r--r-- | source/text/sbasic/shared/03/sf_database.xhp | 20 | ||||
-rw-r--r-- | source/text/sbasic/shared/03/sf_form.xhp | 10 | ||||
-rw-r--r-- | source/text/sbasic/shared/03/sf_formcontrol.xhp | 15 | ||||
-rw-r--r-- | source/text/sbasic/shared/03/sf_ui.xhp | 44 | ||||
-rw-r--r-- | source/text/sbasic/shared/03/sf_writer.xhp | 6 |
7 files changed, 97 insertions, 102 deletions
diff --git a/source/text/sbasic/shared/03/sf_basic.xhp b/source/text/sbasic/shared/03/sf_basic.xhp index 01acfac5ca..a5d6352022 100644 --- a/source/text/sbasic/shared/03/sf_basic.xhp +++ b/source/text/sbasic/shared/03/sf_basic.xhp @@ -24,18 +24,17 @@ <h1 id="hd_id731582733781114" xml-lang="en-US"><variable id="BasicService"><link href="text/sbasic/shared/03/sf_basic.xhp" name="Basic service"><literal>ScriptForge</literal>.<literal>Basic</literal> service</link></variable></h1> <paragraph role="paragraph" id="par_id381589189355849" xml-lang="en-US">The <literal>ScriptForge.Basic</literal> service proposes a collection of %PRODUCTNAME Basic methods to be executed in a Python context. <literal>Basic</literal> service methods reproduce the exact syntax and behaviour of Basic builtin functions. </paragraph> - <embed href="text/sbasic/shared/03/avail_release.xhp#7.2.service"/> </section> <paragraph role="paragraph" id="par_id591589189364267" xml-lang="en-US">Typical example:</paragraph> <pycode> - <paragraph role="pycode" xml-lang="en-US" id="pyc_id971618493778666">svc.MsgBox('This has to be displayed in a message box')</paragraph> + <paragraph role="pycode" id="pyc_id971618493778666">bas.MsgBox('Display this text in a message box from a Python script')</paragraph> </pycode> <warning id="par_id151618849022977"><literal>ScriptForge</literal>.<literal>Basic</literal> service is limited to Python scripts.</warning> <h2 id="hd_id581582885621841" xml-lang="en-US">Service invocation</h2> <paragraph role="paragraph" id="par_id141610734722352">Before using the <literal>Basic</literal> service, import the <literal>CreateScriptService()</literal> method from the <literal>scriptforge</literal> module:</paragraph> <pycode> <paragraph role="pycode" localize="false" id="pyc_id551610734764343">from scriptforge import CreateScriptService</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id121618496552817">svc = CreateScriptService("Basic")</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id121618496552817">bas = CreateScriptService("Basic")</paragraph> </pycode> <h2 id="hd_id201618922972557">Properties</h2> <table id="tab_id991618922991909"> @@ -177,9 +176,9 @@ <embed href="text/sbasic/shared/03100300.xhp#CDate_str_date"/> <embed href="text/sbasic/shared/00000003.xhp#functexample"/> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id761621898860952">d = svc.CDate(1000.25)</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id861621898933001">svc.MsgBox(str(d)) # 1902-09-26 06:00:00</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id871621898933281">svc.MsgBox(d.year) # 1902</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id761621898860952">d = bas.CDate(1000.25)</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id861621898933001">bas.MsgBox(str(d)) # 1902-09-26 06:00:00</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id871621898933281">bas.MsgBox(d.year) # 1902</paragraph> </pycode> </section> @@ -204,8 +203,8 @@ <paragraph role="pycode" localize="false" id="pyc_id711621951947956">uno_date.Year = 1983</paragraph> <paragraph role="pycode" localize="false" id="pyc_id1001621951948124">uno_date.Month = 2</paragraph> <paragraph role="pycode" localize="false" id="pyc_id201621951948284">uno_date.Day = 23</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id911621952103058">new_date = svc.CDateFromUnoDateTime(uno_date)</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id951621952103813">svc.MsgBox(str(new_date)) # 1983-02-23 00:00:00</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id911621952103058">new_date = bas.CDateFromUnoDateTime(uno_date)</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id951621952103813">bas.MsgBox(str(new_date)) # 1983-02-23 00:00:00</paragraph> </pycode> </section> @@ -226,8 +225,8 @@ <pycode> <paragraph role="pycode" localize="false" id="pyc_id131621952700723">from datetime import datetime</paragraph> <paragraph role="pycode" localize="false" id="pyc_id391621952700963">current_datetime = datetime.now()</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id941621952701150">uno_date = svc.CDateToUnoDateTime(current_datetime)</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id191621952701458">svc.MsgBox(str(uno_date.Year) + "-" + str(uno_date.Month) + "-" + str(uno_date.Day))</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id941621952701150">uno_date = bas.CDateToUnoDateTime(current_datetime)</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id191621952701458">bas.MsgBox(str(uno_date.Year) + "-" + str(uno_date.Month) + "-" + str(uno_date.Day))</paragraph> </pycode> </section> @@ -246,8 +245,8 @@ <paragraph role="paragraph" id="par_id81618502493505">A system path file name.</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functexample"/> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id41158919969836">filename = svc.ConvertFromUrl( "file:///C:/Program%20Files%20(x86)/LibreOffice/News.txt")</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id881611147617212">svc.MsgBox(filename)</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id41158919969836">filename = bas.ConvertFromUrl( "file:///C:/Program%20Files%20(x86)/LibreOffice/News.txt")</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id881611147617212">bas.MsgBox(filename)</paragraph> </pycode> </section> @@ -266,8 +265,8 @@ <paragraph role="paragraph" id="par_id61658101307414">A <literal>file:</literal> URL as a string.</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functexample"/> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id891985200121516">url = svc.ConvertToUrl( 'C:\Program Files(x86)\LibreOffice\News.txt')</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id51589200605125">svc.MsgBox(url)</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id891985200121516">url = bas.ConvertToUrl( 'C:\Program Files(x86)\LibreOffice\News.txt')</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id51589200605125">bas.MsgBox(url)</paragraph> </pycode> </section> @@ -284,7 +283,7 @@ <paragraph role="paragraph" id="par_id361589200121646"><emph>servicename</emph>: A fully qualified service name such as <literal>com.sun.star.ui.dialogs.FilePicker</literal> or <literal>com.sun.star.sheet.FunctionAccess</literal>.</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functexample"/> <pycode> - <paragraph role="bascode" localize="false" id="pyc_id891589200121516">dsk = svc.CreateUnoService('com.sun.star.frame.Desktop')</paragraph> + <paragraph role="bascode" localize="false" id="pyc_id891589200121516">dsk = bas.CreateUnoService('com.sun.star.frame.Desktop')</paragraph> </pycode> </section> @@ -307,7 +306,7 @@ <embed href="text/sbasic/shared/00000003.xhp#functexample"/> <pycode> <paragraph role="pycode" localize="false" id="pyc_id961618558341526">dt = datetime.datetime(2004, 1, 31)</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id891599410846998">dt = svc.DateAdd("m", 1, dt)</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id891599410846998">dt = bas.DateAdd("m", 1, dt)</paragraph> <paragraph role="pycode" localize="false" id="pyc_id621599410266932">print(dt)</paragraph> </pycode> </section> @@ -331,7 +330,7 @@ <pycode> <paragraph role="pycode" localize="false" id="pyc_id401611153339973">date1 = datetime.datetime(2005,1, 1)</paragraph> <paragraph role="pycode" localize="false" id="pyc_id121589202413630">date2 = datetime.datetime(2005,12,31)</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id641618564383315">diffDays = svc.DateDiff('d', date1, date2)</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id641618564383315">diffDays = bas.DateDiff('d', date1, date2)</paragraph> <paragraph role="pycode" localize="false" id="pyc_id151618564392035">print(diffDays)</paragraph> </pycode> </section> @@ -353,8 +352,8 @@ <paragraph role="paragraph" id="par_id791618672371743">The extracted part for the given date/time.</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functexample"/> <pycode> - <paragraph role="bascode" localize="false" id="pyc_id31589202925376">print(svc.DatePart("ww", datetime.datetime(2005,12,31)</paragraph> - <paragraph role="bascode" localize="false" id="pyc_id821589203188905">print(svc.DatePart('q', datetime.datetime(1999,12,30)</paragraph> + <paragraph role="bascode" localize="false" id="pyc_id31589202925376">print(bas.DatePart("ww", datetime.datetime(2005,12,31)</paragraph> + <paragraph role="bascode" localize="false" id="pyc_id821589203188905">print(bas.DatePart('q', datetime.datetime(1999,12,30)</paragraph> </pycode> </section> @@ -373,7 +372,7 @@ <paragraph role="paragraph" id="par_id441618674018955">The computed date.</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functexample"/> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id81589203370943">dt = svc.DateValue("23-02-2011")</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id81589203370943">dt = bas.DateValue("23-02-2011")</paragraph> <paragraph role="pycode" localize="false" id="pyc_id931618674563379">print(dt)</paragraph> </pycode> </section> @@ -395,7 +394,7 @@ <embed href="text/sbasic/shared/00000003.xhp#languageformat"/> <embed href="text/sbasic/shared/00000003.xhp#functexample"/> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id431589205147164">txt = svc.Format(6328.2, '##.##0.00')</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id431589205147164">txt = bas.Format(6328.2, '##.##0.00')</paragraph> <paragraph role="pycode" localize="false" id="pyc_id231618679147769">print(txt)</paragraph> </pycode> </section> @@ -414,7 +413,7 @@ <paragraph role="paragraph" id="par_id381618831451271">The default component context is used, when instantiating services via <literal>XMultiServiceFactory</literal>. See the <literal>Professional UNO</literal> chapter in the Developer's Guide on <link href="https://api.libreoffice.org/" name="API Developer's Guide">api.libreoffice.org</link> for more information.</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functexample"/> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id451389205147164">ctx = svc.GetDefaultContext()</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id451389205147164">ctx = bas.GetDefaultContext()</paragraph> </pycode> </section> @@ -430,7 +429,7 @@ <paragraph role="paragraph" id="par_id109668178405855" localize="false"><input>svc.GetGuiType(): int</input></paragraph> <embed href="text/sbasic/shared/00000003.xhp#functexample"/> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id154389205147164">n = svc.GetGuiType()</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id154389205147164">n = bas.GetGuiType()</paragraph> </pycode> </section> @@ -444,12 +443,9 @@ <paragraph role="paragraph" id="par_id341618848562340">Use <literal>os.pathsep</literal> from <literal>os</literal> Python module to <link href="text/sbasic/python/python_platform.xhp" name="path delimiter">identify the path separator</link>.</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/> <paragraph role="paragraph" id="par_id901668178405558" localize="false"><input>svc.GetPathSeparator(): str</input></paragraph> - <pycode> - <paragraph role="pycode" localize="false" id="pyc_id53158950247542">svc.GetPathSeparator(): str</paragraph> - </pycode> <embed href="text/sbasic/shared/00000003.xhp#functexample"/> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id451389205147461">sep = svc.GetPathSeparator()</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id451389205147461">sep = bas.GetPathSeparator()</paragraph> </pycode> </section> @@ -464,10 +460,10 @@ <paragraph role="paragraph" id="par_id901667188405855" localize="false"><input>svc.GetSystemTicks(): int</input></paragraph> <embed href="text/sbasic/shared/00000003.xhp#functexample"/> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id251619448108905">ticks_ini = svc.GetSystemTicks()</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id251619448108905">ticks_ini = bas.GetSystemTicks()</paragraph> <paragraph role="pycode" localize="false" id="pyc_id181619448111210">time.sleep(1)</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id301619448111744">ticks_end = svc.GetSystemTicks()</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id651619448112320">svc.MsgBox("{} - {} = {}".format(ticks_end, ticks_ini,ticks_end - ticks_ini))</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id301619448111744">ticks_end = bas.GetSystemTicks()</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id651619448112320">bas.MsgBox("{} - {} = {}".format(ticks_end, ticks_ini,ticks_end - ticks_ini))</paragraph> </pycode> </section> @@ -488,7 +484,7 @@ <embed href="text/sbasic/shared/00000003.xhp#functexample"/> <paragraph role="paragraph" id="par_id281622398076950">The following example loads the Gimmicks Basic library if it has not been loaded yet.</paragraph> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id301622397623041">libs = svc.GlobalScope.BasicLibraries()</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id301622397623041">libs = bas.GlobalScope.BasicLibraries()</paragraph> <paragraph role="pycode" localize="false" id="pyc_id841622397623202">if not libs.isLibraryLoaded("Gimmicks"):</paragraph> <paragraph role="pycode" localize="false" id="pyc_id621622397623352"> libs.loadLibrary("Gimmicks")</paragraph> </pycode> @@ -511,9 +507,9 @@ <embed href="text/sbasic/shared/00000003.xhp#functexample"/> <paragraph role="paragraph" id="par_id811622398234384">The following example shows a message box with the names of all available dialog libraries.</paragraph> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id561622398178727">dlg_libs = svc.GlobalScope.DialogLibraries()</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id561622398178727">dlg_libs = bas.GlobalScope.DialogLibraries()</paragraph> <paragraph role="pycode" localize="false" id="pyc_id181622398179079">lib_names = dlg_libs.getElementNames()</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id461622398179232">svc.MsgBox("\n".join(lib_names))</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id461622398179232">bas.MsgBox("\n".join(lib_names))</paragraph> </pycode> </section> @@ -547,7 +543,7 @@ <h2 id="hd_id181618br/905397758" localize="false">MsgBox</h2> <paragraph role="paragraph" id="par_id231618922407948">Displays a dialog box containing a message and returns an optional value.<br/>MB_xx constants help specify the dialog type, the number and type of buttons to display, plus the icon type. By adding their respective values they form bit patterns, that define the <literal>MsgBox</literal> dialog appearance.</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/> - <paragraph role="paragraph" id="par_id71618922431508" localize="false"><input>svc.MsgBox(prompt: str, [buttons: int], [title: str])[: int]</input></paragraph> + <paragraph role="paragraph" id="par_id71618922431508" localize="false"><input>bas.MsgBox(prompt: str, [buttons: int], [title: str])[: int]</input></paragraph> <embed href="text/sbasic/shared/00000003.xhp#functparameters"/> <embed href="text/sbasic/shared/03010101.xhp#parameters"/> <embed href="text/sbasic/shared/00000003.xhp#functvalue"/> @@ -567,7 +563,7 @@ <paragraph role="paragraph" id="par_id631619084685488" localize="false"><input>svc.Now(): datetime</input></paragraph> <embed href="text/sbasic/shared/00000003.xhp#functexample"/> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id411619084749448">svc.MsgBox(svc.Now(), svc.MB_OK, "Now")</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id411619084749448">bas.MsgBox(bas.Now(), bas.MB_OK, "Now")</paragraph> </pycode> </section> @@ -586,7 +582,7 @@ <paragraph role="paragraph" localize="false" id="par_id381619096830033">Integer</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functexample"/> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id321619096903721">YELLOW = svc.RGB(255,255,0)</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id321619096903721">YELLOW = bas.RGB(255,255,0)</paragraph> </pycode> </section> @@ -604,8 +600,8 @@ </paragraph> <embed href="text/sbasic/shared/00000003.xhp#functexample"/> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id21622841338969">comp = svc.ThisComponent</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id781622841643538">svc.MsgBox("\n".join(comp.getSupportedServiceNames()))</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id21622841338969">comp = bas.ThisComponent</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id781622841643538">bas.MsgBox("\n".join(comp.getSupportedServiceNames()))</paragraph> </pycode> </section> @@ -623,7 +619,7 @@ </paragraph> <embed href="text/sbasic/shared/00000003.xhp#functexample"/> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id761622913418091">db_doc = svc.ThisDatabaseDocument</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id761622913418091">db_doc = bas.ThisDatabaseDocument</paragraph> <paragraph role="pycode" localize="false" id="pyc_id201622913418646">table_names = db_doc.DataSource.getTables().getElementNames()</paragraph> <paragraph role="pycode" localize="false" id="pyc_id711622913418917">bas.MsgBox("\n".join(table_names))</paragraph> </pycode> @@ -643,7 +639,7 @@ <paragraph role="paragraph" id="par_id21619094660345"><emph>obj</emph>: A variable or UNO object.</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functexample"/> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id751619095024401">svc.Xray(svc.StarDesktop)</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id751619095024401">bas.Xray(bas.StarDesktop)</paragraph> </pycode> </section> diff --git a/source/text/sbasic/shared/03/sf_calc.xhp b/source/text/sbasic/shared/03/sf_calc.xhp index 68a20ff429..56b4590229 100644 --- a/source/text/sbasic/shared/03/sf_calc.xhp +++ b/source/text/sbasic/shared/03/sf_calc.xhp @@ -75,11 +75,11 @@ <paragraph role="pycode" localize="false" id="pyc_id911621624242302">myDoc = CreateScriptService("Calc")</paragraph> </pycode> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id201621531742824">svcUI = CreateScriptService("UI")</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id661621531772444">myDoc = svcUI.CreateDocument("Calc")</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id201621531742824">ui = CreateScriptService("UI")</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id661621531772444">myDoc = ui.CreateDocument("Calc")</paragraph> </pycode> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id401621531828705">myDoc = svcUI.OpenDocument(r"C:\Documents\MyFile.ods")</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id401621531828705">myDoc = ui.OpenDocument(r"C:\Documents\MyFile.ods")</paragraph> </pycode> <pycode> <paragraph role="pycode" localize="false" id="pyc_id701621532481401">myDoc = CreateScriptService("SFDocuments.Calc", "MyFile.ods")</paragraph> @@ -109,8 +109,8 @@ </bascode> <embed href="text/sbasic/shared/00000003.xhp#In_Python"/> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id561621533543160">docA = svcUI.OpenDocument(r"C:\Documents\FileA.ods", hidden = True, readonly = True)</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id61621533637980">docB = svcUI.OpenDocument(r"C:\Documents\FileB.ods")</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id561621533543160">docA = ui.OpenDocument(r"C:\Documents\FileA.ods", hidden = True, readonly = True)</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id61621533637980">docB = ui.OpenDocument(r"C:\Documents\FileB.ods")</paragraph> <paragraph role="pycode" localize="false" id="pyc_id941621533638353">docB.CopyToRange(docA.Range("SheetX.D4:F8"), "D2:F6")</paragraph> </pycode> @@ -616,8 +616,8 @@ </bascode> <embed href="text/sbasic/shared/00000003.xhp#In_Python"/> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id321621534175071">svcUI = CreateScriptService("UI")</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id971621534192346">myDoc = svcUI.GetDocument(svcUI.ActiveWindow)</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id321621534175071">ui = CreateScriptService("UI")</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id971621534192346">myDoc = ui.GetDocument(ui.ActiveWindow)</paragraph> <paragraph role="pycode" localize="false" id="pyc_id21621534237588">myDoc.Activate("Sheet4")</paragraph> </pycode> <tip id="par_id501611617808220">Activating a sheet makes sense only if it is performed on a Calc document. To make sure you have a Calc document at hand you can use the <literal>isCalc</literal> property of the document object, which returns <literal>True</literal> if it is a Calc document and <literal>False</literal> otherwise.</tip> @@ -779,8 +779,8 @@ <paragraph role="pycode" localize="false" id="pyc_id741621537296168">myDoc.CopySheet("SheetX", "SheetY")</paragraph> </pycode> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id761621537335378">docA = svcUI.OpenDocument(r"C:\Documents\FileA.ods", hidden = True, readonly = True)</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id801621537405452">docB = svcUI.OpenDocument(r"C:\Documents\FileB.ods")</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id761621537335378">docA = ui.OpenDocument(r"C:\Documents\FileA.ods", hidden = True, readonly = True)</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id801621537405452">docB = ui.OpenDocument(r"C:\Documents\FileB.ods")</paragraph> <paragraph role="pycode" localize="false" id="pyc_id361621537425882">docB.CopySheet(docA.Sheet("SheetX"), "SheetY")</paragraph> </pycode> <tip id="par_id801595695285478" xml-lang="en-US">To copy sheets between <emph>open</emph> documents, use <literal>CopySheet</literal>. To copy sheets from documents that are <emph>closed</emph>, use <literal>CopySheetFromFile</literal>.</tip> @@ -850,7 +850,7 @@ </bascode> <embed href="text/sbasic/shared/00000003.xhp#In_Python"/> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id531621538188012">docSource = svcUI.OpenDocument(r"C:\Documents\SourceFile.ods", hidden = True, readonly = True)</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id531621538188012">docSource = ui.OpenDocument(r"C:\Documents\SourceFile.ods", hidden = True, readonly = True)</paragraph> <paragraph role="pycode" localize="false" id="pyc_id741621538288187">docDestination = CreateScriptService("Calc")</paragraph> <paragraph role="pycode" localize="false" id="pyc_id691621538280854">docDestination.CopyToCell(docSource.Range("Sheet1.C2:C4"), "SheetT.A5")</paragraph> <paragraph role="pycode" localize="false" id="pyc_id361621538357798">docSource.CloseDocument()</paragraph> @@ -900,8 +900,8 @@ <paragraph role="pycode" localize="false" id="pyc_id761621538667290">doc.CopyToRange("SheetX.A1:F10", "SheetY.C5:J5")</paragraph> </pycode> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id531621538188957">docA = svcUI.OpenDocument(r"C:\Documents\FileA.ods", hidden = True, readonly = True)</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id741621538288785">docB = svcUI.OpenDocument(r"C:\Documents\FileB.ods")</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id531621538188957">docA = ui.OpenDocument(r"C:\Documents\FileA.ods", hidden = True, readonly = True)</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id741621538288785">docB = ui.OpenDocument(r"C:\Documents\FileB.ods")</paragraph> <paragraph role="pycode" localize="false" id="pyc_id691621538288954">docB.CopyToRange(docA.Range("SheetX.A1:F10"), "SheetY.C5:J5")</paragraph> </pycode> </section> @@ -1043,8 +1043,8 @@ </bascode> <embed href="text/sbasic/shared/00000003.xhp#In_Python"/> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id661621539873908">sBasic = CreateScriptService("Basic")</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id901621540022229">sBasic.MsgBox(myDoc.GetColumnName(3))</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id661621539873908">bas = CreateScriptService("Basic")</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id901621540022229">bas.MsgBox(myDoc.GetColumnName(3))</paragraph> </pycode> <note id="par_id451611753568778">The maximum number of columns allowed on a Calc sheet is 1024.</note> </section> diff --git a/source/text/sbasic/shared/03/sf_database.xhp b/source/text/sbasic/shared/03/sf_database.xhp index 890b42a3df..f788aa48d3 100644 --- a/source/text/sbasic/shared/03/sf_database.xhp +++ b/source/text/sbasic/shared/03/sf_database.xhp @@ -287,12 +287,12 @@ <embed href="text/sbasic/shared/00000003.xhp#In_Python"/> <pycode> <paragraph role="pycode" localize="false" id="pyc_id641625700473857">myDB = CreateScriptService("Database", "/home/user/Databases/Employees.odb")</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id611625700474124">svc = CreateScriptService("Basic")</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id991625700474287">svc.MsgBox(myDB.DCount("[ID]", "EmployeeData"))</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id321625700474470">svc.MsgBox(myDB.DSum("[Salary]", "EmployeeData"))</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id811625700474663">svc.MsgBox(myDB.DCount("[ID]", "EmployeeData", "[Position] = 'Manager'"))</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id421625700474895">svc.MsgBox(myDB.DCount("[ID]", "EmployeeData", "[Position] = 'Sales' AND [City] = 'Chicago'"))</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id441625700475239">svc.MsgBox(myDB.DCount("[ID]", "EmployeeData", "[FirstName] LIKE 'Paul%'"))</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id611625700474124">bas = CreateScriptService("Basic")</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id991625700474287">bas.MsgBox(myDB.DCount("[ID]", "EmployeeData"))</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id321625700474470">bas.MsgBox(myDB.DSum("[Salary]", "EmployeeData"))</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id811625700474663">bas.MsgBox(myDB.DCount("[ID]", "EmployeeData", "[Position] = 'Manager'"))</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id421625700474895">bas.MsgBox(myDB.DCount("[ID]", "EmployeeData", "[Position] = 'Sales' AND [City] = 'Chicago'"))</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id441625700475239">bas.MsgBox(myDB.DCount("[ID]", "EmployeeData", "[FirstName] LIKE 'Paul%'"))</paragraph> </pycode> </section> @@ -322,10 +322,10 @@ </bascode> <embed href="text/sbasic/shared/00000003.xhp#In_Python"/> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id151625701420880">svc = CreateScriptService("Basic")</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id181625701421328">svc.MsgBox(myDB.DLookup("[FirstName]", "EmployeeData", criteria = "[LastName] LIKE 'Smith'", orderclause = "[FirstName] DESC"))</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id801625701421784">svc.MsgBox(myDB.DLookup("[Salary]", "EmployeeData", criteria = "[ID] = '3'"))</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id551625701422176">svc.MsgBox(myDB.DLookup("[Quantity] * [Value]", "Sales", criteria = "[SaleID] = '5014'"))</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id151625701420880">bas = CreateScriptService("Basic")</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id181625701421328">bas.MsgBox(myDB.DLookup("[FirstName]", "EmployeeData", criteria = "[LastName] LIKE 'Smith'", orderclause = "[FirstName] DESC"))</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id801625701421784">bas.MsgBox(myDB.DLookup("[Salary]", "EmployeeData", criteria = "[ID] = '3'"))</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id551625701422176">bas.MsgBox(myDB.DLookup("[Quantity] * [Value]", "Sales", criteria = "[SaleID] = '5014'"))</paragraph> </pycode> </section> diff --git a/source/text/sbasic/shared/03/sf_form.xhp b/source/text/sbasic/shared/03/sf_form.xhp index 9d0a88eacc..f797f3bf01 100644 --- a/source/text/sbasic/shared/03/sf_form.xhp +++ b/source/text/sbasic/shared/03/sf_form.xhp @@ -73,8 +73,8 @@ <embed href="text/sbasic/shared/00000003.xhp#In_Python"/> <pycode> <paragraph role="pycode" localize="false" id="pyc_id241622014444493">from scriptforge import CreateScriptService</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id391622014212514">svc = CreateScriptService('UI') </paragraph> - <paragraph role="pycode" localize="false" id="pyc_id891622014222625">doc = svc.OpenDocument('/home/user/Documents/MyForm.odt')</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id391622014212514">ui = CreateScriptService('UI') </paragraph> + <paragraph role="pycode" localize="false" id="pyc_id891622014222625">doc = ui.OpenDocument('/home/user/Documents/MyForm.odt')</paragraph> <paragraph role="pycode" localize="false" id="pyc_id931622014224129">my_form = doc.Forms('Form1')</paragraph> </pycode> <paragraph role="paragraph" id="par_id531618179517628">Forms can be accessed by their names or by their indices, as shown below:</paragraph> @@ -96,8 +96,8 @@ </bascode> <paragraph role="paragraph" id="par_id51622028165429">This is achieved identically using Python:</paragraph> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id871622021672708">svc = CreateScriptService('UI')</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id671622021672931">doc = svc.OpenDocument('/home/user/Documents/MyForms.ods')</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id871622021672708">ui = CreateScriptService('UI')</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id671622021672931">doc = ui.OpenDocument('/home/user/Documents/MyForms.ods')</paragraph> <paragraph role="pycode" localize="false" id="pyc_id301622021673180">my_form = doc.Forms('Sheet1', 'Form1')</paragraph> </pycode> <h3 id="hd_id201618180055756">In Base documents</h3> @@ -784,7 +784,7 @@ <h2 id="hd_id551616864216705" localize="false">Requery</h2> <paragraph role="paragraph" id="par_id811616864216529" xml-lang="en-US">Reloads the current data from the database and refreshes the form. The cursor is positioned on the first record. Returns <literal>True</literal> if successful.</paragraph> <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/> - <paragraph role="paragraph" localize="false" id="par_id731622550132517">svc.Requery(): bool</paragraph> + <paragraph role="paragraph" localize="false" id="par_id731622550132517"><input>svc.Requery(): bool</input></paragraph> <embed href="text/sbasic/shared/00000003.xhp#functexample"/> <bascode> <paragraph role="bascode" localize="false" id="bas_id211616864216116">myForm.Requery() ' Basic</paragraph> diff --git a/source/text/sbasic/shared/03/sf_formcontrol.xhp b/source/text/sbasic/shared/03/sf_formcontrol.xhp index 2fcca6b292..19a79df9fb 100644 --- a/source/text/sbasic/shared/03/sf_formcontrol.xhp +++ b/source/text/sbasic/shared/03/sf_formcontrol.xhp @@ -41,7 +41,6 @@ <paragraph role="paragraph" id="par_id81618774023346">All controls have a <literal>Value</literal> property. However, its contents will vary according to the control type. For more information, read <link href="text/sbasic/shared/03/sf_formcontrol.xhp#hd_id81598540704978" name="Value property">The <literal>Value</literal> Property</link> below.</paragraph> <paragraph role="paragraph" id="par_id881618771651907">It is also possible to format the controls via the <literal>XControlModel</literal> and <literal>XControlView</literal> properties.</paragraph> <tip id="par_id891598188164936" xml-lang="en-US">The <literal>SFDocuments.FormControl</literal> service is closely related to the <link href="text/sbasic/shared/03/sf_form.xhp" name="Form service"><literal>SFDocuments.Form</literal></link> service.</tip> - <embed href="text/sbasic/shared/03/avail_release.xhp#7.2.service"/> <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> @@ -1105,8 +1104,8 @@ </bascode> <embed href="text/sbasic/shared/00000003.xhp#In_Python"/> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id51623154762285">ui = CreateScriptService('ScriptForge.Basic')</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id571622559687626">doc = CreateScriptService('SFDocuments.Document', ui.ThisComponent)</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id51623154762285">bas = CreateScriptService('ScriptForge.Basic')</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id571622559687626">doc = CreateScriptService('SFDocuments.Document', bas.ThisComponent)</paragraph> <paragraph role="pycode" localize="false" id="pyc_id231622559687813">form = doc.Forms(0)</paragraph> <paragraph role="pycode" localize="false" id="pyc_id891622559687994">control = form.Controls('thisControl') # SFDocuments.FormControl</paragraph> <paragraph role="pycode" localize="false" id="pyc_id801622560297771">control.SetFocus()</paragraph> @@ -1126,8 +1125,8 @@ </bascode> <embed href="text/sbasic/shared/00000003.xhp#In_Python"/> <pycode> - <paragraph role="pycode" id="pyc_id991622562833004">ui = CreateScriptService('ScriptForge.Basic') # Basic-like methods</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id321622561047923">doc = CreateScriptService('SFDocuments.Document', ui.ThisDatabaseDocument)</paragraph> + <paragraph role="pycode" id="pyc_id991622562833004">bas = CreateScriptService('ScriptForge.Basic') # Basic-like methods</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id321622561047923">doc = CreateScriptService('SFDocuments.Document', bas.ThisDatabaseDocument)</paragraph> <paragraph role="pycode" localize="false" id="pyc_id321622561048131">form = doc.Forms('formDocumentName', 'formName')</paragraph> <paragraph role="pycode" localize="false" id="pyc_id1001622561048346">lbl_city = form.Controls('labelCity')</paragraph> <paragraph role="pycode" localize="false" id="pyc_id151622561048563">combo_city = form.Controls('comboboxCity')</paragraph> @@ -1150,14 +1149,14 @@ </bascode> <embed href="text/sbasic/shared/00000003.xhp#In_Python"/> <pycode> - <paragraph role="pycode" id="pyc_id991622562822004">ui = CreateScriptService('ScriptForge.Basic') # Basic-like methods</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id681622562079356">doc = CreateScriptService('SFDocuments.Document', ui.ThisDatabaseDocument)</paragraph> + <paragraph role="pycode" id="pyc_id991622562822004">bas = CreateScriptService('ScriptForge.Basic') # Basic-like methods</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id681622562079356">doc = CreateScriptService('SFDocuments.Document', bas.ThisDatabaseDocument)</paragraph> <paragraph role="pycode" localize="false" id="pyc_id941622562079539">form = doc.Forms('formDocumentName', 'formName')</paragraph> <paragraph role="pycode" localize="false" id="pyc_id741622562079722">radio_buttons = ['optA', 'optB', 'optC']</paragraph> <paragraph role="pycode" localize="false" id="pyc_id901622562079883">for name in radio_buttons:</paragraph> <paragraph role="pycode" localize="false" id="pyc_id51622562080068"> control = form.controls(name)</paragraph> <paragraph role="pycode" localize="false" id="pyc_id361622562080243"> if control.Value == True:</paragraph> - <paragraph role="pycode" id="pyc_id441622562080419"> ui.MsgBox('Selected option: ' + control.Caption)</paragraph> + <paragraph role="pycode" id="pyc_id441622562080419"> bas.MsgBox('Selected option: ' + control.Caption)</paragraph> <paragraph role="pycode" localize="false" id="pyc_id61622563076603"> break</paragraph> </pycode> <embed href="text/sbasic/shared/03/lib_ScriptForge.xhp#SF_InternalUse"/> diff --git a/source/text/sbasic/shared/03/sf_ui.xhp b/source/text/sbasic/shared/03/sf_ui.xhp index b3c1443f8e..03593c7f57 100644 --- a/source/text/sbasic/shared/03/sf_ui.xhp +++ b/source/text/sbasic/shared/03/sf_ui.xhp @@ -87,7 +87,7 @@ <embed href="text/sbasic/shared/00000003.xhp#In_Python"/> <pycode> <paragraph role="pycode" localize="false" id="pyc_id61620310677393">from scriptforge import CreateScriptService</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id601620310674922">svcUI = CreateScriptService("UI")</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id601620310674922">ui = CreateScriptService("UI")</paragraph> </pycode> <h2 id="hd_id841587913266618" xml-lang="en-US">Properties</h2> @@ -200,11 +200,11 @@ </bascode> <embed href="text/sbasic/shared/00000003.xhp#In_Python"/> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id21620312350189">svcUI = CreateScriptService("UI")</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id631620312351013">sBasic = CreateScriptService("Basic")</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id141620312351286">openDocs = svcUI.Documents()</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id21620312350189">ui = CreateScriptService("UI")</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id631620312351013">bas = CreateScriptService("Basic")</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id141620312351286">openDocs = ui.Documents()</paragraph> <paragraph role="pycode" localize="false" id="pyc_id661620312351500">strDocs = "\n".join(openDocs)</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id801620312351676">sBasic.MsgBox(strDocs)</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id801620312351676">bas.MsgBox(strDocs)</paragraph> </pycode> <table id="tab_id891606472825856"> @@ -254,7 +254,7 @@ </bascode> <embed href="text/sbasic/shared/00000003.xhp#In_Python"/> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id941620322846267">svcUI.Activate(r"C:\Documents\My file.odt")</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id941620322846267">ui.Activate(r"C:\Documents\My file.odt")</paragraph> </pycode> </section> @@ -284,8 +284,8 @@ </bascode> <embed href="text/sbasic/shared/00000003.xhp#In_Python"/> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id361620323808010">myBase = svcUI.CreateBaseDocument(r"C:\Databases\MyBaseFile.odb", "FIREBIRD")</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id251629365641121">myCalcBase = svcUI.CreateBaseDocument(r"C:\Databases\MyCalcBaseFile.odb", \</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id361620323808010">myBase = ui.CreateBaseDocument(r"C:\Databases\MyBaseFile.odb", "FIREBIRD")</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id251629365641121">myCalcBase = ui.CreateBaseDocument(r"C:\Databases\MyCalcBaseFile.odb", \</paragraph> <paragraph role="pycode" localize="false" id="pyc_id431629366045258"> "CALC", calcfilename = r"C:\Databases\MyCalcFile.ods")</paragraph> </pycode> </section> @@ -316,9 +316,9 @@ </bascode> <embed href="text/sbasic/shared/00000003.xhp#In_Python"/> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id901620324433095">myDoc1 = svcUI.CreateDocument("Calc")</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id901620324433095">myDoc1 = ui.CreateDocument("Calc")</paragraph> <paragraph role="pycode" localize="false" id="pyc_id361620324544381">FSO = CreateScriptService("FileSystem")</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id161620324434583">myDoc2 = svcUI.CreateDocument(templatefile = FSO.BuildPath(FSO.TemplatesFolder, "personal/CV.ott"))</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id161620324434583">myDoc2 = ui.CreateDocument(templatefile = FSO.BuildPath(FSO.TemplatesFolder, "personal/CV.ott"))</paragraph> </pycode> </section> @@ -344,10 +344,10 @@ </bascode> <embed href="text/sbasic/shared/00000003.xhp#In_Python"/> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id831620330074037">myDoc = svcUI.GetDocument(r"C:\Documents\My file.odt")</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id831620330074037">myDoc = ui.GetDocument(r"C:\Documents\My file.odt")</paragraph> <paragraph role="pycode" localize="false" id="pyc_id931624025986035">from scriptforge import CreateScriptService</paragraph> <paragraph role="pycode" localize="false" id="pyc_id641624026031595">bridge = CreateScriptService("Basic")</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id601624025839840">myDoc = svcui.GetDocument(bridge.ThisComponent)</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id601624025839840">myDoc = ui.GetDocument(bridge.ThisComponent)</paragraph> </pycode> <tip id="par_id521620330287071">To access the name of the currently active window, refer to the <literal>ActiveWindow</literal> property.</tip> </section> @@ -372,7 +372,7 @@ </bascode> <embed href="text/sbasic/shared/00000003.xhp#In_Python"/> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id181620330373220">svcUI.Maximize("Untitled 1")</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id181620330373220">ui.Maximize("Untitled 1")</paragraph> </pycode> </section> @@ -396,7 +396,7 @@ </bascode> <embed href="text/sbasic/shared/00000003.xhp#In_Python"/> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id481620330501644">svcUI.Minimize()</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id481620330501644">ui.Minimize()</paragraph> </pycode> </section> @@ -423,7 +423,7 @@ </bascode> <embed href="text/sbasic/shared/00000003.xhp#In_Python"/> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id431620331254271">svcUI.OpenBaseDocument(r"C:\Documents\myDB.odb", macroexecution = svcUI.MACROEXECALWAYS)</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id431620331254271">ui.OpenBaseDocument(r"C:\Documents\myDB.odb", macroexecution = ui.MACROEXECALWAYS)</paragraph> </pycode> <tip id="par_id941620762989833">To improve code readability you can use <link href="text/sbasic/shared/03/sf_ui.xhp#Constants" name="CHANGE ME">predefined constants</link> for the <literal>macroexecution</literal> argument, as in the examples above.</tip> </section> @@ -455,7 +455,7 @@ </bascode> <embed href="text/sbasic/shared/00000003.xhp#In_Python"/> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id891620331804571">svcUI.OpenDocument(r"C:\Documents\myFile.odt", readonly = True)</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id891620331804571">ui.OpenDocument(r"C:\Documents\myFile.odt", readonly = True)</paragraph> </pycode> </section> @@ -481,7 +481,7 @@ </bascode> <embed href="text/sbasic/shared/00000003.xhp#In_Python"/> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id971620331945744">svcUI.Resize(width = 500, height = 500)</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id971620331945744">ui.Resize(width = 500, height = 500)</paragraph> </pycode> <tip id="par_id21620332301809">To resize a window that is not active, first activate it using the <literal>Activate</literal> method.</tip> </section> @@ -515,9 +515,9 @@ <pycode> <paragraph role="pycode" localize="false" id="pyc_id631620332653004">from time import sleep</paragraph> <paragraph role="pycode" localize="false" id="pyc_id351620332422330">for i in range(101):</paragraph> - <paragraph role="pycode" localize="false" id="bas_id261620332627647"> svcUI.SetStatusbar("Test:", i)</paragraph> + <paragraph role="pycode" localize="false" id="bas_id261620332627647"> ui.SetStatusbar("Test:", i)</paragraph> <paragraph role="pycode" localize="false" id="pyc_id181620332715974"> sleep(0.05)</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id381620332733373">svcUI.SetStatusbar()</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id381620332733373">ui.SetStatusbar()</paragraph> </pycode> </section> @@ -551,10 +551,10 @@ <pycode> <paragraph role="pycode" localize="false" id="pyc_id821620333264948">from time import sleep</paragraph> <paragraph role="pycode" localize="false" id="pyc_id611620333268146">for i in range(101):</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id331620333268525"> svcUI.ShowProgressBar("Window Title", "Progress ... " + str(i) + "/100", i)</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id331620333268525"> ui.ShowProgressBar("Window Title", "Progress ... " + str(i) + "/100", i)</paragraph> <paragraph role="pycode" localize="false" id="pyc_id451620333268900"> sleep(0.05)</paragraph> <paragraph role="pycode" id="pyc_id761620333269236"># Closes the Progress Bar window</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id81620333269484">svcUI.ShowProgressBar()</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id81620333269484">ui.ShowProgressBar()</paragraph> </pycode> </section> @@ -579,7 +579,7 @@ </bascode> <embed href="text/sbasic/shared/00000003.xhp#In_Python"/> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id441620333481074">if svcUI.WindowExists(r"C:\Document\My file.odt"):</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id441620333481074">if ui.WindowExists(r"C:\Document\My file.odt"):</paragraph> <paragraph role="pycode" localize="false" id="pyc_id801620333495532"> # ...</paragraph> </pycode> </section> diff --git a/source/text/sbasic/shared/03/sf_writer.xhp b/source/text/sbasic/shared/03/sf_writer.xhp index 5b61087f6b..0f7804132d 100644 --- a/source/text/sbasic/shared/03/sf_writer.xhp +++ b/source/text/sbasic/shared/03/sf_writer.xhp @@ -67,11 +67,11 @@ <paragraph role="pycode" localize="false" id="pyc_id911621624242302">myDoc = CreateScriptService("Writer") ' Default = ActiveWindow</paragraph> </pycode> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id201621531742824">svcUI = CreateScriptService("UI")</paragraph> - <paragraph role="pycode" localize="false" id="pyc_id661621531772444">myDoc = svcUI.CreateDocument("Writer")</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id201621531742824">ui = CreateScriptService("UI")</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id661621531772444">myDoc = ui.CreateDocument("Writer")</paragraph> </pycode> <pycode> - <paragraph role="pycode" localize="false" id="pyc_id401621531828705">myDoc = svcUI.OpenDocument(r"C:\Documents\MyFile.odt")</paragraph> + <paragraph role="pycode" localize="false" id="pyc_id401621531828705">myDoc = ui.OpenDocument(r"C:\Documents\MyFile.odt")</paragraph> </pycode> <pycode> <paragraph role="pycode" localize="false" id="pyc_id701621532481401">myDoc = CreateScriptService("SFDocuments.Writer", "MyFile.odt")</paragraph> |