diff options
Diffstat (limited to 'wizards')
-rw-r--r-- | wizards/source/scriptforge/SF_FileSystem.xba | 4 | ||||
-rw-r--r-- | wizards/source/scriptforge/SF_PythonHelper.xba | 86 | ||||
-rw-r--r-- | wizards/source/scriptforge/python/scriptforge.py | 14 | ||||
-rw-r--r-- | wizards/source/sfdocuments/SF_Base.xba | 10 | ||||
-rw-r--r-- | wizards/source/sfdocuments/SF_Calc.xba | 10 | ||||
-rw-r--r-- | wizards/source/sfdocuments/SF_Writer.xba | 12 |
6 files changed, 67 insertions, 69 deletions
diff --git a/wizards/source/scriptforge/SF_FileSystem.xba b/wizards/source/scriptforge/SF_FileSystem.xba index c0b7e8316fe8..39ea4888e3d1 100644 --- a/wizards/source/scriptforge/SF_FileSystem.xba +++ b/wizards/source/scriptforge/SF_FileSystem.xba @@ -2121,8 +2121,8 @@ Dim sFolder As String ' Folder End If _SFInstallFolder = _ConvertFromUrl(sFolder) - + End Function ' ScriptForge.SF_FileSystem._SFInstallFolder REM ============================================ END OF SCRIPTFORGE.SF_FileSystem -</script:module> +</script:module>
\ No newline at end of file diff --git a/wizards/source/scriptforge/SF_PythonHelper.xba b/wizards/source/scriptforge/SF_PythonHelper.xba index 442a4bd1b856..d2b8f3276f43 100644 --- a/wizards/source/scriptforge/SF_PythonHelper.xba +++ b/wizards/source/scriptforge/SF_PythonHelper.xba @@ -712,6 +712,7 @@ Try: vBasicObject = _SF_.PythonStorage(BasicObject) sObjectType = vBasicObject.ObjectType sServiceName = vBasicObject.ServiceName + ' Basic modules have type = "SF_*" bBasicClass = ( Left(sObjectType, 3) <> "SF_" ) sLibrary = Split(sServiceName, ".")(0) @@ -727,10 +728,17 @@ Try: ElseIf Not bBasicClass And _ (((CallType And vbMethod) + (CallType And cstArgArray)) = vbMethod + cstArgArray Or _ ((CallType And vbMethod) + (CallType And cstRetArray)) = vbMethod + cstRetArray) Then - Select Case sServiceName - Case "ScriptForge.Array" - If Script = "ImportFromCSVFile" Then vReturn = SF_Array.ImportFromCSVFile(vArgs(0), vArgs(1), vArgs(2), True) - End Select + ' Not service related + If Script = "Methods" Then + vReturn = vBasicObject.Methods() + ElseIf Script = "Properties" Then + vReturn = vBasicObject.Properties() + Else + Select Case sServiceName + Case "ScriptForge.Array" + If Script = "ImportFromCSVFile" Then vReturn = SF_Array.ImportFromCSVFile(vArgs(0), vArgs(1), vArgs(2), True) + End Select + End If ' Methods in usual modules are called by ExecuteBasicScript() except if they use a ParamArray ElseIf Not bBasicClass And (CallType And vbMethod) = vbMethod Then @@ -759,38 +767,44 @@ Try: ' Methods in class modules using a 2D array or returning arrays are hardcoded as exceptions. Bug #138155 ElseIf ((CallType And vbMethod) + (CallType And cstArgArray)) = vbMethod + cstArgArray Or _ ((CallType And vbMethod) + (CallType And cstRetArray)) = vbMethod + cstRetArray Then - Select Case sServiceName - Case "SFDatabases.Database" - If Script = "GetRows" Then vReturn = vBasicObject.GetRows(vArgs(0), vArgs(1), vArgs(2), vArgs(3)) - Case "SFDialogs.Dialog" - If Script = "Controls" Then vReturn = vBasicObject.Controls(vArgs(0)) - Case "SFDialogs.DialogControl" - If Script = "SetTableData" Then vReturn = vBasicObject.SetTableData(vArgs(0), vArgs(1), vArgs(2)) - Case "SFDocuments.Document" - If Script = "Forms" Then vReturn = vBasicObject.Forms(vArgs(0)) - Case "SFDocuments.Base" - Select Case Script - Case "FormDocuments" : vReturn = vBasicObject.FormDocuments() - Case "Forms" : vReturn = vBasicObject.Forms(vArgs(0), vArgs(1)) - End Select - Case "SFDocuments.Calc" - Select Case Script - Case "Charts" : vReturn = vBasicObject.Charts(vArgs(0), vArgs(1)) - Case "Forms" : vReturn = vBasicObject.Forms(vArgs(0), vArgs(1)) - Case "GetFormula" : vReturn = vBasicObject.GetFormula(vArgs(0)) - Case "GetValue" : vReturn = vBasicObject.GetValue(vArgs(0)) - Case "SetArray" : vReturn = vBasicObject.SetArray(vArgs(0), vArgs(1)) - Case "SetFormula" : vReturn = vBasicObject.SetFormula(vArgs(0), vArgs(1)) - Case "SetValue" : vReturn = vBasicObject.SetValue(vArgs(0), vArgs(1)) - End Select - Case "SFDocuments.Form" - Select Case Script - Case "Controls" : vReturn = vBasicObject.Controls(vArgs(0)) - Case "Subforms" : vReturn = vBasicObject.Subforms(vArgs(0)) - End Select - Case "SFDocuments.FormControl" - If Script = "Controls" Then vReturn = vBasicObject.Controls(vArgs(0)) - End Select + If Script = "Methods" Then + vReturn = vBasicObject.Methods() + ElseIf Script = "Properties" Then + vReturn = vBasicObject.Properties() + Else + Select Case sServiceName + Case "SFDatabases.Database" + If Script = "GetRows" Then vReturn = vBasicObject.GetRows(vArgs(0), vArgs(1), vArgs(2), vArgs(3)) + Case "SFDialogs.Dialog" + If Script = "Controls" Then vReturn = vBasicObject.Controls(vArgs(0)) + Case "SFDialogs.DialogControl" + If Script = "SetTableData" Then vReturn = vBasicObject.SetTableData(vArgs(0), vArgs(1), vArgs(2)) + Case "SFDocuments.Document" + If Script = "Forms" Then vReturn = vBasicObject.Forms(vArgs(0)) + Case "SFDocuments.Base" + Select Case Script + Case "FormDocuments" : vReturn = vBasicObject.FormDocuments() + Case "Forms" : vReturn = vBasicObject.Forms(vArgs(0), vArgs(1)) + End Select + Case "SFDocuments.Calc" + Select Case Script + Case "Charts" : vReturn = vBasicObject.Charts(vArgs(0), vArgs(1)) + Case "Forms" : vReturn = vBasicObject.Forms(vArgs(0), vArgs(1)) + Case "GetFormula" : vReturn = vBasicObject.GetFormula(vArgs(0)) + Case "GetValue" : vReturn = vBasicObject.GetValue(vArgs(0)) + Case "SetArray" : vReturn = vBasicObject.SetArray(vArgs(0), vArgs(1)) + Case "SetFormula" : vReturn = vBasicObject.SetFormula(vArgs(0), vArgs(1)) + Case "SetValue" : vReturn = vBasicObject.SetValue(vArgs(0), vArgs(1)) + End Select + Case "SFDocuments.Form" + Select Case Script + Case "Controls" : vReturn = vBasicObject.Controls(vArgs(0)) + Case "Subforms" : vReturn = vBasicObject.Subforms(vArgs(0)) + End Select + Case "SFDocuments.FormControl" + If Script = "Controls" Then vReturn = vBasicObject.Controls(vArgs(0)) + End Select + End If ' Methods in class modules are invoked with CallByName ElseIf bBasicClass And ((CallType And vbMethod) = vbMethod) Then diff --git a/wizards/source/scriptforge/python/scriptforge.py b/wizards/source/scriptforge/python/scriptforge.py index 5eb0b08a5863..53a724d9b8f4 100644 --- a/wizards/source/scriptforge/python/scriptforge.py +++ b/wizards/source/scriptforge/python/scriptforge.py @@ -267,7 +267,7 @@ class ScriptForge(object, metaclass = _Singleton): Execute a given Basic script and interpret its result This method has as counterpart the ScriptForge.SF_PythonHelper._PythonDispatcher() Basic method :param basicobject: a Service subclass - :param flags: see the vb* and flg* constants below + :param flags: see the vb* and flg* constants in the SFServices class :param method: the name of the method or property to invoke, as a string :param args: the arguments of the method. Symbolic cst* constants may be necessary :return: The invoked Basic counterpart script (with InvokeSimpleScript()) will return a tuple @@ -569,6 +569,18 @@ class SFServices(object): def Properties(self): return list(self.serviceproperties) + def basicmethods(self): + if self.serviceimplementation == 'basic': + return self.ExecMethod(self.vbMethod + self.flgArrayRet, 'Methods') + else: + return [] + + def basicproperties(self): + if self.serviceimplementation == 'basic': + return self.ExecMethod(self.vbMethod + self.flgArrayRet, 'Properties') + else: + return [] + def SetProperty(self, propertyname, value): """ Set the given property to a new value in the Basic world diff --git a/wizards/source/sfdocuments/SF_Base.xba b/wizards/source/sfdocuments/SF_Base.xba index 8e8dbfb4e27e..1e6395dbfa2c 100644 --- a/wizards/source/sfdocuments/SF_Base.xba +++ b/wizards/source/sfdocuments/SF_Base.xba @@ -440,21 +440,13 @@ Public Function Methods() As Variant ''' Return the list of public methods of the Base class as an array Methods = Array( _ - "Activate" _ - , "CloseDocument" _ - , "CloseFormDocument" _ - , "CreateMenu" _ + "CloseFormDocument" _ , "FormDocuments" _ , "Forms" _ , "GetDatabase" _ , "IsLoaded" _ , "OpenFormDocument" _ , "PrintOut" _ - , "RemoveMenu" _ - , "RunCommand" _ - , "Save" _ - , "SaveAs" _ - , "SaveCopyAs" _ , "SetPrinter" _ ) diff --git a/wizards/source/sfdocuments/SF_Calc.xba b/wizards/source/sfdocuments/SF_Calc.xba index 8c9ab301370f..f7cd2005d1b5 100644 --- a/wizards/source/sfdocuments/SF_Calc.xba +++ b/wizards/source/sfdocuments/SF_Calc.xba @@ -1636,24 +1636,20 @@ Public Function Methods() As Variant Methods = Array( _ "A1Style" _ - , "Activate" _ , "Charts" _ , "ClearAll" _ , "ClearFormats" _ , "ClearValues" _ - , "CloseDocument" _ , "CopySheet" _ , "CopySheetFromFile" _ , "CopyToCell" _ , "CopyToRange" _ , "CreateChart" _ - , "CreateMenu" _ , "DAvg" _ , "DCount" _ , "DMax" _ , "DMin" _ , "DSum" _ - , "ExportAsPDF" _ , "GetColumnName" _ , "GetFormula" _ , "GetValue" _ @@ -1666,17 +1662,11 @@ Public Function Methods() As Variant , "OpenRangeSelector" _ , "Printf" _ , "PrintOut" _ - , "RemoveMenu" _ , "RemoveSheet" _ , "RenameSheet" _ - , "RunCommand" _ - , "Save" _ - , "SaveAs" _ - , "SaveCopyAs" _ , "SetArray" _ , "SetCellStyle" _ , "SetFormula" _ - , "SetPrinter" _ , "SetValue" _ , "ShiftDown" _ , "ShiftLeft" _ diff --git a/wizards/source/sfdocuments/SF_Writer.xba b/wizards/source/sfdocuments/SF_Writer.xba index 9d2234637dd4..12d3136df65f 100644 --- a/wizards/source/sfdocuments/SF_Writer.xba +++ b/wizards/source/sfdocuments/SF_Writer.xba @@ -217,18 +217,8 @@ Public Function Methods() As Variant ''' Return the list of public methods of the Writer service as an array Methods = Array( _ - "Activate" _ - , "CloseDocument" _ - , "CreateMenu" _ - , "ExportAsPDF" _ - , "Forms" _ + "Forms" _ , "PrintOut" _ - , "RemoveMenu" _ - , "RunCommand" _ - , "Save" _ - , "SaveAs" _ - , "SaveCopyAs" _ - , "SetPrinter" _ ) End Function ' SFDocuments.SF_Writer.Methods |