From a65cd9e1f6b76162853428d38395a02ad6faf7cb Mon Sep 17 00:00:00 2001 From: Rafael Lima Date: Fri, 25 Jun 2021 18:46:58 +0200 Subject: Fix localization in SF_Form, SF_FormControl and SF_UI help pages Change-Id: I7306fbfdabf3df84028aadacb90d0502d48f5c56 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/117863 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos (cherry picked from commit 8d017a90e29ece12e5a71b7e0242b5f926575cb5) Reviewed-on: https://gerrit.libreoffice.org/c/help/+/118060 --- source/text/sbasic/shared/03/sf_form.xhp | 104 ++++++++++++------------ source/text/sbasic/shared/03/sf_formcontrol.xhp | 4 +- source/text/sbasic/shared/03/sf_intro.xhp | 8 +- source/text/sbasic/shared/03/sf_ui.xhp | 46 +++++------ 4 files changed, 81 insertions(+), 81 deletions(-) diff --git a/source/text/sbasic/shared/03/sf_form.xhp b/source/text/sbasic/shared/03/sf_form.xhp index efb3fb493e..497b379e36 100644 --- a/source/text/sbasic/shared/03/sf_form.xhp +++ b/source/text/sbasic/shared/03/sf_form.xhp @@ -83,7 +83,7 @@ - my_form = doc.Forms(0) + my_form = doc.Forms(0) If you try to access a FormDocument that is currently opened in Design Mode an exception will be raised.

In Calc documents

@@ -119,13 +119,13 @@ Previous examples translate in Python as: - db = CreateScriptService('SFDocuments.Document', XSCRIPTCONTEXT.getDocument()) + db = CreateScriptService('SFDocuments.Document', XSCRIPTCONTEXT.getDocument()) # The statement below is necessary only if the form hasn't been opened yet - form_doc = db.OpenFormDocument('thisFormDocument') - form = form_doc.Forms('thisFormDocument', 'MainForm') + form_doc = db.OpenFormDocument('thisFormDocument') + form = form_doc.Forms('thisFormDocument', 'MainForm') # Or, alternatively, to access the form by its index ... - form = form_doc.Forms('thisFormDocument', 0) - sub_form = form.SubForms('mySubForm') + form = form_doc.Forms('thisFormDocument', 0) + sub_form = form.SubForms('mySubForm')

In Form events

To invoke the Form service when a form event takes place: @@ -138,17 +138,17 @@ - def OnEvent(event: uno): - form = CreateScriptService('SFDocuments.FormEvent', event) - pass + def OnEvent(event: uno): + form = CreateScriptService('SFDocuments.FormEvent', event) + pass It is recommended to free resources after use of the Form service. - myForm.Dispose() ' using Basic + myForm.Dispose() ' Basic - form.Dispose() # using Python + form.Dispose() # Python This operation is done implicitly when a form document is closed with the CloseFormDocument() method described below. @@ -589,9 +589,9 @@ In Base documents: Sets the focus on the FormDocument the Form refers to. -

+ svc.Activate(): bool -

+ The following example assumes you want to activate the form named FormA located in Sheet1 of the currently open Calc file. It first gets access to the document using the Document service and ThisComponent and then activates the form. 'Gets hold of the form that will be activated @@ -603,9 +603,9 @@ - doc = CreateScriptService('Document', XSCRIPTCONTEXT.getDocument()) - form = doc.Forms('Sheet1', 'FormA') - form.Activate() + doc = CreateScriptService('Document', XSCRIPTCONTEXT.getDocument()) + form = doc.Forms('Sheet1', 'FormA') + form.Activate() ThisComponent applies to Calc and Writer documents. For Base documents use ThisDataBaseDocument. @@ -616,15 +616,15 @@

CloseFormDocument

Closes the form document containing the actual Form instance. The Form instance is disposed. -

+ svc.CloseFormDocument(): bool -

+ myForm.CloseFormDocument() ' Basic - form.CloseFormDocument() # Python + form.CloseFormDocument() # Python This method only closes form documents located in Base documents. If the form is stored in a Writer or Calc document, calling CloseFormDocument will have no effect. @@ -643,11 +643,11 @@ If the optional ControlName argument is provided, the method returns a FormControl class instance referring to the specified control. -

+ svc.Controls(opt controlname: str): any -

+ controlname : A valid control name as a case-sensitive string. If absent, the list of control names is returned as a zero-based array. -

