diff options
author | Behrend Cornelius <bc@openoffice.org> | 2001-06-15 14:34:18 +0000 |
---|---|---|
committer | Behrend Cornelius <bc@openoffice.org> | 2001-06-15 14:34:18 +0000 |
commit | 6ca32944979cf38fe408b68e040585b8820b36b4 (patch) | |
tree | 21808a7f5939165e7681b5d65c635b9b88da4d36 /wizards/source/formwizard/tools.xba | |
parent | 3203cca098e3fddb2a94e0c5bfbee59ba2a3b89f (diff) |
#87606# several improvements
Diffstat (limited to 'wizards/source/formwizard/tools.xba')
-rw-r--r-- | wizards/source/formwizard/tools.xba | 107 |
1 files changed, 71 insertions, 36 deletions
diff --git a/wizards/source/formwizard/tools.xba b/wizards/source/formwizard/tools.xba index 9d42e86674ad..deda298cde8f 100644 --- a/wizards/source/formwizard/tools.xba +++ b/wizards/source/formwizard/tools.xba @@ -17,6 +17,7 @@ Dim aPeerSize as new com.sun.star.awt.Size Dim nWidth as Integer Dim oControl as Object ' Todo: Wie geht das mit ImageControls +' kann nur fest verdrahtet werden If Not IsMissing(LocText) Then aPeerSize = GetPeerSize(oModel, oControl, LocText) Else @@ -102,57 +103,91 @@ End Function Sub ImportStyles() Dim CurIndex as Integer Dim sImportPath as String - oDocument.LockControllers +' oDocument.LockControllers CurIndex = GetCurIndex(oDialogModel.lstStyles, Styles(), NumberofStyles,8) sImportPath = Styles(8,CurIndex) LoadNewStyles(oDocument, oDialogModel, CurIndex, sImportPath, Styles(), TexturePath) - ' Todo: Diese Zeile wieder rein wenn Bug #83015 behoben ist ControlCaptionsToStandardLayout() - oDocument.UnlockControllers + ConfigurePageStyle() +' oDocument.UnlockControllers End Sub -' Todo: Einbinden!!! -Function SetMaxNumericValue(ByVal oLocObject as Object, nType as Long) as Object - oLocObject.DecimalAccuracy = 0 ' keine Nachkommastellen - oLocObject.ValueMin = 0 ' Minwerte sind 0 - select Case (nType) - case cLong - oLocObject.ValueMax = 2147483647 ' Maxwert - case cInteger - oLocObject.ValueMax = 32767 ' Maxwert - case cShortInt - oLocObject.ValueMax = 255 ' Maxwert - case cDecimal - oLocObject.DecimalAccuracy = FieldDecimalAccuracy%(n%) ' Nachkommastellen +Function SetNumerics(ByVal oLocObject as Object) as Object + ' Todo: FS fragen, ob dies alles richtig ist + ' Todo: Es sollte in der Hilfe darauf hingewiesen werden, dass der untere Wertbereich negativ ist. + Select Case CurFieldType + Case com.sun.star.sdbc.DataType.BIGINT + oLocObject.ValueMax = 2147483647 * 2147483647 + oLocObject.ValueMin = -(-2147483648 * -2147483648) + Case com.sun.star.sdbc.DataType.INTEGER + oLocObject.ValueMax = 2147483647 + oLocObject.ValueMin = -2147483648 + Case com.sun.star.sdbc.DataType.SMALLINT + oLocObject.ValueMax = 32767 + oLocObject.ValueMin = -32768 + Case com.sun.star.sdbc.DataType.TINYINT + oLocObject.ValueMax = 127 + oLocObject.ValueMin = -128 + Case com.sun.star.sdbc.DataType.FLOAT, com.sun.star.sdbc.DataType.REAL, com.sun.star.sdbc.DataType.DOUBLE, com.sun.star.sdbc.DataType.DECIMAL, com.sun.star.sdbc.DataType.NUMERIC + ' Todo: Hier sollte der Numberformatter angeworfen werden um die Nachkommastellen + ' festzulegen +' oLocObject.DecimalAccuracy = FieldDecimalAccuracy%(n%) ' Nachkommastellen End Select SetMaxColumnValue = oLocObject End Function -Sub MakeControlsVisible(bIsVisible as Boolean) +' Destroy all Shapes in Nirwana +Sub RemoveShapes() Dim n as Integer Dim oControl as Object - For n = 0 To MaxIndex - oControl = oController.GetControl(oDBShapeList(n).GetControl) - oControl.SetVisible(bIsVisible) - oControl = oController.GetControl(oTCShapeList(n).GetControl) - oControl.SetVisible(bIsVisible) + For n = oDrawPage.Count-1 To 0 Step -1 + oShape = oDrawPage(n) + If oShape.Position.Y > -2000 Then + oDrawPage.Remove(oShape) + End If Next n End Sub - -' Todo: Hier werden allgemeine Einstellungen für numerische Werte vorgenommen -' Was wird mit den Währungen gemacht?; für Dezimalfelder muss die Anzahl der -' Nachkommastellen, Tausenderstellen, festgelegt werden. Stichwort "Formatüberprüfungen" -' im Propertybrowser des Controls -Sub HandleNumerics(oObject) - Select Case CurControlType - Case cNumericBox - oLocObject = SetMaxNumericValue(oLocObject, CurFieldType) - Case cCurrencyBox - oLocObject.CurrencySymbol = s_aCurrencySymbol - oLocObject.PrependCurrencySymbol = s_aPrependCurrencySymbol - End Select +' Note as Shapes cannot be removed from the DrawPage without destroying +' the object we have to park them somewhere in Nirwana +Sub ShapesToNirwana() +Dim n as Integer +Dim oControl as Object + For n = 0 To oDrawPage.Count-1 + oDrawPage(n).Position = GetPoint(-20, -10000) + Next n End Sub -</script:module>
\ No newline at end of file + + +Function CalcUniqueContentName(BYVAL oContainer as Object, sBaseName as String) as String +Dim nPostfix as Integer +Dim sReturn as String + nPostfix = 2 + sReturn = sBaseName + + while (oContainer.hasByName(sReturn)) + sReturn = sBaseName & nPostfix + nPostfix = nPostfix + 1 + Wend + CalcUniqueContentName = sReturn +End Function + + + +Function AddListtoList(FirstArray(), SecondArray(), Optional StarIndex) +Dim n as Integer +Dim m as Integer +Dim MaxIndex as Integer + MaxIndex = Ubound(FirstArray()) + Ubound(SecondArray()) + 1 + Dim ResultArray(MaxIndex) + For m = 0 To Ubound(FirstArray()) + ResultArray(m) = FirstArray(m) + Next m + For n = 0 To Ubound(SecondArray()) + ResultArray(m) = SecondArray(n) + m = m + 1 + Next n + AddListToList() = ResultArray() +End Function</script:module>
\ No newline at end of file |