#87606# Some routines added

This commit is contained in:
Behrend Cornelius 2001-06-06 11:25:09 +00:00
parent a0f060c5be
commit 922c89118a
5 changed files with 66 additions and 23 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Debug" script:language="StarBasic">REM ***** BASIC *****
Sub WritedbgInfo(LocObject as Object)
@ -85,7 +85,7 @@ Dim sValues as String
sValues = &quot;&quot;
For i = 0 To Ubound(oLocObject.PropertySetInfo.Properties)
Propname = oLocObject.PropertySetInfo.Properties(i).Name
sValues = sValues &amp; PropName &amp; chr(13) &apos;&quot; = &quot; &amp; oLocObject.GetPropertyValue(PropName) &amp; chr(13)
sValues = sValues &amp; PropName &amp; chr(13) &amp; &quot; = &quot; &amp; oLocObject.GetPropertyValue(PropName) &amp; chr(13)
Next i
Msgbox(sValues , 64, GetProductName())
Exit Sub

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Listbox" script:language="StarBasic">Option Explicit
Dim OriginalList()
Dim oDialogModel as Object
@ -187,15 +187,17 @@ End Sub
Sub ToggleListboxControls(oDialogModel as Object, bDoEnable as Boolean)
oDialogModel.lblFields.Enabled = bDoEnable
oDialogModel.lblSelFields.Enabled = bDoEnable
oDialogModel.lstTables.Enabled = bDoEnable
oDialogModel.lstFields.Enabled = bDoEnable
oDialogModel.lstSelFields.Enabled = bDoEnable
oDialogModel.cmdRemoveAll.Enabled = bDoEnable
oDialogModel.cmdRemoveSelected.Enabled = bDoEnable
oDialogModel.cmdMoveAll.Enabled = bDoEnable
oDialogModel.cmdMoveSelected.Enabled = bDoEnable
With oDialogModel
.lblFields.Enabled = bDoEnable
.lblSelFields.Enabled = bDoEnable
.lstTables.Enabled = bDoEnable
.lstFields.Enabled = bDoEnable
.lstSelFields.Enabled = bDoEnable
.cmdRemoveAll.Enabled = bDoEnable
.cmdRemoveSelected.Enabled = bDoEnable
.cmdMoveAll.Enabled = bDoEnable
.cmdMoveSelected.Enabled = bDoEnable
End With
If bDoEnable Then
FormSetMoveRights()
End If

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Misc" script:language="StarBasic">REM ***** BASIC *****
Const SBSHARE = 0
@ -45,7 +45,7 @@ End Function
Function ConnecttoDatabase(DSName as String, UserID as String, Password as String, Optional Propertylist(), Optional DriverProperties() as New com.sun.star.beans.PropertyValue)
Dim oDBContext as Object
Dim oDBSource as Object
On Local Error Goto NOCONNECTION
&apos; On Local Error Goto NOCONNECTION
oDBContext = CreateUnoService(&quot;com.sun.star.sdb.DatabaseContext&quot;)
If oDBContext.HasbyName(DSName) Then
oDBSource = oDBContext.GetByName(DSName)
@ -650,8 +650,6 @@ Dim oArg() as new com.sun.star.beans.PropertyValue
Dim oUrl as new com.sun.star.util.URL
Dim oTrans as Object
Dim oDisp as Object
&apos; oArg(0).Name = &quot;LibraryName&quot;
&apos; oArg(0).Value = sLibname
oTrans = createUNOService(&quot;com.sun.star.util.URLTransformer&quot;)
oUrl.Complete = &quot;slot:&quot; &amp; CStr(SlotID)
oTrans.parsestrict(oUrl)
@ -683,4 +681,15 @@ Dim oLocale as New com.sun.star.lang.Locale
GetLocale = oLocale
End Function
</script:module>
Sub ToggleDesignMode(oDocument as Object)
Dim aSwitchMode as new com.sun.star.util.URL
aSwitchMode.Complete = &quot;.uno:SwitchControlDesignMode&quot;
aTransformer = createUnoService(&quot;com.sun.star.util.URLTransformer&quot;)
aTransformer.parseStrict(aSwitchMode)
oFrame = oDocument.currentController.Frame
oDispatch = oFrame.queryDispatch(aSwitchMode, oFrame.Name, 63)
Dim aEmptyArgs() as com.sun.star.bean.PropertyValue
oDispatch.dispatch(aSwitchMode, aEmptyArgs())
Erase aSwitchMode
End Sub</script:module>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="ModuleControls" script:language="StarBasic">Option Explicit
@ -150,4 +150,27 @@ Dim oDialog as Object
oDialog = CreateUnoDialog(oLib, DialogName)
LoadDialog() = oDialog
End Function
</script:module>
Sub SwitchWizardDialogHeight(oDialog as Object)
Dim oDialogModel as Object
Dim iDlgHeight as Integer
Dim iYPos as Integer
oDialogModel = oDialog.Model
If oDialogModel.Height &gt; 100 Then
iDlgHeight = 26
oDialog.GetControl(&quot;imgTheme&quot;).Visible = False
Else
iDlgHeight = 210
oDialog.GetControl(&quot;imgTheme&quot;).Visible = True
End If
iYPos = iDlgHeight - 20
oDialogModel.cmdCancel.PositionY = iYPos
oDialogModel.cmdHelp.PositionY = iYPos
&apos; Todo: Abfragen, ob in der Sequenze oDialogModel.GetControls() auch ein cmdBack
&apos; vorhanden ist
oDialogModel.cmdBack.PositionY = iYPos
oDialogModel.cmdGoOn.PositionY = iYPos
oDialogModel.cmdSwitchHeight.PositionY = iYPos
oDialogModel.Height = iDlgHeight
End Sub</script:module>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Strings" script:language="StarBasic">Option Explicit
Public sProductname as String
@ -14,7 +14,6 @@ Dim i% ,n%
End Function
&apos; Deletes out of a String &apos;BigString&apos; a possible Partstring &apos;CompString&apos;
Function DeleteStr(ByVal BigString,CompString as String) as String
Dim i%, CompLen%, BigLen%
@ -31,7 +30,6 @@ Dim i%, CompLen%, BigLen%
End Function
&apos; Finds a PartString, that is framed by the Strings &apos;Prestring&apos; and &apos;PostString&apos;
Function FindPartString(BigString, PreString, PostString as String, SearchPos as Integer) as String
Dim StartPos%, EndPos%
@ -125,7 +123,6 @@ Dim StartUbound as Integer
End Function
&apos; Deletes all fieldvalues in one-dimensional Array
Sub ClearArray(BigArray)
Dim i as integer
@ -412,4 +409,16 @@ On Local Error Goto No2ndDim
Next s
BubbleSortList = SortList()
End Function
Function GetValueoutofList(SearchValue, BigList(), iDim as Integer)
Dim i as Integer
Dim MaxIndex as Integer
MaxIndex = Ubound(BigList(),1)
For i = 0 To MaxIndex
If BigList(i,0) = SearchValue Then
GetValueOutOfList() = BigList(i,iDim)
End If
Next i
End Function
</script:module>