+ Dim myForm As Object, myList As Variant, myControl As Object Set myForm = myDoc.Forms("myForm") @@ -656,9 +656,9 @@ - form = doc.Forms('myForm') - form_names = form.Controls() - form_control = form.Controls('myTextBox') # SFDocuments.FormControl + form = doc.Forms('myForm') + form_names = form.Controls() + form_control = form.Controls('myTextBox') # SFDocuments.FormControl
@@ -669,18 +669,18 @@

GetDatabase

Return a SFDatabases.Database instance giving access to the execution of SQL commands on the database the current form is connected to and/or that is stored in the current Base document. Each form has its own database connection, except in Base documents where they all share the same connection. -

+ svc.GetDatabase(opt user: str, opt password: str): svc -

+ user, password: The login optional parameters (Default = ""). -

+ Dim myDb As Object ' SFDatabases.Database Set myDb = oForm.GetDatabase() - db = form.GetDatabase() # SFDatabases.Database + db = form.GetDatabase() # SFDatabases.Database
@@ -690,15 +690,15 @@

MoveFirst

The form cursor is positioned on the first record. Returns True if successful. -

+ svc.MoveFirst(): bool -

+ myForm.MoveFirst() ' Basic - form.MoveFirst() # Python + form.MoveFirst() # Python
@@ -708,15 +708,15 @@

MoveLast

The form cursor is positioned on the last record. Returns True if successful. -

+ svc.MoveLast(): bool -

+ myForm.MoveLast() ' Basic - form.MoveLast() # Python + form.MoveLast() # Python
@@ -726,15 +726,15 @@

MoveNew

The form cursor is positioned on the new record area. Returns True if successful. -

+ svc.MoveNew(): bool -

+ myForm.MoveNew() ' Basic - form.MoveNew() # Python + form.MoveNew() # Python
@@ -744,11 +744,11 @@

MoveNext

The form cursor is positioned on the next record. Returns True if successful. -

+ svc.MoveNext(opt offset: int): bool -

+ offset: The number of records to go forward (Default = 1). -

+ myForm.MoveNext() ' Basic @@ -764,11 +764,11 @@

MovePrevious

The form cursor is positioned on the previous record. Returns True if successful. -

+ svc.MovePrevious(opt offset: int): bool -

+ offset: The number of records to go backwards (Default = 1). -

+ myForm.MovePrevious() ' Basic @@ -783,15 +783,15 @@

Requery

Reloads the current data from the database and refreshes the form. The cursor is positioned on the first record. Returns True if successful. -

+ svc.Requery(): bool -

+ myForm.Requery() ' Basic - form.Requery() # Python + form.Requery() # Python
@@ -809,14 +809,14 @@ If the optional subform argument is provided, the method returns a new SFDocuments.Form instance based on the specified form/subform name or index. -

+ svc.Subforms(): str[0..*] svc.Subforms(subform: str): svc svc.Subforms(subform: int): svc -

- subform : A subform stored in the current Form class instance given by its name or index. - When this argument is absent, the method returns a list of available subforms as a zero-based array. If the form has a single subform, you can set Subform = 0 to get access to it. -

+ + subform: A subform stored in the current Form class instance given by its name or index. + When this argument is absent, the method returns a list of available subforms as a zero-based array. If the form has a single subform, you can set subform = 0 to get access to it. + Dim myForm As Object, myList As Variant, mySubform As Object myList = myform.Subforms() diff --git a/source/text/sbasic/shared/03/sf_formcontrol.xhp b/source/text/sbasic/shared/03/sf_formcontrol.xhp index a082a32932..afc8ba2b77 100644 --- a/source/text/sbasic/shared/03/sf_formcontrol.xhp +++ b/source/text/sbasic/shared/03/sf_formcontrol.xhp @@ -1062,8 +1062,8 @@

Controls

