XrayTool |
_Main |
addShortTypeStr |
Basic |
structure2String (Procedure) properties2String (Procedure) simplifiedPropertyString (Procedure) XrayThisProperty (Procedure) |
22 |
Sub addShortTypeStr(thisIdlClass As Object, propInf As String, propReadable As Long) Dim tc As Long
tc = thisIdlClass.TypeClass if (tc = com.sun.star.uno.TypeClass.ARRAY) or (tc = com.sun.star.uno.TypeClass.SEQUENCE) then propReadable = arrayProp if showAll then propInf = propInf & "[]" & thisIdlClass.ComponentType.Name else tc = thisIdlClass.ComponentType.TypeClass propInf = propInf & "[]" & TypeClass2Basic(tc) end if else propReadable = TypeClassIsPropReadable(tc) if showAll then propInf = propInf & thisIdlClass.Name else propInf = propInf & TypeClass2Basic(tc) end if end if End Sub |
XrayTool |
_Main |
addValueToDisplay |
Basic |
propertiesPanelString (Procedure) structure2String (Procedure) properties2String (Procedure) |
23 |
Sub addValueToDisplay(propLine As String, propValue As String) Dim space1 As Long, strTemplate As String
space1 = propValPos - Len(propLine) -2 if Len(propValue) > space1 then if Len(propValue) > propValMinWidth then if Len(tooWideStr) <= space1 then strTemplate = String(space1, "x") RSet strTemplate = tooWideStr propLine = propLine & " " & strTemplate & " " else propLine = propLine & " " & tooWideStr & " " end if else propLine = propLine & " " & propValue & " " end if else strTemplate = String(space1, "x") RSet strTemplate = propValue propLine = propLine & " " & strTemplate & " " end if End Sub |
XrayTool |
_Main |
buildAllMethodsNamesInterfaces |
Basic |
properties2String (Procedure) |
16 |
Sub buildAllMethodsNamesInterfaces() Dim info1 As Variant, info2 As Object Dim s As String, x As Long, xMax As Long
allMethodsNamesInterfaces = "" info1 = introCurrObj.getMethods(com.sun.star.beans.MethodConcept.ALL) xMax = UBound(info1) if xMax < 0 then Exit Sub for x = 0 to xMax info2 = info1(x) s = "£" & info2.Name & "£" & info2.DeclaringClass.Name & "£" if InStr(1, allMethodsNamesInterfaces, s, 0) = 0 then allMethodsNamesInterfaces = allMethodsNamesInterfaces & s end if next End Sub |
XrayTool |
_Main |
changeDisplay |
Basic |
DlgXray|displayWhat (Control) DlgXray|AZflag (Control) DlgXray|showAllFlag (Control) initXrayDisplay (Procedure) |
53 |
Sub changeDisplay Dim kt As Object, kth As Object, Txtzone As Object Dim t0 As Long, ordering As String, header As String
t0 = GetSystemTicks Txtzone = XrDial.getControl("TxtObjInfos") kt = XrDial.getControl("showAllFlag") showAll = (kt.Model.State = 1) kt = XrDial.getControl("AZflag") if kt.State = 1 then ordering = "AZ" else ordering = "" enableControls(XrDial, Array("showAllFlag", "AZflag", "displayWhat", "SDKBtn", "DeeperBtn", "PrettyDisplayBtn"), True) Txtzone.Text = emptyLine & txt0106 kth = XrDial.getControl("HeaderLabel") kth.Text = "" kt = XrDial.getControl("displayWhat") Select Case kt.SelectedItemPos Case 0 XrayDisplayWhat = "properties" Txtzone.Text = propertiesPanelString(ordering) Case 1 XrayDisplayWhat = "methods" header = " " & txt0405 spaceTo(header, methArgsPos, 1) header = header & "( " & txt0406 & " )" spaceTo(header, methReturnPos, 1) header = header & "AS " & txt0407 spaceTo(header, methInterfPos, 2) kth.Text = header & txt0408 Txtzone.Text = methodsString(ordering) Case 2 XrayDisplayWhat = "services" enableControls(XrDial, Array("showAllFlag", "AZflag", "DeeperBtn", "PrettyDisplayBtn"), False) Txtzone.Text = servicesString Case 3 XrayDisplayWhat = "interfaces" enableControls(XrDial, Array("showAllFlag", "AZflag", "DeeperBtn", "PrettyDisplayBtn"), False) Txtzone.Text = interfacesString Case 4 XrayDisplayWhat = "listeners" enableControls(XrDial, Array("showAllFlag", "AZflag", "DeeperBtn", "PrettyDisplayBtn"), False) header = "" spaceTo(header, interfacePos, 1) kth.Text = header & txt0408 Txtzone.Text = listenersString End Select kt = XrDial.getControl("Duration") FocusOnInfoControl End Sub |
XrayTool |
_Main |
checkAndDisplayNewObject |
Basic |
XrayThisArrayElement (Procedure) XrayThisStructureElement (Procedure) XrayThisProperty (Procedure) XrayThisMethod (Procedure) |
10 |
Sub checkAndDisplayNewObject(Optional newObj As Variant, ObjPath As String) As Boolean if isWorthXray(newObj) then if EqualUnoObjects(newObj, CurrentObj) then MsgBox(txt0109, 0, WindowTitle) elseif initXrayDisplay(newObj, ObjPath, true) then end if end if End Sub |
XrayTool |
_Main |
createPropertyComments |
Basic |
properties2String (Procedure) |
23 |
Function createPropertyComments(propKind As Long) As String Dim result As String, n As Long
if (propKind and &H00000200) > 0 then result = result & "attribute, " else result = pseudoprop(propKind and &H0000000F) end if if ((propKind and &H00000105) = &H00000100) or _ ((propKind and &H00000800) = &H00000800) then result = result & "ambiguous name, " n = propKind H00010000000 if (n and com.sun.star.beans.PropertyAttribute.READONLY) <> 0 then result = result & "read-only, " if (n and com.sun.star.beans.PropertyAttribute.MAYBEVOID) <> 0 then result = result & "may be void, " if showAll then if (n and com.sun.star.beans.PropertyAttribute.REMOVEABLE) <> 0 then result = result & "property may be removed, " if (n and com.sun.star.beans.PropertyAttribute.MAYBEAMBIGUOUS) <> 0 then result = result & "value may be ambiguous, " if (n and com.sun.star.beans.PropertyAttribute.MAYBEDEFAULT) <> 0 then result = result & "may be set to default, " if (n and com.sun.star.beans.PropertyAttribute.BOUND) <> 0 then result = result & "value may be listened, " if (n and com.sun.star.beans.PropertyAttribute.CONSTRAINED) <> 0 then result = result & "value may be denied, " if (n and com.sun.star.beans.PropertyAttribute.TRANSIENT) <> 0 then result = result & "value is not persistent, " end if createPropertyComments = result End Function |
XrayTool |
_Main |
explainAttribute |
Basic |
explainPropertyCaracteristics (Procedure) |
32 |
Sub explainAttribute(propName As String, propKind As Long, s As Variant) Dim t As String, t2 As String, n As Long
t = s(F3notes) n = propKind H00010000000 s(F3attribProp) = txt0341 t2 = findInterfaceOfAttribute(propName) if Len(t2) > 0 then t = t & LF & txt0342 & t2 else Select Case isAlternateDoc(propName, "attribute") Case "found" t = t & LF & txt0344 Case "not found" t = t & LF & txt0343 End Select end if if (n and com.sun.star.beans.PropertyAttribute.READONLY) <> 0 then t = t & LF & txt0346 if (n and com.sun.star.beans.PropertyAttribute.MAYBEVOID) <> 0 then t = t & LF & txt0230 if showAll then if (n and com.sun.star.beans.PropertyAttribute.MAYBEAMBIGUOUS) <> 0 then t = t & LF & txt0234 if (n and com.sun.star.beans.PropertyAttribute.MAYBEDEFAULT) <> 0 then t = t & LF & txt0348 if (n and com.sun.star.beans.PropertyAttribute.BOUND) <> 0 then t = t & LF & txt0231 if (n and com.sun.star.beans.PropertyAttribute.CONSTRAINED) <> 0 then t = t & LF & txt0232 if (n and com.sun.star.beans.PropertyAttribute.TRANSIENT) <> 0 then t = t & LF & txt0347 end if
s(F3notes) = t End Sub |
XrayTool |
_Main |
explainPropertyCaracteristics |
Basic |
simplifiedPropertyString (Procedure) |
12 |
Sub explainPropertyCaracteristics(propName As String, propKind As Long, s As Variant)
if (propKind and &H00000800) <> 0 then s(F3notes) = s(F3notes) & LF & txt0240 s(F3important) = txt0229 elseif (propKind and &H00000200) <> 0 then explainAttribute(propName, propKind, s) elseif (propKind and &H00000400) <> 0 then explainRealProperty(propName, propKind, s) end if End Sub |
XrayTool |
_Main |
explainPseudoPropertyCaracteristics |
Basic |
simplifiedPropertyString (Procedure) |
52 |
Sub explainPseudoPropertyCaracteristics(propName As String, propKind As Long, s As Variant) Dim t As String, w As String, intfGet As String, intfSet As String
t = s(F3notes) intfGet = "none" intfSet = "none" if (propKind and &H00000001) <> 0 then s(F3get) = txt0219 & "get" & propName & "( ) " if (propKind and &H00000002) <> 0 then t = t & LF & replaceTag(txt0243, "getXxx", "get" & propName & "( ) ") s(F3important) = txt0229 s(F3canXray) = "noXray" else intfGet = getPseudoPropInterface("get", propName) if (propKind and &H00000004) = 0 then t = t & LF & txt0223 end if end if
if (propKind and &H00000004) <> 0 then s(F3set) = txt0219 & "set" & propName & "(" & txt0242 & ") " if (propKind and &H00000008) <> 0 then t = t & LF & replaceTag(txt0244, "setXxx", "set" & propName & "( ) ") s(F3important) = txt0229 else intfSet = getPseudoPropInterface("set", propName) if (propKind and &H00000001) = 0 then t = t & LF & txt0222 s(F3canXray) = "noXray" end if end if end if
if intfGet <> "none" then if intfSet <> "none" then if intfGet = intfSet then t = t & LF & txt0253 & intfGet else w = replaceTag(txt0245, "getXxx", "get" & propName & "( ) ") w = replaceTag(w, "setXxx", "set" & propName & "( ) ") t = t & LF & w end if elseif (propKind and &H0000000A) = 0 then t = t & LF & txt0252 & intfGet end if else if (intfSet <> "none") and ((propKind and &H0000000A) = 0) then t = t & LF & txt0252 & intfSet end if end if s(F3notes) = t End Sub |
XrayTool |
_Main |
explainRealProperty |
Basic |
explainPropertyCaracteristics (Procedure) |
37 |
Sub explainRealProperty(propName As String, propKind As Long, s As Variant) Dim t As String, t2 As String, n As Long
t = s(F3notes) n = propKind H00010000000 s(F3attribProp) = txt0351 if (n and com.sun.star.beans.PropertyAttribute.REMOVEABLE) <> 0 then t = t & LF & txt0236 & _ LF & Space(4) & txt0220 & "getPropertyValue(""" & propName & """) " & _ LF & Space(4) & txt0221 & "setPropertyValue(""" & propName & """, " & txt0242 & ") " & _ LF & txt0356 else t2 = findServiceOfRealProperty(propName) if Len(t2) > 0 then t = t & LF & txt0352 & t2 else Select Case isAlternateDoc(propName, "property") Case "found" t = t & LF & txt0354 Case "not found" t = t & LF & txt0353 End Select end if end if if (n and com.sun.star.beans.PropertyAttribute.READONLY) <> 0 then t = t & LF & txt0223 if (n and com.sun.star.beans.PropertyAttribute.MAYBEVOID) <> 0 then t = t & LF & txt0230 if showAll then if (n and com.sun.star.beans.PropertyAttribute.MAYBEAMBIGUOUS) <> 0 then t = t & LF & txt0234 if (n and com.sun.star.beans.PropertyAttribute.MAYBEDEFAULT) <> 0 then t = t & LF & txt0235 if (n and com.sun.star.beans.PropertyAttribute.BOUND) <> 0 then t = t & LF & txt0231 if (n and com.sun.star.beans.PropertyAttribute.CONSTRAINED) <> 0 then t = t & LF & txt0232 if (n and com.sun.star.beans.PropertyAttribute.TRANSIENT) <> 0 then t = t & LF & txt0233 end if
s(F3notes) = t End Sub |
XrayTool |
_Main |
foundInXrayList |
Basic |
XrayThisArrayElement (Procedure) XrayThisStructureElement (Procedure) XrayThisProperty (Procedure) XrayThisMethod (Procedure) |
16 |
Function foundInXrayList(newObjName As String) As Boolean Dim kt As Object, y1 As Integer
kt = XrDial.getControl("ListObj") for y1 = 0 to kt.ItemCount -1 if newObjName = kt.getItem(y1) then kt.selectItemPos(y1, true) XrayBack foundInXrayList = true exit function end if next foundInXrayList = false End Function |
XrayTool |
_Main |
getPropertyCategory |
Basic |
FindPropertyDoc (Procedure) properties2String (Procedure) simplifiedPropertyString (Procedure) XrayThisProperty (Procedure) |
40 |
Function getPropertyCategory(propName As String, propAttributes As Long) As Long Dim result As Long, x As Long, interfName As String
result = 0 if introCurrObj.hasProperty(propName, com.sun.star.beans.PropertyConcept.ATTRIBUTES) then result = result or &H00000200 if introCurrObj.hasProperty(propName, com.sun.star.beans.PropertyConcept.PROPERTYSET) then result = result or &H00000400 if (result and &H00000600) <> 0 then result = result or (&H00010000 * propAttributes) x = InStr(1, allPropsNames, "£" & propName & "£", 0) if InStr(x +Len(propName) +2, allPropsNames, "£" & propName & "£", 0) > 0 then result = result or &H00000800 if introCurrObj.hasProperty(propName, com.sun.star.beans.PropertyConcept.METHODS) then result = result or &H00000100 interfName = getPseudoPropInterface("get", propName) if interfName = "several" then result = result or &H00000003 elseif interfName <> "none" then result = result or &H00000001 end if interfName = getPseudoPropInterface("set", propName) if interfName = "several" then result = result or &H0000000C elseif interfName <> "none" then result = result or &H00000004 end if end if
getPropertyCategory = result End Function |
XrayTool |
_Main |
getPseudoPropInterface |
Basic |
FindPropertyDoc (Procedure) getPropertyCategory (Procedure) explainPseudoPropertyCaracteristics (Procedure) |
33 |
Function getPseudoPropInterface(getset As String, propName As String) As String Dim methName As String, interfName As String, result As String Dim info1 As Object, x As Long, y As Long, isGetterSetter As Boolean
result = "none" methName = getset & propName x = InStr(1, allMethodsNamesInterfaces, "£" & methName & "£", 0) Do While x > 0 x = x +Len(methName) +2 y = InStr(x, allMethodsNamesInterfaces, "£", 0) interfName = MidP1P2(allMethodsNamesInterfaces, x, y-1) info1 = introCurrObj.getMethod(join(split(interfName, "."), "_") & "_" & methName, com.sun.star.beans.MethodConcept.ALL) if getset = "get" then isGetterSetter = (UBound(info1.ParameterInfos) < 0) and (info1.ReturnType.Name <> "void") else isGetterSetter = (UBound(info1.ParameterInfos) = 0) and (info1.ReturnType.Name = "void") end if if isGetterSetter then if result = "none" then result = interfName else result = "several" Exit Do end if end if x = InStr(y+1, allMethodsNamesInterfaces, "£" & methName & "£", 0) Loop getPseudoPropInterface = result End Function |
XrayTool |
_Main |
getShortTypeStr |
Basic |
methodsString (Procedure) methodsUsingAnyListener (Procedure) simplifiedStructureElementString (Procedure) simplifiedMethodString (Procedure) |
21 |
Function getShortTypeStr(thisIdlClass As Object) As String Dim tc As Long
tc = thisIdlClass.TypeClass if (tc = com.sun.star.uno.TypeClass.ARRAY) or (tc = com.sun.star.uno.TypeClass.SEQUENCE) then if showAll then getShortTypeStr = "[]" & thisIdlClass.ComponentType.Name else tc = thisIdlClass.ComponentType.TypeClass getShortTypeStr = "[]" & TypeClass2Basic(tc) end if else if showAll then getShortTypeStr = thisIdlClass.Name else getShortTypeStr = TypeClass2Basic(tc) end if end if End Function |
XrayTool |
_Main |
getValueOfProperty |
Basic |
properties2String (Procedure) simplifiedPropertyString (Procedure) XrayThisProperty (Procedure) |
34 |
Sub getValueOfProperty(propName As String, propReadable As Long, propKind As Long, v As Variant, vError As String)
if propReadable > notReadable then if (propKind and &H00000600) <> 0 then vError = "" elseif (propKind and &H00000003) = &H00000001 then if propReadable = arrayProp then vError = checkHugeArray(propName) else vError = "" elseif (propKind and &H00000003) = &H00000003 then vError = "ambiguous" else vError = "not readable" end if else vError = "not readable" end if
if Len(vError) = 0 then on Error Goto nogetValue v = invocCurrObj.getValue(propName) on Error Goto 0 if not IsArray(v) then if propReadable = dataIsAny then propReadable = BasicTypeIsPropReadable(VarType(v)) end if vError = preliminaryDataControl(v) end if Exit Sub
nogetValue: vError = txt0224 & LF & error Resume nogetValue1 nogetValue1: on Error Goto 0 End Sub |
XrayTool |
_Main |
initXrayDisplay |
Basic |
XrayBack (Procedure) Xray (Procedure) checkAndDisplayNewObject (Procedure) |
35 |
Function initXrayDisplay(ObjX2 As Variant, ObjName As String, newObject As Boolean) As Boolean Dim kt As Object, invoc As Object Dim p1 As Integer
initXrayDisplay = True classeIDL = OOoReflection.getType(ObjX2) invoc = CreateUnoService("com.sun.star.script.Invocation") invocCurrObj = invoc.createInstanceWithArguments(Array(ObjX2)) if IsNull(classeIDL) or IsNull(invocCurrObj) then MsgBox(txt0108, 64, WindowTitle) initXrayDisplay = False exit function end if introCurrObj = invocCurrObj.Introspection if newObject then kt = XrDial.getControl("ListObj") kt.Model.Tag = "inhibit" p1 = kt.ItemCount -1 if p1 = UBound(XrObject()) then kt.removeItems(p1, 1) kt.AddItem(ObjName, kt.ItemCount) kt.selectItemPos(kt.ItemCount -1, true) kt.Model.Tag = "allow" XrObject(kt.ItemCount -1) = ObjX2 end if CurrentObj = ObjX2 CurrentObjQualifiedName = ObjName allPropsNames = "" allMethodsNamesInterfaces = "" kt = XrDial.getControl("displayWhat") if kt.SelectedItemPos = 0 then changeDisplay else kt.SelectItemPos(0, True) end if End Function |
XrayTool |
_Main |
interfacesString |
Basic |
changeDisplay (Procedure) |
37 |
Function interfacesString() As String Dim foundInterfaces As String, intfName As String Dim allMainInterfaces As Variant, v As Variant Dim x As Long, y As Long
allMainInterfaces = Array() On Error Resume Next allMainInterfaces = CurrentObj.getTypes() On Error GoTo 0 foundInterfaces = LF if UBound(allMainInterfaces) >= 0 then for x = 0 to UBound(allMainInterfaces) intfName = allMainInterfaces(x).Name exploreInterfacesOfInterface(intfName, foundInterfaces) next else if Len(allMethodsNamesInterfaces) > 0 then allMainInterfaces = split(deleteTrail(allMethodsNamesInterfaces, "£"), "££") for x = 0 to UBound(allMainInterfaces) y = InStr(2, allMainInterfaces(x), "£", 0) intfName = Mid(allMainInterfaces(x), y+1) exploreInterfacesOfInterface(intfName, foundInterfaces) next else end if end if
if Len(foundInterfaces) > 1 then foundInterfaces = Mid(foundInterfaces, 2, Len(foundInterfaces) -2) v = split(foundInterfaces, LF) ShellSort( v() ) interfacesString = join(v(), " " & LF) else interfacesString = " " & LF & txt0116 end if End Function |
XrayTool |
_Main |
listenersString |
Basic |
changeDisplay (Procedure) |
61 |
Function listenersString As String Dim allListeners As Variant, info2 As Object, info3 As Variant Dim s1 As String, s2 As String, allListenerNames As String, t As String Dim x As Long, xMax As Long, y As Long Const listen = "Listener"
allListeners = introCurrObj.SupportedListeners xMax = UBound(allListeners) if xMax < 0 then listenersString = " " & LF & txt0116 Exit Function end if
allListenerNames = LF for x = 0 to xMax t = allListeners(x).Name & LF if InStr(1, allListenerNames, LF & t, 0) = 0 then allListenerNames = allListenerNames & t next allListeners = split(allListenerNames, LF) xMax = UBound(allListeners) -1 Dim listenersDescr(xMax) As String methodsUsingAnyListener(allListenerNames, listenersDescr() )
for x = 1 to xMax info2 = OOoReflection.forName(allListeners(x)) info3 = info2.Methods s1 = "" for y = 0 to UBound(info3) t = info3(y).DeclaringClass.Name if Right(t, Len(listen)) = listen then s2 = info3(y).Name spaceTo(s2, interfacePos, 1) s1 = s1 & LF & s2 & t & " " end if next if Len(s1) > 0 then s2 = " __ " & info2.Name & " __ " s2 = s2 & emptyLine & LF & " _ " & txt0250 & " _ " s1 = s2 & s1 s1 = s1 & emptyLine & LF & " _ " & txt0251 & " _ " s2 = listenersDescr(x) if Len(s2) > 0 then listenersDescr(x) = s1 & s2 & emptyLine & emptyLine else listenersDescr(x) = s1 & txt0116 & emptyLine & emptyLine end if else listenersDescr(x) = "" end if next ShellSort( listenersDescr() ) s1 = textFromUniqueStrings( listenersDescr() ) if Left(s1, 1) = LF then s1 = Mid(s1, 2) s1 = amputeRight(s1, 2*Len(emptyLine)) if Len(s1) = 0 then listenersString = " " & LF & txt0116 else listenersString = s1 end if End Function |
XrayTool |
_Main |
methodsString |
Basic |
changeDisplay (Procedure) |
44 |
Function methodsString(ordering As String) As String Dim info1 As Variant, info2 As Object, info3 As Variant, paramModes As Variant Dim infoParam As Object, methodsArray As Variant Dim methInf As String, methodx As String, methRetx As String, methodsList As String Dim x As Long, xMax As Long, y As Long
paramModes = Array("", "OUT! ", "IN/OUT! ") info1 = introCurrObj.getMethods(com.sun.star.beans.MethodConcept.ALL) xMax = UBound(info1) if xMax < 0 then methodsString = " " & LF & txt0116 Exit Function end if methodsList = LF for x = 0 to xMax info2 = info1(x) methodx = info2.Name y = InStr(1, allMethodsNamesInterfaces, "£" & methodx & "£", 0) if InStr(y +Len(methodx) +2, allMethodsNamesInterfaces, "£" & methodx & "£", 0) > 0 then methodx = methodx & ambiguousMethodFlag spaceTo(methodx, methArgsPos, 1) info3 = info2.ParameterInfos methInf = "" for y = 0 to UBound(info3) infoParam = info3(y) methInf = methInf & paramModes(infoParam.aMode) & infoParam.aName & " as " & getShortTypeStr(infoParam.aType) & ", " next methodx = methodx & "( " & deleteTrail(methInf, ", ") & " )" methRetx = getShortTypeStr(info2.ReturnType) if methRetx <> "void" then spaceTo(methodx, methReturnPos, 1) methodx = methodx & "AS " & methRetx end if spaceTo(methodx, methInterfPos, 2) methodx = methodx & info2.DeclaringClass.Name & " " if InStr(1, methodsList, LF & methodx & LF, 0) = 0 then methodsList = methodsList & methodx & LF next methodsList = Mid(methodsList, 2, Len(methodsList) -2) if ordering = "AZ" then methodsArray = split(methodsList, LF) ShellSort( methodsArray() ) methodsList = join(methodsArray(), LF) end if methodsString = methodsList End Function |
XrayTool |
_Main |
methodsUsingAnyListener |
Basic |
listenersString (Procedure) |
28 |
Sub methodsUsingAnyListener(allListenerNames As String, listenersDescr As Variant) Dim allMethods As Variant, v As Variant Dim methodInfos As Object, info3 As Object, infoParam As Object Dim x As Long, y As Long, z As Long, posListen As Long Dim t As String, paramType As String
allMethods = introCurrObj.getMethods(com.sun.star.beans.MethodConcept.ALL) for x = 0 to UBound(allMethods) methodInfos = allMethods(x) info3 = methodInfos.ParameterInfos for y = 0 to UBound(info3) infoParam = info3(y) paramType = getShortTypeStr(infoParam.aType) if Left(paramType, 2) = "[]" then paramType = Mid(paramType, 3) posListen = InStr(1, allListenerNames, LF & paramType & LF, 0) if posListen > 0 then t = Left(allListenerNames, posListen) v = split(t, LF) z = UBound(v) t = methodInfos.Name & "()" spaceTo(t, interfacePos, 1) t = t & methodInfos.DeclaringClass.Name & " " if InStr(1, listenersDescr(z), LF & t, 0) = 0 then listenersDescr(z) = listenersDescr(z) & LF & t end if next next End Sub |
XrayTool |
_Main |
prepareXray |
Basic |
Xray (Procedure) |
55 |
Sub prepareXray Dim kt As Object
OOoReflection = CreateUnoService("com.sun.star.reflection.CoreReflection") OOoTypeDescr = GetDefaultContext.getByName("/singletons/com.sun.star.reflection.theTypeDescriptionManager")
TypeClass2Basic = Array( _ "void", "char", "boolean", "byte", "integer", _ "integer", "long", "long", "hyper", "hyper", _ "single", "double", "string", "type", "variant", _ "integer", "object", "struct", "object", "object", _ "array", "array", "object", "object", "object", _ "object", "object", "unknown", "object", "object", _ "object", "object")
TypeClassIsPropReadable = Array( _ notReadable, OKreadable, OKreadable, OKreadable, OKreadable, _ OKreadable, OKreadable, OKreadable, OKreadable, OKreadable, _ OKreadable, OKreadable, OKreadable, notReadable, dataIsAny, _ OKreadable, notReadable, noDisplay, notReadable, notReadable, _ arrayProp, arrayProp, noDisplay, noDisplay, noDisplay, _ notReadable, notReadable, notReadable, notReadable, OKreadable, _ notReadable, notReadable)
BasicTypeIsPropReadable = Array( _ OKreadable, OKreadable, OKreadable, OKreadable, OKreadable, OKreadable, OKreadable, OKReadable, _ OKreadable, noDisplay, notReadable, OKreadable, noDisplay, notReadable, notReadable, notReadable, _ OKreadable, OKreadable, OKreadable, OKreadable, OKreadable, notReadable, notReadable, notReadable, _ notReadable, notReadable, notReadable, notReadable, notReadable, notReadable, notReadable, notReadable, _ notReadable, notReadable, notReadable, OKReadable, notReadable, OKReadable, notReadable, notReadable, _ notReadable)
pseudoprop = Array("", "(get), read-only, ", "", "(get?), read-only, ", "(set), write-only, ", "(get,set), ", _ "(set), write-only, ", "(get?,set), ", "", "(get), read-only, ", "", "(get?), read-only, ", "(set?), write-only, ", _ "(get,set?), ", "(set?), write-only, ", "(get?,set?), " )
LF = chr(10) emptyLine = LF & " " initDlgXray End Sub |
XrayTool |
_Main |
properties2String |
Basic |
propertiesPanelString (Procedure) |
36 |
Function properties2String(ordering As String) As String Dim info1 As Variant, info2 As Object, v As Variant Dim x As Long, xMax As Long, propReadable As Long, propKind As Long Dim propInf As String, propValue As String, propComment As String, propName As String Dim vError As String
if Len(allMethodsNamesInterfaces) = 0 then buildAllMethodsNamesInterfaces info1 = introCurrObj.getProperties(com.sun.star.beans.PropertyConcept.ALL) xMax = UBound(info1) if xMax < 0 then properties2String = " " & LF & txt0116 Exit Function end if if Len(allPropsNames) = 0 then for x = 0 to xMax info2 = info1(x) allPropsNames = allPropsNames & "£" & info2.Name & "£" next end if Dim intf2(xMax) As String for x = 0 to xMax info2 = info1(x) propInf = replaceSpaces(info2.Name) spaceTo(propInf, propTypePos, 1) addShortTypeStr(info2.Type, propInf, propReadable) propKind = getPropertyCategory(info2.Name, info2.Attributes) propComment = createPropertyComments(propKind) getValueOfProperty(info2.Name, propReadable, propKind, v, vError) getShortStringFromValueOfProperty(info2, v, vError, propValue, propComment) addValueToDisplay(propInf, propValue) intf2(x) = propInf & deleteTrail(propComment, ", ") & " " next if ordering = "AZ" then ShellSort(intf2()) properties2String = join(intf2(), LF) End Function |
XrayTool |
_Main |
propertiesPanelString |
Basic |
changeDisplay (Procedure) |
42 |
Function propertiesPanelString(ordering As String) As String Dim kt As Object Dim objInternalName As String, typ As String, header As String
if showAll then propValPos = 72 propValMinWidth = 20 else propValPos = 67 propValMinWidth = 9 end if kt = XrDial.getControl("HeaderLabel") if IsArray(CurrentObj) then typ = deleteTrail( LCase(TypeName(CurrentObj)), "()" ) objInternalName = txt0201 & typ propertiesPanelString = Value2Str(CurrentObj, showFullString +showHexaValue) enableControls(XrDial, Array("showAllFlag", "AZflag", "displayWhat", "SDKBtn"), False) elseif classeIDL.TypeClass = com.sun.star.uno.TypeClass.STRUCT then objInternalName = classeIDL.Name header = " " & txt0409 spaceTo(header, propTypePos, 1) header = header & txt0402 addValueToDisplay(header, txt0403) kt.Text = header & txt0404 propertiesPanelString = structure2String(ordering) enableControls(XrDial, Array("displayWhat"), False) elseif (VarType(CurrentObj) = 9) and not IsNull(introCurrObj) then objInternalName = classeIDL.Name header = " " & txt0401 spaceTo(header, propTypePos, 1) header = header & txt0402 addValueToDisplay(header, txt0403) kt.Text = header & txt0404 propertiesPanelString = properties2String(ordering) else objInternalName = txt0203 & LCase(TypeName(CurrentObj)) propertiesPanelString = Value2Str(CurrentObj, showFullString +showHexaValue) enableControls(XrDial, Array("showAllFlag", "AZflag", "displayWhat", "SDKBtn", "DeeperBtn", "PrettyDisplayBtn"), False) end if kt = XrDial.getControl("currentObjName") kt.Text = objInternalName End Function |
XrayTool |
_Main |
servicesString |
Basic |
changeDisplay (Procedure) |
37 |
Function servicesString() As String Dim v As Variant, x As Long Dim avServ As String, avSupp As String
v = Array() On Error Resume Next v = CurrentObj.getSupportedServiceNames On Error GoTo 0 if UBound(v) < 0 then avSupp = txt0116 else avSupp = LF for x = 0 to UBound(v) exploreServicesOfService(v(x), avSupp) next v = split(Mid(avSupp, 2, Len(avSupp) -2), LF) ShellSort(v()) avSupp = join(v(), LF) end if
v = Array() On Error Resume Next v = CurrentObj.getAvailableServiceNames On Error GoTo 0 if UBound(v) < 0 then avServ = txt0116 else ShellSort(v()) avServ = join(v(), " " & LF) & " " end if
servicesString = " " & String(5, "_") & " " & txt0101 & " " & String(5, "_") & _ emptyLine & LF & avSupp & _ emptyLine & emptyLine & LF & _ " " & String(5, "_") & " " & txt0102 & " " & String(5, "_") & _ emptyLine & LF & avServ End Function |
XrayTool |
_Main |
simplifiedArrayElementString |
Basic |
prettyDisplayPropMethod (Procedure) |
15 |
Function simplifiedArrayElementString(arrayIndex As String) As Variant Dim s(F3max) As String, t As Variant Dim elemVal As Variant, idxList As Variant
t = split(CurrentObjQualifiedName, ".") s(F3name) = t(UBound(t)) & arrayIndex idxList = split(MidP1P2(arrayIndex, 2, Len(arrayIndex) -1), ",") elemVal = getArrayElement(CurrentObj, UBound(idxList) +1, idxList) s(F3type) = deleteTrail( LCase(TypeName(elemVal)), "()" ) s(F3value) = Value2Str(elemVal, showFullString +showHexaValue) if VarType(elemVal) = 9 then s(F3value) = LF & LF & txt0114 simplifiedArrayElementString = s() End Function |
XrayTool |
_Main |
simplifiedMethodString |
Basic |
prettyDisplayPropMethod (Procedure) |
43 |
Function simplifiedMethodString(methName As String, currentLine As String) As Variant Dim s(F3max) As String, t As String, fullMethName As String, errNoXray As String Dim info1 As Object, info2 As Object, n As Long Dim params As Variant, paraModes As Variant, paramType As String
paraModes = split(txt0211, "£") s(F3name) = methName s(F3Interface_Service) = getLastWordOfString(currentLine) fullMethName = join(split(s(F3Interface_Service), "."), "_") & "_" & methName if InStr(1, currentLine, methName & ambiguousMethodFlag, 0) = 1 then s(F3Notes) = txt0238 & LF & txt0239 & LF & fullMethName & "( ) " end if info1 = introCurrObj.getMethod(fullMethName, com.sun.star.beans.MethodConcept.ALL) params = info1.ParameterInfos if UBound(params) < 0 then s(F3parameters) = txt0215 else t = "" if UBound(params) > 0 then s(F3canXray) = "noXray" for n = 0 to UBound(params) info2 = params(n) if n = 0 then paramType = info2.aType.Name if InStr(1, acceptedParamTypes, "£" & paramType & "£", 0) = 0 then s(F3canXray) = "noXray" end if end if t = t & txt0214 & (n+1) & paraModes(info2.aMode) & info2.aName & " as " & getShortTypeStr(info2.aType, paramType) & LF next s(F3parameters) = deleteTrail(t, LF) end if t = getShortTypeStr(info1.ReturnType, t) if t = "void" then s(F3type) = txt0216 else s(F3type) = t end if
if Len(errNoXray) > 0 then s(F3canXray) = "noXray" simplifiedMethodString = s() End Function |
XrayTool |
_Main |
simplifiedPropertyString |
Basic |
prettyDisplayPropMethod (Procedure) |
54 |
Function simplifiedPropertyString(propName As String) As Variant Dim s(F3max) As String, t As String, vError As String, t2 As String Dim propValue As String, propType As String Dim info1 As Variant, info2 As Object, v As Variant Dim propKind As Long, propReadable As Long, x As Long
s(F3name) = propName info2 = introCurrObj.getProperty(propName, com.sun.star.beans.PropertyConcept.ALL) addShortTypeStr(info2.Type, propType, propReadable) s(F3type) = propType propKind = getPropertyCategory(propName, info2.Attributes) getValueOfProperty(propName, propReadable, propKind, v, vError)
s(F3notes) = "" if (propKind and &H00000100) <> 0 then explainPseudoPropertyCaracteristics(propName, propKind, s) else explainPropertyCaracteristics(propName, propKind, s) end if t = s(F3notes) if Len(vError) = 0 then s(F3value) = Value2Str(v, showFullString +showHexaValue) if (propType = "any") or (propType = "variant") then s(F3type) = propType & " (" & LCase(TypeName(v)) & ")" t2 = getEnumStringValue(info2.Type, v, " ") if Len(t2) > 0 then s(F3value) = s(F3value) & LF & LF & txt0237 & LF & t2 & " " else t2 = colorComments(propName, v, showFullString) if Len(t2) > 0 then s(F3value) = s(F3value) & LF & LF & t2 & " " s(F3Color) = v end if end if if (propReadable = noDisplay) and (Len(s(F3canXray)) = 0) then s(F3value) = LF & LF & txt0114 elseif vError = "not readable" then if Len(s(F3canXray)) = 0 then s(F3value) = LF & LF & txt0114 elseif vError = "ambiguous" then elseif InStr(1, vError, txt0224, 0) = 1 then s(F3important) = txt0224 t = t & Mid(vError, Len(txt0224) +1) elseif InStr(1, vError, txt0125, 0) = 1 then s(F3important) = txt0125 t = t & Mid(vError, Len(txt0125) +1) else s(F3important) = vError end if
s(F3notes) = Mid(t, 2) simplifiedPropertyString = s() End Function |
XrayTool |
_Main |
simplifiedStructureElementString |
Basic |
prettyDisplayPropMethod (Procedure) |
45 |
Function simplifiedStructureElementString(elemName As String) As Variant Dim s(F3max) As String, t As String, t2 As String, errMess As String Dim elemX As Object, accMode As Long Dim elemVal As Variant
s(F3name) = elemName t = "" elemX = classeIDL.getField(elemName) s(F3type) = getShortTypeStr(elemX.Type) accMode = elemX.AccessMode if accMode = com.sun.star.reflection.FieldAccessMode.READONLY then t = t & LF & txt0223 end if if accMode = com.sun.star.reflection.FieldAccessMode.WRITEONLY then t = t & LF & txt0222 s(F3canXray) = "noXray" else elemVal = elemX.get(CurrentObj) errMess = preliminaryDataControl(elemVal) if Len(errMess) > 0 then s(F3important) = errMess s(F3canXray) = "noXray" else s(F3value) = Value2Str(elemVal, showFullString +showHexaValue) if Len(s(F3value)) = 0 then s(F3value) = LF & LF & txt0114 else t2 = getEnumStringValue(elemX.Type, elemVal, " ") if Len(t2) > 0 then s(F3value) = s(F3value) & LF & LF & txt0237 & LF & t2 & " " else t2 = colorComments(elemName, elemVal, showFullString) if Len(t2) > 0 then s(F3value) = s(F3value) & LF & LF & t2 & " " s(F3Color) = elemVal end if end if end if end if end if s(F3notes) = Mid(t, 2) simplifiedStructureElementString = s() End Function |
XrayTool |
_Main |
structure2String |
Basic |
propertiesPanelString (Procedure) |
42 |
Function structure2String(ordering As String) As String Dim elemList As Variant, elemX As Object, v As Variant Dim x As Long, xMax As Long, accMode As Long Dim structInf As String Dim elemComment As String, vError As String, elemVal As String Dim propReadable As Long elemList = classeIDL.Fields xMax = UBound(elemList) Dim intf2(xMax) As String for x = 0 to xMax elemX = elemList(x) structInf = elemX.Name spaceTo(structInf, propTypePos, 1) addShortTypeStr(elemX.Type, structInf, propReadable) elemComment = "" accMode = elemX.AccessMode if accMode = com.sun.star.reflection.FieldAccessMode.WRITEONLY then elemComment = "write-only, " else if accMode = com.sun.star.reflection.FieldAccessMode.READONLY then elemComment = "read-only, " on Error Goto nogetValue v = elemX.get(CurrentObj) on Error Goto 0 vError = preliminaryDataControl(v) nogetValue2: getShortStringFromValueOfProperty(elemX, v, vError, elemVal, elemComment) addValueToDisplay(structInf, elemVal) end if intf2(x) = structInf & deleteTrail(elemComment, ", ") & " " next if ordering = "AZ" then ShellSort(intf2()) structure2String = join(intf2(), LF) Exit Function
nogetValue: vError = txt0224 & LF & error Resume nogetValue1 nogetValue1: on Error Goto 0 GoTo nogetValue2 End Function |
XrayTool |
_Main |
Xray |
Basic |
XrayMenu (Procedure) |
31 |
Sub Xray(Optional ObjX As Variant) Dim kt As Object, isCompatibilityModeTrue As Boolean
if IsMissing(ObjX) then MsgBox(txt0121, 64, WindowTitle) Exit Sub end if
isCompatibilityModeTrue = True On Error Resume Next isCompatibilityModeTrue = testPrivateAccess On Error GoTo 0 if isCompatibilityModeTrue then CompatibilityMode(False)
prepareXray if isWorthXray(ObjX) then OriginalObj = ObjX if initXrayDisplay(ObjX, txt0113, true) then kt = XrDial.getControl("OriginName") kt.Text = txt0115 On Error Resume Next kt.Text =OriginalObj.ImplementationName On Error Goto 0 XrDial.Execute XrDial.Dispose end if end if if isCompatibilityModeTrue then CompatibilityMode(True) End Sub |
XrayTool |
_Main |
XrayDeeper2 |
Basic |
keyOnXrayInfo (Procedure) showPrettyDisplay (Procedure) XrayDeeper (Procedure) MouseReleaseOnDisplay (Procedure) |
22 |
Sub XrayDeeper2(currentLine As String, firstWord As String) Dim v As Variant
firstWord = restoreSpaces(firstWord) if XrayDisplayWhat = "properties" then if Left(firstWord, 1) = "(" then XrayThisArrayElement(firstWord) elseif classeIDL.TypeClass = com.sun.star.uno.TypeClass.STRUCT then XrayThisStructureElement(firstWord) else XrayThisProperty(firstWord) end if elseif XrayDisplayWhat = "methods" then if InStr(1, currentLine, firstWord & ambiguousMethodFlag, 0) = 1 then XrayThisMethod(firstWord, getLastWordOfString(currentLine) ) else XrayThisMethod(firstWord, "") end if end if FocusOnInfoControl End Sub |
XrayTool |
_Main |
XrayThisArrayElement |
Basic |
XrayDeeper2 (Procedure) |
21 |
Sub XrayThisArrayElement(arrayIndex As String) Dim qp2 As String, errMess As String Dim newObj As Variant, idxList As Variant
qp2 = CurrentObjQualifiedName & arrayIndex if not foundInXrayList(qp2) then idxList = split(MidP1P2(arrayIndex, 2, Len(arrayIndex) -1), ",") On Error Goto doesnotwork newObj = getArrayElement(CurrentObj, UBound(idxList) +1, idxList) On Error Goto 0 checkAndDisplayNewObject(newObj, qp2) end if Exit Sub
doesnotwork: errMess = Error Resume doesnotwork1 doesnotwork1: On Error Goto 0 MsgBox(txt0108 & LF & errMess, 64, WindowTitle) End Sub |
XrayTool |
_Main |
XrayThisMethod |
Basic |
XrayDeeper2 (Procedure) |
71 |
Sub XrayThisMethod(methName As String, interf As String) Dim fullMethName As String, qp2 As String, paramValue As String, paramType As String, errMess As String Dim info1 As Object, info2 As Object, params As Variant, newObj As Variant, v As Variant
errMess = checkHugeArray(methName) if Len(errMess) > 0 then GoTo reportError if Len(interf) = 0 then fullMethName = methName else fullMethName = join(split(interf, "."), "_") & "_" & methName end if info1 = introCurrObj.getMethod(fullMethName, com.sun.star.beans.MethodConcept.ALL) if info1.ReturnType.Name = "void" then MsgBox(txt0117, 64, WindowTitle) else params = info1.ParameterInfos Select Case UBound(params) Case -1 qp2 = CurrentObjQualifiedName & "." & fullMethName & "()" if foundInXrayList(qp2) then Exit Sub On Error Goto doesnotwork1 newObj = invocCurrObj.invoke(fullMethName, Array(), Array(), Array() ) On Error Goto 0 checkAndDisplayNewObject(newObj, qp2) Case 0 info2 = params(0) if info2.aMode = com.sun.star.reflection.ParamMode.OUT then qp2 = CurrentObjQualifiedName & "." & fullMethName & "(v)" On Error Goto doesnotwork1 newObj = invocCurrObj.invoke(fullMethName, Array(v), Array(0), Array(v) ) On Error Goto 0 checkAndDisplayNewObject(newObj, qp2) else paramType = info2.aType.Name if InStr(1, acceptedParamTypes, "£" & paramType & "£", 0) = 0 then MsgBox(txt0119, 64, WindowTitle) else paramValue = InputBox(txt0228 & paramType, WindowTitle, "") if paramType = "string" then qp2 = CurrentObjQualifiedName & "." & fullMethName & "(""" & paramValue & """)" else qp2 = CurrentObjQualifiedName & "." & fullMethName & "(" & paramValue & ")" end if if foundInXrayList(qp2) then Exit Sub On Error Goto doesnotwork2 v = CreateUnoValue(paramType, paramValue) if info2.aMode = com.sun.star.reflection.ParamMode.INOUT then newObj = invocCurrObj.invoke(fullMethName, Array(v), Array(0), Array(v) ) else newObj = invocCurrObj.invoke(fullMethName, Array(v), Array(), Array() ) end if On Error Goto 0 checkAndDisplayNewObject(newObj, qp2) end if end if Case Else MsgBox(txt0124, 64, WindowTitle) End Select end if Exit Sub
doesnotwork1: errMess = txt0108 & LF & LF & Error Resume reportError doesnotwork2: errMess = txt0111 & LF & LF & Error Resume reportError reportError: On Error Goto 0 MsgBox(errMess, 16, WindowTitle) End Sub |
XrayTool |
_Main |
XrayThisProperty |
Basic |
XrayDeeper2 (Procedure) |
28 |
Sub XrayThisProperty(propName As String) Dim info2 As Object, newObj As Variant Dim propReadable As Long, propKind As Long Dim propInf As String, vError As String, qp2 As String
if InStr(1, propName, " ", 0) > 0 then qp2 = CurrentObjQualifiedName & ".getPropertyValue(""" & propName & """)" else qp2 = CurrentObjQualifiedName & "." & propName end if if foundInXrayList(qp2) then Exit Sub
info2 = introCurrObj.getProperty(propName, com.sun.star.beans.PropertyConcept.ALL) addShortTypeStr(info2.Type, propInf, propReadable) propKind = getPropertyCategory(propName, info2.Attributes) if propReadable = notReadable then propReadable = OKreadable getValueOfProperty(info2.Name, propReadable, propKind, newObj, vError) Select Case vError Case "not readable" MsgBox(txt0120, 64, WindowTitle) Case "ambiguous" MsgBox(replaceTag(txt0243, "getXxx", "get" & propName & "( ) "), 64, WindowTitle) Case "" checkAndDisplayNewObject(newObj, qp2) Case Else MsgBox(vError, 64, WindowTitle) End Select End Sub |
XrayTool |
_Main |
XrayThisStructureElement |
Basic |
XrayDeeper2 (Procedure) |
26 |
Sub XrayThisStructureElement(fieldName As String) Dim elemX As Object, newObj As Variant Dim accMode As Long, qp2 As String, errMess As String
elemX = classeIDL.getField(fieldName) accMode = elemX.AccessMode if accMode = com.sun.star.reflection.FieldAccessMode.WRITEONLY then MsgBox(txt0120, 64, WindowTitle) else qp2 = CurrentObjQualifiedName & "." & fieldName if not foundInXrayList(qp2) then On Error Goto doesnotwork newObj = elemX.get(CurrentObj) On Error Goto 0 checkAndDisplayNewObject(newObj, qp2) end if end if Exit Sub
doesnotwork: errMess = Error Resume doesnotwork1 doesnotwork1: On Error Goto 0 MsgBox(txt0108 & LF & errMess, 64, WindowTitle) End Sub |
XrayTool |
_UITexts |
TextTranslation |
Basic |
|
3 |
Sub TextTranslation MsgBox("Translators should read the module _UITexts ", 48, WindowTitle) End Sub |
XrayTool |
_Utilities |
amputeRight |
Basic |
XrayDaddyObject (Procedure) array2String (Procedure) arrayElement2String (Procedure) listenersString (Procedure) |
7 |
Function amputeRight(fullString As String, L As Long) As String if (L<0) or (L>Len(fullString)) then Err = 14 end if amputeRight = Mid(fullString, 1, Len(fullString) - L) End Function |
XrayTool |
_Utilities |
CenterDialog |
Basic |
initDlgXray (Procedure) createDialogue (Procedure) |
19 |
Sub CenterDialog(dlg As Object) Dim mainFrame As Object, dlgSize As Object Dim XPos As Long, YPos As Long
if IsNull(StarDesktop.CurrentFrame) then exit sub if IsNull(StarDesktop.CurrentFrame.ContainerWindow) then exit sub mainFrame = StarDesktop.CurrentFrame.ContainerWindow.OutputSize dlgSize = dlg.OutputSize XPos = (mainFrame.Width/2) - (dlgSize.Width/2) if XPos < 0 then XPos = 0 YPos = (mainFrame.Height/2) - (dlgSize.Height/2) if YPos < 0 then YPos = 0 dlg.setPosSize(XPos, YPos, 0, 0, com.sun.star.awt.PosSize.POS) End Sub |
XrayTool |
_Utilities |
checkHugeArray |
Basic |
getValueOfProperty (Procedure) XrayThisMethod (Procedure) |
26 |
Function checkHugeArray(firstWord As String) As String Dim ra As Object, nbrCols As Long, nbrRows As Long, nbrCells As Double, t As String Const danger = "/Data/DataArray/FormulaArray/getData/getDataArray/getFormulaArray/"
checkHugeArray = "" if InStr(1, danger, "/" & firstWord & "/", 0) = 0 then Exit Function On Error GoTo noRangeAddr ra = CurrentObj.RangeAddress nbrCols = ra.EndColumn -ra.StartColumn +1 nbrRows = ra.EndRow -ra.StartRow +1 nbrCells = CDbl(nbrCols) * CDbl(nbrRows) if nbrCells > 4000.0 then t = replaceTag(txt0126, "%%", "" & nbrCols & " x " & nbrRows & " = " & nbrCells) checkHugeArray = txt0125 & LF & t end if On Error GoTo 0 Exit Function
noRangeAddr: Resume Label1 Label1: On Error GoTo 0 End Function |
XrayTool |
_Utilities |
CHex |
Basic |
Value2Str (Procedure) |
14 |
Function CHex(nbr As Long, digits As Long) As String Dim s2 As String
s2 = hex(nbr) if nbr >= 0 then do While Len(s2) < digits s2 = "0" & s2 Loop else s2 = Right(s2, digits) end if CHex = s2 End Function |
XrayTool |
_Utilities |
colorComments |
Basic |
getShortStringFromValueOfProperty (Procedure) simplifiedStructureElementString (Procedure) simplifiedPropertyString (Procedure) |
21 |
Function colorComments(itemName As String, colorValue As Variant, howToDisplay As Long) As String Dim t1 As String, t2 As String
t1 = "" if (InStr(1, itemName, "Color", 0) > 0 ) and (VarType(colorValue) = 3) then if howToDisplay = showFullString then if colorValue = -1 then t1 = txt0602 elseif (colorValue >= 0) and (colorValue <= 16777215) then t1 = txt0603 & Red(colorValue) & space(5) & txt0604 & Green(colorValue) & space(5) & txt0605 & Blue(colorValue) t2 = getColorName(colorValue) if Len(t2) > 0 then t1 = t1 & LF & txt0601 & t2 end if elseif (colorValue > 0) and (colorValue <= 16777215) then t1 = "RGB(" & Red(colorValue) & "," & Green(colorValue) & "," & Blue(colorValue) & ")" end if end if colorComments = t1 End Function |
XrayTool |
_Utilities |
createDialogue |
Basic |
initDlgXray (Procedure) XrayConfigDialog (Procedure) prettyDisplayPropMethod (Procedure) findInText (Procedure) |
20 |
Function createDialogue(DialogName as String, SubTitle As String, Optional Center As Boolean) Dim oLib as Object, dlg as Object
GlobalScope.DialogLibraries.loadLibrary(Libname) oLib = GlobalScope.DialogLibraries.getByName(Libname) dlg = CreateUnoDialog(oLib.getByName(DialogName)) if Len(SubTitle) = 0 then dlg.Model.Title = WindowTitle else dlg.Model.Title = WindowTitle & Space(10) & "- " & SubTitle & " -" end if if not isMissing(Center) then if Center then CenterDialog(dlg) else dlg.setPosSize(0, 0, 0, 0, com.sun.star.awt.PosSize.POS) end if createDialogue = dlg End Function |
XrayTool |
_Utilities |
deleteTrail |
Basic |
BrowseSDK2 (Procedure) array2String (Procedure) propertiesPanelString (Procedure) structure2String (Procedure) properties2String (Procedure) methodsString (Procedure) interfacesString (Procedure) simplifiedArrayElementString (Procedure) simplifiedMethodString (Procedure) findInterfaceOfAttribute (Procedure) |
11 |
Function deleteTrail(s As String, end1 As String) As String Dim e As String
e = Right(s, Len(end1)) if e = end1 then deleteTrail = Mid(s, 1, Len(s) -Len(end1)) else deleteTrail = s end if End Function |
XrayTool |
_Utilities |
enableControls |
Basic |
propertiesPanelString (Procedure) changeDisplay (Procedure) XrayMenu (Procedure) |
8 |
Sub enableControls(dlg As Object, ControlsNamesList As Variant, newState As Boolean) Dim k As Object, n As Long
for n = 0 to UBound(ControlsNamesList) k = dlg.getControl(ControlsNamesList(n)) k.Enable = newState next End Sub |
XrayTool |
_Utilities |
exploreInterfacesOfInterface |
Basic |
interfacesString (Procedure) |
16 |
Sub exploreInterfacesOfInterface(intfName As String, foundInterfaces As String) Dim x As Long, intf As Object, allBaseInterfaces As Variant
if InStr(1, foundInterfaces, LF & intfName & " " & LF, 0) > 0 then Exit Sub intf = OOoReflection.forName(intfName) if intf.TypeClass = com.sun.star.uno.TypeClass.INTERFACE then foundInterfaces = foundInterfaces & intfName & " " & LF allBaseInterfaces = intf.getSuperClasses() for x = 0 to UBound(allBaseInterfaces) exploreInterfacesOfInterface(allBaseInterfaces(x).Name, foundInterfaces) next end if End Sub |
XrayTool |
_Utilities |
exploreServicesOfService |
Basic |
servicesString (Procedure) |
21 |
Sub exploreServicesOfService(servName As String, foundServices As String) Dim servDescr As Object, allBaseServ As Variant Dim x As Long
if InStr(1, foundServices, LF & servName & " " & LF, 0) > 0 then Exit Sub foundServices = foundServices & servName & " " & LF if OOoTypeDescr.hasByHierarchicalName(servName) then servDescr = OOoTypeDescr.getByHierarchicalName(servName) allBaseServ = servDescr.MandatoryServices for x = 0 to UBound(allBaseServ) exploreServicesOfService(allBaseServ(x).Name, foundServices) next allBaseServ = servDescr.OptionalServices for x = 0 to UBound(allBaseServ) exploreServicesOfService(allBaseServ(x).Name, foundServices) next end if End Sub |
XrayTool |
_Utilities |
FindFirstFindNext |
Basic |
DlgFind|FindFirstBtn (Control) DlgFind|FindNextBtn (Control) |
9 |
Sub FindFirstFindNext(evt As Object) Dim dlg As Object, k As Object
k = evt.Source dlg = k.Context dlg.Model.Tag = k.Model.Name dlg.endExecute End Sub |
XrayTool |
_Utilities |
findInterfaceOfAttribute |
Basic |
FindPropertyDoc (Procedure) explainAttribute (Procedure) |
31 |
Function findInterfaceOfAttribute(attribName As String) As String Dim foundInterface As String, methInterfaces As String, intfName As String, allMainInterfaces As Variant Dim x As Long
allMainInterfaces = Array() On Error Resume Next allMainInterfaces = CurrentObj.getTypes() On Error GoTo 0 methInterfaces = LF foundInterface = "" if UBound(allMainInterfaces) >= 0 then for x = 0 to UBound(allMainInterfaces) intfName = allMainInterfaces(x).Name searchForAttribute(attribName, intfName, methInterfaces, foundInterface) if Len(foundInterface) > 0 then Exit For next else if Len(allMethodsNamesInterfaces) > 0 then allMainInterfaces = split(deleteTrail(allMethodsNamesInterfaces, "£"), "££") for x = 0 to UBound(allMainInterfaces) y = InStr(2, allMainInterfaces(x), "£", 0) intfName = Mid(allMainInterfaces(x), y+1) searchForAttribute(attribName, intfName, methInterfaces, foundInterface) if Len(foundInterface) > 0 then Exit For next else end if end if findInterfaceOfAttribute = foundInterface End Function |
XrayTool |
_Utilities |
findInText |
Basic |
keyOnXrayInfo (Procedure) keyOnDlgVal (Procedure) |
57 |
Sub findInText(controlText As Object) Dim sel As Object, FindDial As Object, k As Object Dim theText As String, selectedTerm As String, searchTerm As String, button As String Dim x As Long, startPos As Long
theText = controlText.Text sel = controlText.Selection if sel.Min < sel.Max then selectedTerm = MidP1P2(theText, sel.Min +1, sel.Max) if InStr(1, LF & searchTexts & LF, LF & selectedTerm & LF, 1) = 0 then if Len(searchTexts) > 0 then searchTexts = selectedTerm & LF & searchTexts else searchTexts = selectedTerm end if end if else selectedTerm = "" end if if InStr(1, selectedTerm, LF, 0) > 0 then Exit Sub x = -1 Do if (Len(selectedTerm) > 0) and (x <> 0) then startPos = sel.Min +Len(selectedTerm) +1 searchTerm = selectedTerm else FindDial = createDialogue("DlgFind", txt0265) if x = 0 then FindDial.Model.Step = 2 else FindDial.Model.Step = 1 k = FindDial.getControl("FindComboBox") if Len(searchTexts) > 0 then k.Model.StringItemList = split(searchTexts, LF) k.Text = searchTerm FindDial.execute searchTerm = k.Text if InStr(1, LF & searchTexts & LF, LF & searchTerm & LF, 1) = 0 then if Len(searchTexts) > 0 then searchTexts = searchTerm & LF & searchTexts else searchTexts = searchTerm end if end if button = FindDial.Model.Tag FindDial.dispose Select Case button Case "FindFirstBtn" startPos = 1 Case "FindNextBtn" startPos = sel.Min +2 Case Else Exit Sub End Select end if x = InStr(startPos, theText, searchTerm, 1) Loop Until x > 0 sel.Min = x -1 sel.Max = x +Len(searchTerm) -1 controlText.Selection = sel End Sub |
XrayTool |
_Utilities |
findServiceOfRealProperty |
Basic |
FindPropertyDoc (Procedure) explainRealProperty (Procedure) |
16 |
Function findServiceOfRealProperty(propName As String) As String Dim allSupportedServices As Variant Dim x As Long, servName As String, foundService As String
allSupportedServices = Array() On Error Resume Next allSupportedServices = CurrentObj.getSupportedServiceNames On Error GoTo 0 foundService = "" for x = 0 to UBound(allSupportedServices) servName = allSupportedServices(x) searchPropertyInService(propName, servName, foundService) if Len(foundService) > 0 then Exit For next findServiceOfRealProperty = foundService End Function |
XrayTool |
_Utilities |
firstWordInCurrentLine |
Basic |
BrowseSDK (Procedure) keyOnXrayInfo (Procedure) showPrettyDisplay (Procedure) XrayDeeper (Procedure) MouseReleaseOnDisplay (Procedure) |
15 |
Sub firstWordInCurrentLine(currentLine As String, firstWord As String) Dim y2 As Long
currentLine = getCurrentLineInInfos(False) y2 = InStr(1, currentLine, " ", 0) Select Case y2 Case 0 firstWord = "" Case 1 firstWord = "" Case Else firstWord = Left(currentLine, y2 - 1) End Select End Sub |
XrayTool |
_Utilities |
getColorName |
Basic |
colorComments (Procedure) |
15 |
Function getColorName(color As Long) As String Dim ct As Object, colNames As Variant Dim x As Long, colx As Long, t As String
t = "" ct = CreateUnoService("com.sun.star.drawing.ColorTable") colNames = ct.ElementNames for x = 0 to UBound(colNames) colx = ct.getByName(colNames(x)) if colx = color then t = t & " / " & colNames(x) end if next getColorName = Mid(t, 4) End Function |
XrayTool |
_Utilities |
getInfo |
Basic |
|
13 |
Function getInfo(bigText As String, startMk As String, endMk As String) As String Dim x1 As Integer, x2 As Integer
getInfo = "" x1 = InStr(1, bigText, startMk, 0) if x1 = 0 then exit function x1 = x1 +Len(startMk) x2 = InStr(x1, bigText, endMk, 0) if x2 = 0 then exit function getInfo = MidP1P2(bigText, x1, x2 -1) End Function |
XrayTool |
_Utilities |
getLastWordOfString |
Basic |
BrowseSDK2 (Procedure) simplifiedMethodString (Procedure) XrayDeeper2 (Procedure) |
6 |
Function getLastWordOfString(currentLine As String) As String Dim v As Variant
v = split(Trim(currentLine), " ") getLastWordOfString = v(UBound(v)) End Function |
XrayTool |
_Utilities |
isControlEnabled |
Basic |
BrowseSDK2 (Procedure) keyOnXrayInfo (Procedure) MouseReleaseOnDisplay (Procedure) keyOnDlgVal (Procedure) |
6 |
Function isControlEnabled(dlg As Object, controlName As String) As Boolean Dim k As Object
k = dlg.getControl(controlName) isControlEnabled = k.isEnabled() End Function |
XrayTool |
_Utilities |
MidP1P2 |
Basic |
getAPInameAfter (Procedure) getAPInameFrom (Procedure) getCurrentLineInInfos (Procedure) getPseudoPropInterface (Procedure) simplifiedArrayElementString (Procedure) XrayThisArrayElement (Procedure) findInText (Procedure) getInfo (Procedure) |
5 |
Function MidP1P2(fullString As String, p1 As Long, p2 As Long) As String if p2<p1 then Err = 14 MidP1P2 = Mid(fullString, p1, p2-p1+1) End Function |
XrayTool |
_Utilities |
replaceSpaces |
Basic |
properties2String (Procedure) |
3 |
Function replaceSpaces(s As String) As String replaceSpaces = join(split(s, " "), chr(160) ) End Function |
XrayTool |
_Utilities |
replaceTag |
Basic |
FindPropertyDoc (Procedure) IDLindexesLoadedFromWeb (Procedure) explainPseudoPropertyCaracteristics (Procedure) XrayThisProperty (Procedure) checkHugeArray (Procedure) |
11 |
Function replaceTag(aText As String, tag As String, ByVal replacement As String) As String Dim x As Long
x = InStr(1, aText, tag, 0) if x = 0 then replaceTag = aText else replaceTag = Left(aText, x-1) & replacement & Mid(aText, x +len(tag)) end if End Function |
XrayTool |
_Utilities |
restoreSpaces |
Basic |
BrowseSDK2 (Procedure) prettyDisplayPropMethod (Procedure) XrayDeeper2 (Procedure) |
3 |
Function restoreSpaces(s As String) As String restoreSpaces = join(split(s, chr(160)), " " ) End Function |
XrayTool |
_Utilities |
searchForAttribute |
Basic |
findInterfaceOfAttribute (Procedure) |
23 |
Sub searchForAttribute(attribName As String, intfName As String, methInterfaces As String, foundInterface As String) Dim intf As Object, allBaseInterfaces As Variant, attrib As Object Dim x As Long
if InStr(1, methInterfaces, LF & intfName & LF, 0) > 0 then Exit Sub methInterfaces = methInterfaces & intfName & LF intf = OOoReflection.forName(intfName) if intf.TypeClass = com.sun.star.uno.TypeClass.INTERFACE then attrib = intf.getField(attribName) if not IsNull(attrib) then foundInterface = intfName allBaseInterfaces = intf.getSuperClasses() for x = 0 to UBound(allBaseInterfaces) intfName = allBaseInterfaces(x).Name searchForAttribute(attribName, intfName, methInterfaces, foundInterface) next Exit Sub end if end if End Sub |
XrayTool |
_Utilities |
searchPropertyInService |
Basic |
findServiceOfRealProperty (Procedure) |
30 |
Sub searchPropertyInService(propName As String, servName As String, foundService As String) Dim servDescr As Object, allProps As Variant, allBaseServ As Variant Dim x As Long
if OOoTypeDescr.hasByHierarchicalName(servName) then servDescr = OOoTypeDescr.getByHierarchicalName(servName) allProps = servDescr.Properties for x = 0 to UBound(allProps) if allProps(x).Name = servName & "." & propName then foundService = servName Exit Sub end if next allBaseServ = servDescr.MandatoryServices for x = 0 to UBound(allBaseServ) searchPropertyInService(propName, allBaseServ(x).Name, foundService) if Len(foundService) > 0 then Exit Sub next allBaseServ = servDescr.OptionalServices for x = 0 to UBound(allBaseServ) searchPropertyInService(propName, allBaseServ(x).Name, foundService) if Len(foundService) > 0 then Exit Sub next end if End Sub |
XrayTool |
_Utilities |
ShellSort |
Basic |
structure2String (Procedure) properties2String (Procedure) methodsString (Procedure) listenersString (Procedure) servicesString (Procedure) interfacesString (Procedure) |
24 |
Sub ShellSort(myList()) Dim k1 As Integer, k2 As Integer, listSize As Integer Dim x1 As Integer, isSorted As Boolean Dim swapping listSize = UBound(myList()) +1 -LBound(myList()) k1 = Fix(listSize /2) do while k1 > 0 k2 = UBound(myList()) - k1 isSorted = true for x1 = LBound(myList()) to k2 if StrComp(myList(x1), myList(x1 +k1), 0) = 1 then swapping = myList(x1) myList(x1) = myList(x1 +k1) myList(x1 +k1) = swapping isSorted = false end if next if isSorted then k1 = Fix(k1 /2) end if loop End Sub |
XrayTool |
_Utilities |
spaceTo |
Basic |
TextOfElemX (Procedure) Value2Str (Procedure) propertiesPanelString (Procedure) structure2String (Procedure) properties2String (Procedure) methodsString (Procedure) listenersString (Procedure) methodsUsingAnyListener (Procedure) changeDisplay (Procedure) |
12 |
Sub spaceTo(thisString As String, tabPos As Long, minimalSpace As Long) Dim p As Long, sp As String
p = tabPos - Len(thisString) -1 if p >= minimalSpace then thisString = thisString + Space(p) else thisString = thisString + Space(minimalSpace) end if End Sub |
XrayTool |
_Utilities |
textFromUniqueStrings |
Basic |
listenersString (Procedure) |
11 |
Function textFromUniqueStrings(listOfStrings As Variant) As String Dim s As String, t As String, x As Long
s = LF for x = 0 to UBound(listOfStrings) t = listOfStrings(x) & LF if InStr(1, s, LF & t, 0) = 0 then s = s & t next textFromUniqueStrings = Mid(s, 2, Len(s) -2) End Function |
XrayTool |
Mod2 |
array2String |
Basic |
TextOfElemX (Procedure) Value2Str (Procedure) |
55 |
Function array2String(ObjX1 As Variant, abbreviated As Boolean) As String Dim s As String, header As String, margin As String, typ As String Dim n As Long, x1 As Long, x2 As Long, x3 As Long, x4 As Long, x5 As Long Const nbMaxIndexes = 5 Dim indexesMin(20) As Long, indexesMax(20) As Long if abbreviated then margin = "" else margin = Space(Spaces1stLine) typ = deleteTrail( LCase(TypeName(ObjX1)), "()" ) if UBound(ObjX1) >= LBound(ObjX1) then header = margin & txt0210 n = 0 On Error Goto maxDim Do n = n+1 indexesMin(n) = LBound(ObjX1, n) indexesMax(n) = UBound(ObjX1, n) header = header & indexesMin(n) & " To " & indexesMax(n) & ", " Loop maxDim: Resume label3 label3: On Error Goto 0 header = amputeRight(header, 2) header = header & " ) " & "As " & typ & " " array2String = header if abbreviated then Exit Function n = n-1 if n > nbMaxIndexes then array2String = header & LF & LF & margin & txt0213 Exit Function end if s = " " & emptyLine for x1 = indexesMin(1) to indexesMax(1) for x2 = indexesMin(2) to indexesMax(2) for x3 = indexesMin(3) to indexesMax(3) for x4 = indexesMin(4) to indexesMax(4) for x5 = indexesMin(5) to indexesMax(5) s = s & LF & arrayElement2String(ObjX1, n, Array(x1,x2,x3,x4,x5)) if Len(s) > 65000 then header = header & LF & LF & margin & txt0212 array2String = header & s Exit Function end if next next next next next array2String = header & s else array2String = margin & txt0201 & typ & " : " & emptyValStr end if End Function |
XrayTool |
Mod2 |
arrayElement2String |
Basic |
array2String (Procedure) |
10 |
Function arrayElement2String(v As Variant, n As Long, idxList As Variant) As String Dim x As Long, r As String
r = "(" for x = 1 to n r = r & idxList(x-1) & "," next r = amputeRight(r,1) & ")" arrayElement2String = TextOfElemX( getArrayElement(v, n, idxList), r) End Function |
XrayTool |
Mod2 |
exitPrettyDisplay |
Basic |
DlgVal|APIdocBtn4 (Control) DlgVal|APIdocBtn3 (Control) DlgVal|XrayBtn3 (Control) DlgVal|XrayBtn4 (Control) |
9 |
Sub exitPrettyDisplay(evt As Object) Dim k As Object, dlg As Object
k = evt.Source dlg = k.Context dlg.Model.Tag = k.Model.Tag dlg.endExecute End Sub |
XrayTool |
Mod2 |
fullyQualifiedName |
Basic |
TextOfElemX (Procedure) |
9 |
Function fullyQualifiedName(elem As Variant) As String Dim classeIDL As Object
fullyQualifiedName = txt0115 On Error Resume Next classeIDL = OOoReflection.getType(elem) fullyQualifiedName = classeIDL.Name On Error GoTo 0 End Function |
XrayTool |
Mod2 |
getArrayElement |
Basic |
arrayElement2String (Procedure) simplifiedArrayElementString (Procedure) XrayThisArrayElement (Procedure) |
14 |
Function getArrayElement(v As Variant, n As Long, idxList As Variant) As Variant Select Case n Case 1 getArrayElement = v(idxList(0)) Case 2 getArrayElement = v(idxList(0),idxList(1)) Case 3 getArrayElement = v(idxList(0),idxList(1),idxList(2)) Case 4 getArrayElement = v(idxList(0),idxList(1),idxList(2),idxList(3)) Case 5 getArrayElement = v(idxList(0),idxList(1),idxList(2),idxList(3),idxList(4)) End Select End Function |
XrayTool |
Mod2 |
getEnumStringValue |
Basic |
getShortStringFromValueOfProperty (Procedure) simplifiedStructureElementString (Procedure) simplifiedPropertyString (Procedure) |
21 |
Function getEnumStringValue(typeOfValue As Object, theValue As Variant, prefix As String) As String Dim rfl As Object, enufs As Variant, enux As Object Dim enumString As String, x As Long
getEnumStringValue = "" if IsEmpty(theValue) or IsNull(theValue) then Exit Function if showAll then if typeOfValue.TypeClass = com.sun.star.uno.TypeClass.ENUM then enumString = typeOfValue.Name rfl = OOoReflection.forName(enumString) enufs = rfl.Fields for x = 0 to UBound(enufs) enux = enufs(x) if theValue = enux.get(0) then getEnumStringValue = prefix & enumString & "." & enux.Name Exit Function end if next end if end if End Function |
XrayTool |
Mod2 |
getShortStringFromValueOfProperty |
Basic |
structure2String (Procedure) properties2String (Procedure) |
29 |
Sub getShortStringFromValueOfProperty(info2 As Object, v As Variant, vError As String, propValue As String, propComment As String) Dim e As String
if Len(vError) = 0 then propValue = Value2Str(v, showMinimal) e = getEnumStringValue(info2.Type, v, enumInfo) if Len(e) > 0 then propComment = propComment & e & ", " e = colorComments(info2.Name, v, showMinimal) if Len(e) > 0 then propComment = propComment & e & ", " elseif vError = "not readable" then propValue = "" elseif vError = "ambiguous" then propValue = "" elseif vError = txt0227 then propValue = emptyValStr elseif vError = txt0202 then propValue = nullValStr elseif vError = txt0209 then propValue = """""" elseif vError = txt0226 then propValue = emptyValStr elseif InStr(1, vError, txt0125, 0) = 1 then propValue = "" else propValue = "<error>" end if End Sub |
XrayTool |
Mod2 |
isWorthXray |
Basic |
Xray (Procedure) checkAndDisplayNewObject (Procedure) |
13 |
Function isWorthXray(Optional ObjX1 As Variant) As Boolean Dim errMess As String
errMess = preliminaryDataControl(ObjX1) if Len(errMess) = 0 then isWorthXray = True else MsgBox(errMess, 64, WindowTitle) isWorthXray = False end if End Function |
XrayTool |
Mod2 |
keyOnDlgVal |
Basic |
DlgVal|PropValue (Control) DlgVal|PropertyNotes (Control) DlgVal|MethodParams (Control) DlgVal|MethodNotes (Control) |
23 |
Sub keyOnDlgVal(evt As Object) Dim dlg As Object, keyed As Long
dlg = evt.Source.Context keyed = evt.KeyCode if evt.Modifiers = com.sun.star.awt.KeyModifier.MOD1 then keyed = -keyed Select Case keyed Case -com.sun.star.awt.Key.F1 if isControlEnabled(dlg, "APIdocBtn" & dlg.Model.Step) then dlg.Model.Tag = "API" dlg.endExecute end if Case -com.sun.star.awt.Key.F dlg = evt.Source.Context findInText(evt.Source) Case com.sun.star.awt.Key.F5 if isControlEnabled(dlg, "XrayBtn" & dlg.Model.Step) then dlg.Model.Tag = "Xray" dlg.endExecute end if End Select End Sub |
XrayTool |
Mod2 |
preliminaryDataControl |
Basic |
isWorthXray (Procedure) structure2String (Procedure) getValueOfProperty (Procedure) simplifiedStructureElementString (Procedure) |
21 |
Function preliminaryDataControl(Optional ObjX1 As Variant) As String Dim errMess As String
if isEmpty(ObjX1) then errMess = txt0227 elseif IsNull(ObjX1) then errMess = txt0202 elseif VarType(ObjX1) = 10 then errMess = txt0208 elseif VarType(ObjX1) = 8 then if Len(ObjX1) = 0 then errMess = txt0209 elseif VarType(ObjX1) = 37 then errMess = txt0207 & ObjX1 elseif IsArray(ObjX1) then if UBound(ObjX1) < 0 then errMess = txt0226 else errMess = "" end if preliminaryDataControl = errMess End Function |
XrayTool |
Mod2 |
prettyDisplayPropMethod |
Basic |
keyOnXrayInfo (Procedure) showPrettyDisplay (Procedure) |
81 |
Function prettyDisplayPropMethod(currentLine As String, firstWord As String) As String Dim ValDial As Object, k As Object, s As Variant
prettyDisplayPropMethod = ""
if XrayDisplayWhat = "properties" then if Left(firstWord, 1) = "(" then s = simplifiedArrayElementString(firstWord) ValDial = createDialogue("DlgVal", txt0261) ValDial.Model.Step = 3 setDisplayFont(ValDial, "PropValue") ValDial.getControl("ObjPath").Text = CurrentObjQualifiedName & firstWord ValDial.getControl("Indication1").Text = "" ValDial.getControl("Indication2").Text = "" ValDial.getControl("APIdocBtn3").Enable = False elseif classeIDL.TypeClass = com.sun.star.uno.TypeClass.STRUCT then s = simplifiedStructureElementString(firstWord) ValDial = createDialogue("DlgVal", txt0260) ValDial.Model.Step = 3 setDisplayFont(ValDial, "PropValue") ValDial.getControl("ObjPath").Text = CurrentObjQualifiedName & "." & s(F3name) ValDial.getControl("Indication1").Text = "" ValDial.getControl("Indication2").Text = "" if Len(s(F3Color)) > 0 then k = ValDial.getControl("ColorPatch") k.Model.BackGroundColor = CLng(s(F3Color)) end if else firstWord = restoreSpaces(firstWord) s = simplifiedPropertyString(firstWord) ValDial = createDialogue("DlgVal", txt0262) ValDial.Model.Step = 3 setDisplayFont(ValDial, "PropValue") if InStr(1, s(F3name), " ", 0) > 0 then ValDial.getControl("ObjPath").Text = CurrentObjQualifiedName & ".getPropertyValue(""" & s(F3name) & """)" else ValDial.getControl("ObjPath").Text = CurrentObjQualifiedName & "." & s(F3name) end if if Len(s(F3attribProp)) > 0 then ValDial.getControl("Indication1").Text = "" ValDial.getControl("Indication2").Text = "" ValDial.getControl("PropAttr").Text = s(F3attribProp) elseif Len(s(F3get)) > 0 then ValDial.getControl("Indication1").Text = s(F3get) ValDial.getControl("Indication2").Text = s(F3set) ValDial.getControl("PropAttr").Text = "" elseif Len(s(F3set)) > 0 then ValDial.getControl("Indication1").Text = s(F3set) ValDial.getControl("Indication2").Text = "" ValDial.getControl("PropAttr").Text = "" end if if Len(s(F3Color)) > 0 then k = ValDial.getControl("ColorPatch") k.Model.BackGroundColor = CLng(s(F3Color)) end if end if ValDial.getControl("PropValue").Text = s(F3value) ValDial.getControl("PropertyType").Text = txt0203 & s(F3type) ValDial.getControl("PropertyName").Text = s(F3name) ValDial.getControl("ImportantInfo").Text = s(F3important) ValDial.getControl("PropertyNotes").Text = s(F3notes) ValDial.getControl("XrayBtn3").Enable = (Len(s(F3canXray)) = 0) elseif XrayDisplayWhat = "methods" then s = simplifiedMethodString(firstWord, currentLine) ValDial = createDialogue("DlgVal", txt0263) ValDial.Model.Step = 4 setDisplayFont(ValDial, "MethodParams") ValDial.getControl("ObjPath").Text = CurrentObjQualifiedName & "." & s(F3name) ValDial.getControl("MethodName").Text = s(F3name) ValDial.getControl("MethodParams").Text = s(F3parameters) ValDial.getControl("ReturnedType").Text = s(F3type) ValDial.getControl("SupportingInterface").Text = s(F3Interface_Service) ValDial.getControl("MethodNotes").Text = s(F3Notes) ValDial.getControl("XrayBtn4").Enable = (Len(s(F3canXray)) = 0) end if
ValDial.Execute prettyDisplayPropMethod = ValDial.Model.Tag ValDial.Dispose End Function |
XrayTool |
Mod2 |
TextOfElemX |
Basic |
arrayElement2String (Procedure) |
41 |
Function TextOfElemX(Optional aVal As Variant, ByVal s As String) As String Dim elemName As String, elemValue As String, el2 as variant
spaceTo(s, Spaces1stLine +1, 1) s = s & ArrayIndexSeparator if IsArray(aVal) then TextOfElemX = s & array2String(aVal, True) elseif VarType(aVal) = 10 then TextOfElemX = s & errorValStr & " " elseif IsEmpty(aVal) then TextOfElemX = s & emptyValStr & " " elseif VarType(aVal) = 9 then if IsNull(aVal) then TextOfElemX = s & ArrayElementObj & nullValStr else elemName = "" elemValue = "" el2 = aVal On Error Resume Next elemName = " --> " & el2.Name if len(elemName) = 0 then elemName = " --> " & el2.HumanPresentableName elemValue = Value2Str(el2.Value, showMinimal) On Error GoTo 0 if Len(elemValue) > 0 then if Len(elemName)<32 then elemValue = Space(33 -Len(elemName)) & elemValue else elemValue = " " & elemValue end if end if if IsUnoStruct(aVal) then TextOfElemX = s & ArrayElementStruct & fullyQualifiedName(aVal) & elemName & elemValue & " " else TextOfElemX = s & ArrayElementObj & fullyQualifiedName(aVal) & elemName & elemValue & " " end if end if else TextOfElemX = s & LCase(TypeName(aVal)) & " : " & Value2Str(aVal, showHexaValue) end if End Function |
XrayTool |
Mod2 |
Value2Str |
Basic |
TextOfElemX (Procedure) getShortStringFromValueOfProperty (Procedure) propertiesPanelString (Procedure) simplifiedArrayElementString (Procedure) simplifiedStructureElementString (Procedure) simplifiedPropertyString (Procedure) |
57 |
Function Value2Str(Optional aVal As Variant, howToDisplay As Long) As String Dim result As String, VarType2HexaLength As Variant, x As Long
VarType2HexaLength = Array(0,0,4,8,0,0,0,0,0,0,0,0,0,0,0,0,0,2,4,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) result = "" if IsArray(aVal) then if UBound(aVal) < LBound(aVal) then result = emptyValStr elseif (howToDisplay and showFullString) <> 0 then result = array2String(aVal, False) end if else Select Case VarType(aVal) Case 0 result = emptyValStr Case 1 result = nullValStr Case 2,3,4,5,6,11,17,18,19,35,37 result = LTrim(Str(aVal)) x = VarType2HexaLength(VarType(aVal)) if (x > 0) and ((howToDisplay and showHexaValue) <> 0) then spaceTo(result, 12, 1) result = result & txt0204 & CHex(aVal, x) end if Case 8 if (howToDisplay and showFullString) <> 0 then result = aVal elseif (InStr(1, aVal, LF, 0) > 0) or (InStr(1, aVal, chr(13), 0) > 0) or (Len(aVal) > 200) then result = tooWideStr else result = """" & aVal & """" end if Case 9 if IsNull(aVal) then result = nullValStr else result = "" Case 10 result = errorValStr Case 16 result = """" & chr(aVal) & """" if (howToDisplay and showHexaValue) <> 0 then spaceTo(result, 12, 1) result = result & txt0204 & CHex(aVal, 4) end if Case else if IsEmpty(aVal) then result = emptyValStr elseif IsNull(aVal) then result = nullValStr else result = "Type=" & VarType(aVal) & ":" & LCase(TypeName(aVal)) end if End Select end if Value2Str = result End Function |
XrayTool |
Mod3 |
CallBrowser |
Basic |
BrowseSDK2 (Procedure) FindStructureDoc (Procedure) FindPropertyDoc (Procedure) displayAlternateDoc (Procedure) |
27 |
Sub CallBrowser(goal As String, ByVal webPage As String, Optional internalLink as String) Dim launchBr As Object, choiceBr As Long
if FileExists(webPage) then if not IsMissing(internalLink) then webPage = webPage & "#" & internalLink launchBr = CreateUnoService("com.sun.star.system.SystemShellExecute") choiceBr = CLng(BrowserAddress(0)) On Error GoTo browserKO if choiceBr < 10 then launchBr.execute(BrowserAddress(choiceBr), webPage, 0) else choiceBr = choiceBr -10 shell(convertToURL(BrowserAddress(choiceBr)), 4, webPage) end if On Error GoTo 0 else MsgBox(txt0105 & goal, 64, WindowTitle) end if Exit Sub
browserKO: Resume Label1 Label1: MsgBox(txt0312, 16, WindowTitle) On Error GoTo 0 End Sub |
XrayTool |
Mod3 |
changeDialogWidthHeight |
Basic |
DlgXray|ScrollBarH (Control) DlgXray|ScrollBarW (Control) |
12 |
Sub changeDialogWidthHeight(evt As Object) Dim k As Object
k = evt.Source if k.Model.Orientation = com.sun.star.awt.ScrollBarOrientation.HORIZONTAL then CurrentXrDialDelta.Width = k.Value else CurrentXrDialDelta.Height = k.Value end if resizeXrDial End Sub |
XrayTool |
Mod3 |
FocusOnInfoControl |
Basic |
BrowseSDK2 (Procedure) XrayDeeper2 (Procedure) changeDisplay (Procedure) |
6 |
Sub FocusOnInfoControl Dim kt As Object
kt = XrDial.getControl("TxtObjInfos") kt.setFocus End Sub |
XrayTool |
Mod3 |
getConfigDirAddress |
Basic |
SDKindexAddress (Procedure) IDLindexesLoadedFromWeb (Procedure) getConfigFileAddress (Procedure) |
9 |
Function getConfigDirAddress() As String Dim ps As Object, sfa As Object, d As String
ps = CreateUnoService("com.sun.star.util.PathSubstitution") sfa = CreateUnoService("com.sun.star.ucb.SimpleFileAccess") d = ps.substituteVariables("$(user)/XrayData/", True) if not sfa.exists(d) then sfa.createFolder(d) getConfigDirAddress = d End Function |
XrayTool |
Mod3 |
getConfigFileAddress |
Basic |
readXrayConfig (Procedure) writeXrayConfig (Procedure) |
3 |
Function getConfigFileAddress() As String getConfigFileAddress = getConfigDirAddress() & "XrayConfig.txt" End Function |
XrayTool |
Mod3 |
getCurrentLineInInfos |
Basic |
keyOnXrayInfo (Procedure) firstWordInCurrentLine (Procedure) |
32 |
Function getCurrentLineInInfos(selectLine As Boolean) As String Dim kt As Object, objInfos As String, sel As New com.sun.star.awt.Selection Dim y1 As Long, y2 As Long
kt = XrDial.getControl("TxtObjInfos") objInfos = kt.Text if Len(objInfos) = 0 then getCurrentLineInInfos = "" Exit Function end if sel = kt.Selection y1 = sel.Min Do while y1 > 0 if Mid(objInfos, y1, 1) = LF then Exit Do y1 = y1 -1 Loop y1 = y1 +1 y2 = InStr(y1 +1, objInfos, LF, 0) if y2 = 0 then y2 = Len(objInfos) else y2 = y2 -1 getCurrentLineInInfos = MidP1P2(objInfos, y1, y2) if selectLine then if ((sel.Min = y2) and (sel.Max = (y1 -1) )) or ((sel.Max = y2) and (sel.Min = (y1 -1) )) then sel.Min = y1 -1 sel.Max = y1 -1 else sel.Min = y2 sel.Max = y1 -1 end if kt.Selection = sel end if End Function |
XrayTool |
Mod3 |
getWorkFilePathName |
Basic |
displayAlternateDoc (Procedure) |
8 |
Function getWorkFilePathName() As String Dim ps As Object, result As String
ps = CreateUnoService("com.sun.star.util.PathSubstitution") result = ps.substituteVariables("$(temp)/XrayResults.html", True) if FileExists(result) then kill(result) getWorkFilePathName = result End Function |
XrayTool |
Mod3 |
IDLindexesLoadedFromWeb |
Basic |
SetWebAPIpath (Procedure) |
54 |
Function IDLindexesLoadedFromWeb(IDLindex1 As String) As String Dim onLineIDL As String, IDLindexCache As String, indexLetter As String, localIndex As String, errMess As String Dim n As Long Dim sfa As Object, ps As Object, k As Object, k1 As Object, k2 As Object Const indexAright = "index-files/index-1.html"
ps = CreateUnoService("com.sun.star.util.PathSubstitution") sfa = CreateUnoService("com.sun.star.ucb.SimpleFileAccess") k = XrInit.getControl("ProgressBar1") k1 = XrInit.getControl("WebAPIBtn") k2 = XrInit.getControl("SDKpath")
errMess = txt0311 if Right(IDLindex1, Len(indexAright)) = indexAright then onLineIDL = Left(IDLindex1, Len(IDLindex1) -Len("1.html") ) IDLindexCache = getConfigDirAddress() & "index-" k.Visible = True errMess = "Cancel" if MsgBox(txt0304 & LF & txt0305, 1+48+256, WindowTitle) = 1 then On Error GoTo badIDL for n = 1 to 27 indexLetter = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ_", n, 1) k2.Text = replaceTag(txt0308, "%%", "Global Index " & indexLetter) Wait 100 errMess = txt0309 & LF & onLineIDL & n & ".html" if not sfa.exists(onLineIDL & n & ".html") then Exit For localIndex = IDLindexCache & n & ".html" if sfa.exists(localIndex) then sfa.kill(localIndex) errMess = txt0313 & LF & onLineIDL & n & ".html" sfa.copy(onLineIDL & n & ".html", localIndex) errMess = txt0301 if k1.Model.State = 0 then Exit For k.Value = n errMess = "OK" next wait 200 end if end if Finish: k.Value = 0 k.Visible = False k2.Text = "" IDLindexesLoadedFromWeb = errMess Exit Function
badIDL: errMess = errMess & LF & LF & error Resume BadIDL2 BadIDL2: On Error GoTo 0 GoTo Finish End Function |
XrayTool |
Mod3 |
initConfigData |
Basic |
readXrayConfig (Procedure) |
19 |
Sub initConfigData() SDKdisplayAddr = "" UseLocalSDK = False BrowserAddress(1) = "C:\Program Files\Mozilla Firefox\firefox.exe" BrowserAddress(2) = "C:\Program Files\Opera\Opera.exe" BrowserAddress(3) = "C:\Program Files\Internet Explorer\iexplore.exe" BrowserAddress(0) = 1 AlternateBrowserCallMethod = False allowXrayDbleClick = True
startAllInfos = False startAZorder = False deltaHeightXrDial = 0 deltaWidthXrDial = 0
DisplayFontName = "Deja Vu Sans Mono" DisplayFontHeight = 9 DisplayFontWidth = 5 End Sub |
XrayTool |
Mod3 |
initDlgXray |
Basic |
prepareXray (Procedure) |
36 |
Sub initDlgXray Dim km As Object, k As Object Const steps = 50
searchTexts = "" readXrayConfig XrDial = createDialogue("DlgXray", "") DefaultXrDialSize = XrDial.OutputSize k = XrDial.getControl("HeaderLabel") DefaultXrDialHeaderSize = k.OutputSize k = XrDial.getControl("TxtObjInfos") DefaultXrDialInfosSize = k.OutputSize km = XrDial.getControl("ScrollBarH").Model km.ScrollValueMax = 2 *DefaultXrDialSize.Height km.LineIncrement = km.ScrollValueMax / steps km.BlockIncrement = km.ScrollValueMax / steps km.ScrollValue = deltaHeightXrDial CurrentXrDialDelta.Height = deltaHeightXrDial km = XrDial.getControl("ScrollBarW").Model km.ScrollValueMax = 2 * DefaultXrDialSize.Width km.LineIncrement = km.ScrollValueMax / steps km.BlockIncrement = km.ScrollValueMax / steps km.ScrollValue = deltaWidthXrDial CurrentXrDialDelta.Width = deltaWidthXrDial resizeXrDial CenterDialog(XrDial) setDisplayFont(XrDial, "HeaderLabel") setDisplayFont(XrDial, "TxtObjInfos") km = XrDial.getControl("AZflag").Model if startAZorder then km.State = 1 km = XrDial.getControl("showAllFlag").Model if startAllInfos then km.State = 1 End Sub |
XrayTool |
Mod3 |
keyOnXrayInfo |
Basic |
DlgXray|TxtObjInfos (Control) |
29 |
Sub keyOnXrayInfo(evt As Object) Dim keyed As Long, currentLine As String, firstWord As String
firstWordInCurrentLine(currentLine, firstWord) if Len(firstWord) = 0 then Exit Sub
keyed = evt.KeyCode if evt.Modifiers = com.sun.star.awt.KeyModifier.MOD1 then keyed = -keyed Select Case keyed Case -com.sun.star.awt.Key.F1 BrowseSDK2(currentLine, firstWord) Case -com.sun.star.awt.Key.F findInText(evt.Source) Case com.sun.star.awt.Key.F5 if isControlEnabled(XrDial, "DeeperBtn") then XrayDeeper2(currentLine, firstWord) Case com.sun.star.awt.Key.F2 getCurrentLineInInfos(True) Case com.sun.star.awt.Key.F4 if (XrayDisplayWhat = "properties") or (XrayDisplayWhat = "methods") then Select Case prettyDisplayPropMethod(currentLine, firstWord) Case "Xray" XrayDeeper2(currentLine, firstWord) Case "API" BrowseSDK2(currentLine, firstWord) End Select end if End Select End Sub |
XrayTool |
Mod3 |
MouseReleaseOnDisplay |
Basic |
DlgXray|TxtObjInfos (Control) |
13 |
Sub MouseReleaseOnDisplay(evt As Object) Dim currentLine As String, firstWord As String
if evt.ClickCount > 1 then if evt.Buttons and com.sun.star.awt.MouseButton.LEFT then if allowXrayDbleClick and isControlEnabled(XrDial, "DeeperBtn") then firstWordInCurrentLine(currentLine, firstWord) if Len(firstWord) > 0 then XrayDeeper2(currentLine, firstWord) end if end if end if End Sub |
XrayTool |
Mod3 |
nextStepDlgInit |
Basic |
DlgInit|NextBtn (Control) DlgInit|PrevBtn (Control) |
8 |
Sub nextStepDlgInit(evt As Object) Dim k As Object
XrInit.Model.Step = XrInit.Model.Step +CLng(evt.Source.Model.Tag) k = XrInit.getControl("OKBtn") k.Enable = (XrInit.Model.Step = 2) End Sub |
XrayTool |
Mod3 |
readXrayConfig |
Basic |
initDlgXray (Procedure) |
58 |
Sub readXrayConfig() Dim iniFile As Object, sfa As Object, flux As Object Dim oneLine As String, configFileURL As String Dim x As Long, paramName As String, paramValue As String
initConfigData sfa = CreateUnoService("com.sun.star.ucb.SimpleFileAccess") configFileURL = getConfigFileAddress if not sfa.exists(configFileURL) then Exit Sub iniFile = CreateUnoService("com.sun.star.io.TextInputStream") flux = sfa.openFileRead(configFileURL) iniFile.InputStream = flux iniFile.Encoding = "utf8" Do while not iniFile.isEOF oneLine = Trim(iniFile.readLine) if (Left(oneLine, 1) <> "#") and (Len(oneLine) > 0) then x = InStr(2, oneLine, "=", 0) if x > 0 then paramName = Trim( Left(oneLine, x-1) ) paramValue = Trim( Mid(oneLine, x+1) ) Select Case paramName Case "allowXrayDbleClick" allowXrayDbleClick = paramValue Case "SDKdisplayAddr" SDKdisplayAddr = paramValue Case "UseLocalSDK" UseLocalSDK = paramValue Case "BrowserAddress1" BrowserAddress(1) = paramValue Case "BrowserAddress2" BrowserAddress(2) = paramValue Case "BrowserAddress3" BrowserAddress(3) = paramValue Case "BrowserChoice" BrowserAddress(0) = paramValue Case "AlternateBrowserCallMethod" AlternateBrowserCallMethod = paramValue Case "startAllInfos" startAllInfos = paramValue Case "startAZorder" startAZorder = paramValue Case "deltaHeightXrDial" deltaHeightXrDial = paramValue Case "deltaWidthXrDial" deltaWidthXrDial = paramValue Case "DisplayFontName" DisplayFontName = paramValue Case "DisplayFontHeight" DisplayFontHeight = paramValue Case "DisplayFontWidth" DisplayFontWidth = paramValue End Select end if end if Loop flux.closeInput iniFile.closeInput End Sub |
XrayTool |
Mod3 |
resizeXrDial |
Basic |
initDlgXray (Procedure) changeDialogWidthHeight (Procedure) |
18 |
Sub resizeXrDial() Dim k1 As Object, k2 As Object, sz As Object, sz1 As Object, sz2 As Object
sz = DefaultXrDialSize sz.Width = sz.Width +CurrentXrDialDelta.Width sz.Height = sz.Height +CurrentXrDialDelta.Height k1 = XrDial.getControl("HeaderLabel") sz1 = DefaultXrDialHeaderSize sz1.Width = sz1.Width +CurrentXrDialDelta.Width k2 = XrDial.getControl("TxtObjInfos") sz2 = DefaultXrDialInfosSize sz2.Width = sz2.Width +CurrentXrDialDelta.Width sz2.Height = sz2.Height +CurrentXrDialDelta.Height XrDial.OutputSize = sz k1.OutputSize = sz1 k2.OutputSize = sz2 End Sub |
XrayTool |
Mod3 |
SDKindexAddress |
Basic |
LoadSDKglobalIndex (Procedure) |
13 |
Function SDKindexAddress() As String
if Len(SDKdisplayAddr) > 0 then if UseLocalSDK then SDKindexAddress = ConvertToURL(SDKdisplayAddr) & "docs/common/ref/index-files/index-" else SDKindexAddress = getConfigDirAddress() & "/index-" end if else SDKindexAddress = "" end if End Function |
XrayTool |
Mod3 |
SDKpagesAddress |
Basic |
BrowseSDK2 (Procedure) FindStructureDoc (Procedure) FindPropertyDoc (Procedure) displayAlternateDoc (Procedure) |
12 |
Function SDKpagesAddress() As String if Len(SDKdisplayAddr) > 0 then if UseLocalSDK then SDKpagesAddress = ConvertToURL(SDKdisplayAddr) & "docs/common/ref/" else SDKpagesAddress = Left(SDKdisplayAddr, Len(SDKdisplayAddr) -Len("index-files/index-1.html") ) end if else SDKpagesAddress = "" end if End Function |
XrayTool |
Mod3 |
setDisplayFont |
Basic |
initDlgXray (Procedure) XrayConfigDialog (Procedure) prettyDisplayPropMethod (Procedure) |
10 |
Sub setDisplayFont(dlg As Object, controlName As String) Dim km As Object, fd As Object
km = dlg.getControl(controlName).Model fd = km.FontDescriptor fd.Name = DisplayFontName fd.Height = DisplayFontHeight fd.Width = DisplayFontWidth km.FontDescriptor = fd End Sub |
XrayTool |
Mod3 |
setFontSizeWidthDefault |
Basic |
DlgInit|SizeWidthDefaultBtn (Control) |
9 |
Sub setFontSizeWidthDefault() Dim k As Object
k = XrInit.getControl("DisplayFontHeight") k.Value = 9 k = XrInit.getControl("DisplayFontWidth") k.Value = 5 End Sub |
XrayTool |
Mod3 |
SetSDKpath |
Basic |
DlgInit|SDKlocalBtn (Control) |
21 |
Sub SetSDKpath Dim k As Object, fp As Object, SDKaddr As String
fp = CreateUnoService("com.sun.star.ui.dialogs.FolderPicker") if fp.execute = com.sun.star.ui.dialogs.ExecutableDialogResults.OK then SDKaddr = fp.Directory if FileExists(SDKaddr & "/docs/common/ref/com/sun/star/module-ix.html") _ and FileExists(SDKaddr & "/docs/common/ref/index-files/index-1.html") then k = XrInit.getControl("SDKpath") k.Text = convertFromURL(SDKaddr & "/") k = XrInit.getControl("LabelSDKtype") k.Text = txt0302 MsgBox(txt0314 & LF & txt0306, 64, WindowTitle) else MsgBox(txt0311, 16, WindowTitle) end if end if End Sub |
XrayTool |
Mod3 |
SetWebAPIpath |
Basic |
DlgInit|WebAPIBtn (Control) |
24 |
Sub SetWebAPIpath(evt As Object) Dim k As Object, k1 As Object, SDKaddr As String, r As String
k1 = evt.Source if k1.Model.State = 0 then Exit Sub if UseLocalSDK then SDKaddr = "" else SDKaddr = SDKdisplayAddr SDKaddr = InputBox(txt0307, WindowTitle, SDKaddr) if Len(SDKaddr) > 0 then r = IDLindexesLoadedFromWeb(SDKaddr) if r = "OK" then k = XrInit.getControl("SDKpath") k.Text = SDKaddr k = XrInit.getControl("LabelSDKtype") k.Text = txt0303 MsgBox(txt0314 & LF & txt0306, 64, WindowTitle) elseif r = "Cancel" then else MsgBox(r, 16, WindowTitle) end if end if k1.Model.State = 0 End Sub |
XrayTool |
Mod3 |
showPrettyDisplay |
Basic |
DlgXray|PrettyDisplayBtn (Control) |
14 |
Sub showPrettyDisplay(evt As Object) Dim currentLine As String, firstWord As String
firstWordInCurrentLine(currentLine, firstWord) if Len(firstWord) = 0 then Exit Sub
Select Case prettyDisplayPropMethod(currentLine, firstWord) Case "Xray" XrayDeeper2(currentLine, firstWord) Case "API" BrowseSDK2(currentLine, firstWord) End Select End Sub |
XrayTool |
Mod3 |
testFontForDisplay |
Basic |
DlgInit|DisplayFontBtn (Control) |
15 |
Sub testFontForDisplay() Dim kfH As Object, kfW As Object, kfN As Object, kfExample As Object, fd As Object
kfH = XrInit.getControl("DisplayFontHeight") kfW = XrInit.getControl("DisplayFontWidth") kfN = XrInit.getControl("DisplayFontName") kfExample = XrInit.getControl("DisplayFontExample").Model fd = kfExample.FontDescriptor if Len(kfN.Text) = 0 then kfN.Text = "DejaVu Sans Mono" fd.Name = kfN.Text fd.Height = kfH.Value fd.Width = kfW.Value kfExample.FontDescriptor = fd End Sub |
XrayTool |
Mod3 |
writeXrayConfig |
Basic |
XrayConfigDialog (Procedure) |
35 |
Sub writeXrayConfig() Dim iniFile As Object, sfa As Object, flux As Object Dim oneLine As String, configFileURL As String Dim x As Long, paramName As String, paramValue As String
sfa = CreateUnoService("com.sun.star.ucb.SimpleFileAccess") iniFile = CreateUnoService("com.sun.star.io.TextOutputStream") configFileURL = getConfigFileAddress if sfa.exists(configFileURL) then sfa.kill(configFileURL)
flux = sfa.openFileWrite(configFileURL) iniFile.OutputStream = flux iniFile.Encoding = "utf8" iniFile.writeString("# Configuration data for Xray, do not modify !" & LF) iniFile.writeString("# Données de configuration pour Xray, ne pas modifier !" & LF) iniFile.writeString(LF) iniFile.writeString("SDKdisplayAddr = " & SDKdisplayAddr & LF) iniFile.writeString("UseLocalSDK = " & UseLocalSDK & LF) iniFile.writeString("BrowserAddress1 = " & BrowserAddress(1) & LF) iniFile.writeString("BrowserAddress2 = " & BrowserAddress(2) & LF) iniFile.writeString("BrowserAddress3 = " & BrowserAddress(3) & LF) iniFile.writeString("BrowserChoice = " & BrowserAddress(0) & LF) iniFile.writeString("AlternateBrowserCallMethod = " & AlternateBrowserCallMethod & LF) iniFile.writeString("allowXrayDbleClick = " & allowXrayDbleClick & LF) iniFile.writeString("startAllInfos = " & startAllInfos & LF) iniFile.writeString("startAZorder = " & startAZorder & LF) iniFile.writeString("deltaHeightXrDial = " & deltaHeightXrDial & LF) iniFile.writeString("deltaWidthXrDial = " & deltaWidthXrDial & LF) iniFile.writeString("DisplayFontName = " & DisplayFontName & LF) iniFile.writeString("DisplayFontHeight = " & DisplayFontHeight & LF) iniFile.writeString("DisplayFontWidth = " & DisplayFontWidth & LF) iniFile.writeString(LF) flux.closeOutput iniFile.closeOutput End Sub |
XrayTool |
Mod3 |
XrayBack |
Basic |
DlgXray|ListObj (Control) foundInXrayList (Procedure) |
10 |
Sub XrayBack Dim kt As Object, qp As String
kt = XrDial.getControl("ListObj") if kt.Model.Tag <> "allow" then exit sub qp = kt.selectedItem if qp = CurrentObjQualifiedName then exit sub initXrayDisplay(XrObject(kt.selectedItemPos), qp, false) End Sub |
XrayTool |
Mod3 |
XrayConfigDialog |
Basic |
DlgXray|ConfigBtn (Control) |
70 |
Sub XrayConfigDialog Dim kt1 As Object, x As Long Dim kAll As Object, kAZ As Object, kShell As Object Dim kfN As Object, kfH As Object, kfW As Object, k2Click As Object
XrInit = createDialogue("DlgInit", txt0264) XrInit.Model.Step = 1 kt1 = XrInit.getControl("ProgressBar1") kt1.Visible = False kt1 = XrInit.getControl("SDKpath") kt1.Text = SDKdisplayAddr kt1 = XrInit.getControl("LabelSDKtype") if Len(SDKdisplayAddr) > 0 then if UseLocalSDK then kt1.Text = txt0302 else kt1.Text = txt0303 end if kt1 = XrInit.getControl("Browser" & Right(BrowserAddress(0), 1)) kt1.Model.State = 1 For x = 1 to 3 kt1 = XrInit.getControl("FileControl" & x) kt1.Text = BrowserAddress(x) next kShell = XrInit.getControl("ShellMethod") if AlternateBrowserCallMethod then kShell.Model.State = 1 k2Click = XrInit.getControl("DblClickFlag") if allowXrayDbleClick then k2Click.Model.State = 1 kt1 = XrDial.getControl("showAllFlag") kAll = XrInit.getControl("initAllInfosFlag") kAll.Model.State = kt1.Model.State kt1 = XrDial.getControl("AZflag") kAZ = XrInit.getControl("initAZflag") kAZ.Model.State = kt1.Model.State kfH = XrInit.getControl("DisplayFontHeight") kfH.Value = DisplayFontHeight kfW = XrInit.getControl("DisplayFontWidth") kfW.Value = DisplayFontWidth kfN = XrInit.getControl("DisplayFontName") kfN.Text = DisplayFontName setDisplayFont(XrInit, "DisplayFontExample")
if XrInit.Execute = com.sun.star.ui.dialogs.ExecutableDialogResults.OK then kt1 = XrInit.getControl("LabelSDKtype") UseLocalSDK = (kt1.Text = txt0302) kt1 = XrInit.getControl("SDKpath") SDKdisplayAddr = kt1.Text For x = 1 to 3 kt1 = XrInit.getControl("FileControl" & x) BrowserAddress(x) = kt1.Text kt1 = XrInit.getControl("Browser" & x) if kt1.State then BrowserAddress(0) = x next AlternateBrowserCallMethod = (kShell.State = 1) allowXrayDbleClick = (k2Click.State = 1) startAllInfos = (kAll.State = 1) startAZorder = (kAZ.State = 1) kt1 = XrInit.getControl("setDialogWidthFlag") if kt1.State = 1 then deltaHeightXrDial = CurrentXrDialDelta.Height deltaWidthXrDial = CurrentXrDialDelta.Width end if DisplayFontName = kfN.Text DisplayFontHeight = kfH.Value DisplayFontWidth = kfW.Value setDisplayFont(XrDial, "TxtObjInfos") writeXrayConfig end if XrInit.Dispose End Sub |
XrayTool |
Mod3 |
XrayDaddyObject |
Basic |
DlgXray|daddyObjBtn (Control) |
22 |
Sub XrayDaddyObject Dim kt As Object, s As String, c As String Dim allItems As String
kt = XrDial.getControl("ListObj") s = kt.selectedItem allItems = LF & join(kt.Items, LF) & LF Do c = Right(s,1) s = amputeRight(s, 1) if (c = ".") or (c = "(") then if InStr(1, allitems, LF & s & LF, 0) > 0 then Exit Do end if Loop Until Len(s) = 0 if Len(s) = 0 then kt.selectItemPos(0, True) else kt.selectItem(s, True) end if End Sub |
XrayTool |
Mod3 |
XrayDeeper |
Basic |
DlgXray|DeeperBtn (Control) |
7 |
Sub XrayDeeper(evt As Object) Dim currentLine As String, firstWord As String
firstWordInCurrentLine(currentLine, firstWord) if Len(firstWord) > 0 then XrayDeeper2(currentLine, firstWord) End Sub |
XrayTool |
Mod3 |
XrayOriginalObject |
Basic |
DlgXray|originObjBtn (Control) |
7 |
Sub XrayOriginalObject Dim kt As Object
kt = XrDial.getControl("ListObj") kt.selectItemPos(0, True) End Sub |
XrayTool |
Mod4 |
BrowseSDK |
Basic |
DlgXray|SDKBtn (Control) |
7 |
Sub BrowseSDK(evt As Object) Dim currentLine As String, firstWord As String
firstWordInCurrentLine(currentLine, firstWord) if Len(firstWord) > 0 then BrowseSDK2(currentLine, firstWord) End Sub |
XrayTool |
Mod4 |
BrowseSDK2 |
Basic |
BrowseSDK (Procedure) keyOnXrayInfo (Procedure) showPrettyDisplay (Procedure) |
39 |
Sub BrowseSDK2(currentLine As String, ByVal firstWord As String) Dim webPage As String, interfName As String, s As String
if isControlEnabled(XrDial, "SDKBtn") then if SDKpagesAddress = "" then MsgBox(txt0131, 64, WindowTitle) else if Left(firstWord, 1) = "(" then s = getAPInameAfter(currentLine, ArrayIndexSeparator & ArrayElementStruct) if Len(s) = 0 then s = getAPInameAfter(currentLine, ArrayIndexSeparator & ArrayElementObj) if Len(s) > 0 then webPage = SDKpagesAddress & join(split(s, "."), "/") & ".html" CallBrowser(firstWord, webPage) end if elseif XrayDisplayWhat = "properties" then if classeIDL.TypeClass = com.sun.star.uno.TypeClass.STRUCT then FindStructureDoc(firstWord) else FindPropertyDoc(currentLine, restoreSpaces(firstWord) ) end if elseif XrayDisplayWhat = "methods" then interfName = getLastWordOfString(currentLine) webPage = SDKpagesAddress & join(split(interfName, "."), "/") & ".html" CallBrowser(firstWord, webPage, firstWord) elseif XrayDisplayWhat = "listeners" then interfName = getLastWordOfString(currentLine) webPage = SDKpagesAddress & join(split(interfName, "."), "/") & ".html" CallBrowser(firstWord, webPage, deleteTrail(firstWord, "()") ) else webPage = SDKpagesAddress & join(split(firstWord, "."), "/") & ".html" CallBrowser(firstWord, webPage) end if end if end if FocusOnInfoControl End Sub |
XrayTool |
Mod4 |
displayAlternateDoc |
Basic |
SearchSDKpage (Procedure) |
24 |
Sub displayAlternateDoc(propName As String, searchWhat As String, bkmkLines As String) Dim myPage As String, workFileName As String Dim f1 As Integer Const myPage1 = "<html> <head> <title>Xray results</title> <base href=""" Const myPage2 = """> </head> <body> " Const myPage3 = " <dl> " Const myPage4 = "</dl> </body> </html>" Const htmlP = " <p>"
myPage = myPage1 & SDKpagesAddress & "index-files/" & myPage2 Select Case searchWhat Case "property" myPage = myPage & txt0355 & htmlP Case "attribute" myPage = myPage & txt0345 & htmlP End Select myPage = myPage & txt0360 & htmlP & myPage3 & LF & bkmkLines & LF & myPage4 & LF workFileName = getWorkFilePathName() f1 = FreeFile Open workFileName for Output As f1 print #f1, myPage Close #f1 CallBrowser(propName, workFileName) End Sub |
XrayTool |
Mod4 |
findPropertyBookmarks |
Basic |
SearchSDKpage (Procedure) isAlternateDoc (Procedure) |
22 |
Sub findPropertyBookmarks(propName As String, searchWhat As String, bkmkLines As String) Dim oneLine As String, htmlName As String
Select Case searchWhat Case "property" htmlName = "" & propName & " - property" Case "attribute" htmlName = "" & propName & " - attribute" End Select bkmkLines = "" Do while not eof(SDKdev) Line Input #SDKdev, oneLine if InStr(1, oneLine, htmlName, 0) > 0 then bkmkLines = bkmkLines & LF & oneLine end if Loop Close #SDKdev End Sub |
XrayTool |
Mod4 |
FindPropertyDoc |
Basic |
BrowseSDK2 (Procedure) |
45 |
Sub FindPropertyDoc(currentLine As String, propName As String) Dim docAddr1 As String, docAddr2 As String, interfName As String, t As String, servName As String Dim info2 As Object, propKind As Long
info2 = introCurrObj.getProperty(propName, com.sun.star.beans.PropertyConcept.ALL) propKind = getPropertyCategory(propName, info2.Attributes) if (propKind and &H00000200) <> 0 then interfName = findInterfaceOfAttribute(propName) if Len(interfName) > 0 then docAddr1 = SDKpagesAddress & join(split(interfName, "."), "/") & ".html" CallBrowser(propName, docAddr1, propName) else SearchSDKpage(propName, "attribute") end if elseif (propKind and &H00000400) <> 0 then if ((propKind H00010000000) and com.sun.star.beans.PropertyAttribute.REMOVEABLE) <> 0 then MsgBox(txt0356, 64, WindowTitle) else servName = findServiceOfRealProperty(propName) if Len(servName) > 0 then docAddr1 = SDKpagesAddress & join(split(servName, "."), "/") & ".html" CallBrowser(propName, docAddr1, propName) else SearchSDKpage(propName, "property") end if end if else t = "" if (propKind and &H00000102) = &H00000102 then t = LF & replaceTag(txt0243, "getXxx", "get" & propName & "( ) ") if (propKind and &H00000108) = &H00000108 then t = LF & replaceTag(txt0244, "getXxx", "set" & propName & "( ) ") t = Mid(t, 2) if Len(t) > 0 then MsgBox(t, 64, WindowTitle) docAddr1 = "" if (propKind and &H00000003) = &H00000001 then interfName = getPseudoPropInterface("get", propName) docAddr1 = SDKpagesAddress & join(split(interfName, "."), "/") & ".html" CallBrowser("get" & propName, docAddr1, "get" & propName) end if if (propKind and &H0000000C) = &H00000004 then interfName = getPseudoPropInterface("set", propName) docAddr2 = SDKpagesAddress & join(split(interfName, "."), "/") & ".html" if docAddr2 <> docAddr1 then CallBrowser("set" & propName, docAddr2, "set" & propName) end if end if End Sub |
XrayTool |
Mod4 |
FindStructureDoc |
Basic |
BrowseSDK2 (Procedure) |
8 |
Sub FindStructureDoc(structName As String) Dim objInternalName As String, pageAddr As String
objInternalName = classeIDL.Name pageAddr = SDKpagesAddress & join(split(objInternalName, "."), "/") & ".html"
CallBrowser(structName, pageAddr, structName) End Sub |
XrayTool |
Mod4 |
getAPInameAfter |
Basic |
BrowseSDK2 (Procedure) |
11 |
Function getAPInameAfter(currentLine As String, marker As String) As String Dim p1 As Long, p2 As Long
p1 = InStr(1, currentLine, marker, 0) if p1 = 0 then getAPInameAfter = "" else p2 = InStr(p1 +Len(marker), currentLine, " ", 0) getAPInameAfter = MidP1P2(currentLine, p1 +Len(marker), p2 -1) end if End Function |
XrayTool |
Mod4 |
getAPInameFrom |
Basic |
|
15 |
Function getAPInameFrom(SDKindexLine As String) As String Dim APIname As String, x1 As Long, x2 As Long Const css = "com/sun/star/"
getAPInameFrom = "" x1 = Instr(1, SDKindexLine, css, 0) if x1 > 0 then x2 = Instr(x1 +Len(css), SDKindexLine, ".html", 0) if x2 > 0 then APIname = MidP1P2(SDKindexLine, x1, x2 -1) APIname = join(split(APIname, "/"), ".") getAPInameFrom = APIname end if end if End Function |
XrayTool |
Mod4 |
isAlternateDoc |
Basic |
explainRealProperty (Procedure) explainAttribute (Procedure) |
15 |
Function isAlternateDoc(propName As String, searchWhat As String) As String Dim bkmkLines As String, result As String
if LoadSDKglobalIndex(propName, searchWhat) then findPropertyBookmarks(propName, searchWhat, bkmkLines) if Len(bkmkLines) > 0 then result = "found" else result = "not found" end if else result = "problem" end if isAlternateDoc = result End Function |
XrayTool |
Mod4 |
LoadSDKglobalIndex |
Basic |
SearchSDKpage (Procedure) isAlternateDoc (Procedure) |
18 |
Function LoadSDKglobalIndex(searchName As String) As Boolean Dim DocAddr As String, alpha As Integer, result As Boolean
result = False alpha = ASC(LCase(searchName)) -ASC("a") +1 if alpha = -1 then alpha = 27 if (alpha >= 1) and (alpha <= 27) then DocAddr = SDKindexAddress & CStr(alpha) & ".html" if FileExists(DocAddr) then SDKdev = Freefile Open DocAddr For Input As SDKdev result = true end if end if LoadSDKglobalIndex = result End Function |
XrayTool |
Mod4 |
SearchSDKpage |
Basic |
FindPropertyDoc (Procedure) |
15 |
Sub SearchSDKpage(propName As String, searchWhat As String) Dim bkmkLines As String
if LoadSDKglobalIndex(propName, searchWhat) then findPropertyBookmarks(propName, searchWhat, bkmkLines) if Len(bkmkLines) > 0 then displayAlternateDoc(propName, searchWhat, bkmkLines) else MsgBox(txt0105 & propName, 64, WindowTitle) end if else MsgBox(txt0131, 16, WindowTitle) end if End Sub |
XrayTool |
Xutils |
HelperButton |
Basic |
DlgXutils|StarDesktopBtn (Control) DlgXutils|ProcessMngrBtn (Control) DlgXutils|ThisComponentBtn (Control) DlgXutils|FirstSelectionBtn (Control) DlgXutils|ThisControllerBtn (Control) DlgXutils|CurrentCompBtn (Control) DlgXutils|ThisSheetBtn (Control) DlgXutils|ThisSlideBtn (Control) |
6 |
Sub HelperButton(evt As Object) Dim dlg As Object dlg = evt.Source.Context dlg.Model.Tag = evt.Source.Model.Name dlg.endExecute End Sub |
XrayTool |
Xutils |
System_URL_conversion |
Basic |
DlgXutils|CommandButton6 (Control) DlgXutils|CommandButton5 (Control) |
12 |
Sub System_URL_conversion(evt As Object) Dim dlg As Object, k As Object
dlg = evt.Source.Context k = dlg.getControl("FileAddress") if evt.Source.Model.Tag = "toURL" then k.Text = convertToURL(k.Text) else k.Text = convertFromURL(k.Text) end if wait 1000 End Sub |
XrayTool |
Xutils |
XrayMenu |
Basic |
|
58 |
Sub XrayMenu Dim oLib As Object, dlg As Object, tc As Object, cc As Object, whichBtn As String, ss As Boolean
GlobalScope.DialogLibraries.LoadLibrary(Libname) oLib = GlobalScope.DialogLibraries.getByName(Libname) dlg = CreateUnoDialog(oLib.getByName("DlgXutils")) On Error Resume Next tc = ThisComponent On Error GoTo 0 if isNull(tc) then enableControls(dlg, Array("ThisSheetBtn", "ThisSlideBtn", "ThisComponentBtn", "FirstSelectionBtn", "ThisControllerBtn"), False) else On Error Resume Next cc = tc.CurrentController On Error GoTo 0 if isNull(cc) then enableControls(dlg, Array("ThisSheetBtn", "ThisSlideBtn", "ThisControllerBtn", "FirstSelectionBtn"), False) else ss = True On Error Resume Next ss = cc.supportsService("not a service!") On Error GoTo 0 if ss then enableControls(dlg, Array("ThisSheetBtn", "ThisSlideBtn"), False) elseif cc.supportsService("com.sun.star.sheet.SpreadsheetView") then enableControls(dlg, Array("ThisSlideBtn"), False) elseif cc.supportsService("com.sun.star.drawing.DrawingDocumentDrawView") then enableControls(dlg, Array("ThisSheetBtn"), False) else enableControls(dlg, Array("ThisSheetBtn", "ThisSlideBtn"), False) end if end if end if
dlg.execute whichBtn = dlg.Model.Tag dlg.dispose
Select Case whichBtn Case "ThisComponentBtn" Xray tc Case "ThisControllerBtn" Xray cc Case "CurrentCompBtn" Xray StarDesktop.CurrentComponent Case "ProcessMngrBtn" Xray GetProcessServiceManager Case "StarDesktopBtn" Xray StarDesktop Case "ThisSheetBtn" Xray cc.ActiveSheet Case "ThisSlideBtn" Xray cc.CurrentPage Case "FirstSelectionBtn" Xray tc.CurrentSelection(0) End Select
End Sub |
Standard |
Module1 |
DBOpen |
Basic |
XRay.odb (Database) |
7 |
Sub DBOpen(Optional poEvent As Object) If GlobalScope.BasicLibraries.hasByName("XrayTool") Then GlobalScope.BasicLibraries.loadLibrary("XrayTool") GlobalScope.DialogLibraries.loadLibrary("XrayTool") End If xray GlobalScope.BasicLibraries End Sub |