This method is applicable only to controls of the TableControl type. The returned value depends on the arguments provided. - If the optional argument ControlName is absent, then a zero-based Array containing the names of all controls is returned. - On the other hand, if a ControlName is provided, the method returns a FormControl class instance corresponding to the specified control. + If the optional argument controlname is absent, then a zero-based Array containing the names of all controls is returned. + On the other hand, if a controlname is provided, the method returns a FormControl class instance corresponding to the specified control. svc.Controls(): str[0..*] svc.Controls(controlname: str): svc diff --git a/source/text/sbasic/shared/03/sf_intro.xhp b/source/text/sbasic/shared/03/sf_intro.xhp index 7f75754d43..785a2e06f8 100644 --- a/source/text/sbasic/shared/03/sf_intro.xhp +++ b/source/text/sbasic/shared/03/sf_intro.xhp @@ -72,7 +72,7 @@ bas.MsgBox("Hello!") To run the example above, enter each line in the Python shell, one by one, pressing the Enter key after you type each line of code. - Now you can start executing Python commands using any of the ScriptForge services. For example, the code snippet below uses the UI service to create a blank writer document. + Now you can start executing Python commands using any of the ScriptForge services. For example, the code snippet below uses the UI service to create a blank Writer document. ui = CreateScriptService("UI") doc = ui.CreateDocument("Writer") @@ -107,7 +107,7 @@ Go to Tools - Macros - Run Macros . - Choose My Macros - sf_test in the library selector. Then choose the increment_cell function under the Macro Name list. + Choose My Macros - sf_test in the library selector. Then choose the increment_cell function under the Macro Name list. Click Run. Note that the value in cell "A1" was incremented by 1. @@ -119,10 +119,10 @@ First open APSO by going to Tools - Macros - Organize Python Scripts. - In the macro list, navigate to My Macros - sf_test - increment_cell . + In the macro list, navigate to My Macros - sf_test - increment_cell. - Click Execute . + Click Execute. diff --git a/source/text/sbasic/shared/03/sf_ui.xhp b/source/text/sbasic/shared/03/sf_ui.xhp index 94d8cdb33f..ce4f93b01a 100644 --- a/source/text/sbasic/shared/03/sf_ui.xhp +++ b/source/text/sbasic/shared/03/sf_ui.xhp @@ -152,10 +152,10 @@ - MACROEXECALWAYS + MACROEXECALWAYS - 2 + 2 Macros are always executed @@ -163,10 +163,10 @@ - MACROEXECNEVER + MACROEXECNEVER - 1 + 1 Macros are never executed @@ -174,10 +174,10 @@ - MACROEXECNORMAL + MACROEXECNORMAL - 0 + 0 Macro execution depends on user settings @@ -200,11 +200,11 @@
- svcUI = CreateScriptService("UI") - sBasic = CreateScriptService("Basic") - openDocs = svcUI.Documents() - strDocs = "\n".join(openDocs) - sBasic.MsgBox(strDocs) + svcUI = CreateScriptService("UI") + sBasic = CreateScriptService("Basic") + openDocs = svcUI.Documents() + strDocs = "\n".join(openDocs) + sBasic.MsgBox(strDocs) @@ -281,7 +281,7 @@ - myBase = svcUI.CreateBaseDocument(r"C:\Databases\MyBaseFile.odb", "FIREBIRD") + myBase = svcUI.CreateBaseDocument(r"C:\Databases\MyBaseFile.odb", "FIREBIRD") @@ -297,7 +297,7 @@ svc.CreateDocument(documenttype: str = '', templatefile: str = '', hidden: bool = False): svc - documenttype : "Calc", "Writer", etc. If absent, the TemplateFile argument must be present. + documenttype : "Calc", "Writer", etc. If absent, the templatefile argument must be present.templatefile : The full FileName of the template to build the new document on. If the file does not exist, the argument is ignored. The FileSystem service provides the TemplatesFolder and UserTemplatesFolder properties to help to build the argument.hidden: if True, open the new document in the background (default = False). To use with caution: activation or closure afterwards can only happen programmatically. @@ -403,8 +403,8 @@ svc.OpenBaseDocument(filename: str = '', registrationname: str = '', macroexecution: int = 0): svc - filename : Identifies the file to open. It must follow the SF_FileSystem.FileNaming notation. If the file already exists, it is overwritten without warning - registrationname : The name to use to find the database in the databases register. It is ignored if FileName <> "". + filename: Identifies the file to open. It must follow the SF_FileSystem.FileNaming notation. If the file already exists, it is overwritten without warning + registrationname: The name to use to find the database in the databases register. It is ignored if FileName <> "".macroexecution: 0 = behaviour is defined by the user configuration, 1 = macros are not executable, 2 = macros are executable. @@ -472,7 +472,7 @@ - svcUI.Resize(width = 500, height = 500) + svcUI.Resize(width = 500, height = 500) To resize a window that is not active, first activate it using the Activate method. @@ -504,11 +504,11 @@ - from time import sleep - for i in range(101): - svcUI.SetStatusbar("Test:", i) - sleep(0.05) - svcUI.SetStatusbar() + from time import sleep + for i in range(101): + svcUI.SetStatusbar("Test:", i) + sleep(0.05) + svcUI.SetStatusbar() @@ -570,8 +570,8 @@ - if svcUI.WindowExists(r"C:\Document\My file.odt"): - # ... + if svcUI.WindowExists(r"C:\Document\My file.odt"): + # ... -- cgit