diff options
author | Behrend Cornelius <bc@openoffice.org> | 2001-10-12 14:14:06 +0000 |
---|---|---|
committer | Behrend Cornelius <bc@openoffice.org> | 2001-10-12 14:14:06 +0000 |
commit | 1b06eaa397078bf5f016f517f171a2e3ce5427d5 (patch) | |
tree | 825d7c9c1959ca5767dd48a2c13e566c7b846791 /wizards/source | |
parent | 7123ce2eb7dfebce179fa611d85d968a04b2604e (diff) |
#93102# Bug with borders now fixed, call from beamer now works fine
Diffstat (limited to 'wizards/source')
-rw-r--r-- | wizards/source/formwizard/DBMeta.xba | 56 | ||||
-rw-r--r-- | wizards/source/formwizard/DlgFormDB.xdl | 4 | ||||
-rw-r--r-- | wizards/source/formwizard/FormWizard.xba | 29 | ||||
-rw-r--r-- | wizards/source/formwizard/Layouter.xba | 30 | ||||
-rw-r--r-- | wizards/source/formwizard/develop.xba | 103 | ||||
-rw-r--r-- | wizards/source/formwizard/tools.xba | 22 |
6 files changed, 122 insertions, 122 deletions
diff --git a/wizards/source/formwizard/DBMeta.xba b/wizards/source/formwizard/DBMeta.xba index 44ed39704d3e..9b0e23933f67 100644 --- a/wizards/source/formwizard/DBMeta.xba +++ b/wizards/source/formwizard/DBMeta.xba @@ -7,6 +7,7 @@ Public sDatabaseList() Public iCommandTypes() as Integer Public CurCommandType as Integer Dim oDataSource as Object +Public bEnableBinaryOptionGroup as Boolean Sub GetDatabaseNames() @@ -114,7 +115,6 @@ Dim oField as Object MaxIndex = Ubound(oDialogModel.lstSelFields.StringItemList()) Dim ColumnMap(MaxIndex)as Integer FieldNames() = oDialogModel.lstSelFields.StringItemList() - ' Build a structure which maps the position of a selected field (within the selection) to the the column position within ' the table. So we ensure that the controls are placed in the same order the according fields are selected. For i = 0 To Ubound(FieldNames()) @@ -129,7 +129,6 @@ Dim oField as Object n = n + 1 Wend Next i - For n = 0 to MaxIndex sFieldname = FieldNames(n) oField = oColumns.GetByName(sFieldName) @@ -141,12 +140,14 @@ Dim oField as Object Next ReDim oDBShapeList(MaxIndex) as Object ReDim oTCShapeList(MaxIndex) as Object + ReDim oDBModelList(MaxIndex) as Object End Sub Sub GetSpecificFieldNames() Dim n as Integer Dim m as Integer +Dim s as Integer Dim iType as Integer Dim oField as Object Dim MaxIndex as Integer @@ -155,6 +156,7 @@ Dim EmptyList() FieldNames() = oColumns.GetElementNames() MaxIndex = Ubound(FieldNames()) Dim ResultFieldNames(MaxIndex) + ReDim ImgFieldNames(MaxIndex) m = 0 For n = 0 To MaxIndex oField = oColumns.GetByName(FieldNames(n)) @@ -163,7 +165,17 @@ Dim EmptyList() ResultFieldNames(m) = FieldNames(n) m = m + 1 End If + If GetIndexInMultiArray(ImgWidthList(), iType, 0) <> -1 Then + ImgFieldNames(s) = FieldNames(n) + s = s + 1 + End If Next n + If s <> 0 Then + Redim Preserve ImgFieldNames(s-1) + bEnableBinaryOptionGroup = True + Else + bEnableBinaryOptionGroup = False + End If Redim Preserve ResultFieldNames(m-1) Redim Preserve FieldNames(m-1) FieldNames() = ResultFieldNames() @@ -187,7 +199,7 @@ Sub CreateDBForm() End Sub -Sub AddBinaryFieldsToWidthList() +Sub AddOrRemoveBinaryFieldsToWidthList() Dim LocWidthList() Dim MaxIndex as Integer Dim OldMaxIndex as Integer @@ -197,25 +209,22 @@ Dim m as Integer ' Todo: Die folgenden Zeilen könnten in einer allgemeinen Routine ' bearbeitet werden, z. B. durch Umschreiben von AddListToList, wobei ' beim Abfragen des Ubounds der zweiten Dimension eine Fehlerabfrage nötig wäre. - MaxIndex = Ubound(WidthList(),1) + Ubound(ImgWidthList(),1) + 1 - OldMaxIndex = Ubound(WidthList(),1) - ReDim Preserve WidthList(MaxIndex,4) - s = 0 - For n = OldMaxIndex + 1 To MaxIndex - For m = 0 To 4 - WidthList(n,m) = ImgWidthList(s,m) - Next m - s = s + 1 - Next n - FillUpFieldsListbox(True) -End Sub - - -Sub RemoveBinaryFieldsFromWidthList() -Dim MaxIndex as Integer - MaxIndex = Ubound(WidthList(),1) - Ubound(ImgWidthList(),1) - 1 - ReDim Preserve WidthList(MaxIndex, 4) - FillUpFieldsListbox(True) + If oDialogModel.optBinariesasGraphics.State = 1 Then +' MaxIndex = Ubound(WidthList(),1) + Ubound(ImgWidthList(),1) + 1 +' OldMaxIndex = Ubound(WidthList(),1) + ReDim Preserve WidthList(18,4) + s = 0 + For n = OldMaxIndex + 1 To MaxIndex + For m = 0 To 3 + WidthList(n,m) = ImgWidthList(s,m) + Next m + s = s + 1 + Next n + MergeList(oDialogModel.lstFields, ImgFieldNames()) + Else + ReDim Preserve WidthList(15, 4) + RemoveListItems(oDialogModel.lstFields(), oDialogModel.lstSelFields(), ImgFieldNames()) + End If End Sub @@ -244,5 +253,4 @@ Sub GetCurrentMetaValues(Index as Integer) CurControlType = FieldMetaValues(Index,2) CurControlName = FieldMetaValues(Index,3) CurFieldName = FieldNames(Index) -End Sub -</script:module>
\ No newline at end of file +End Sub</script:module>
\ No newline at end of file diff --git a/wizards/source/formwizard/DlgFormDB.xdl b/wizards/source/formwizard/DlgFormDB.xdl index e6c3540e1441..75b9fa5e64c0 100644 --- a/wizards/source/formwizard/DlgFormDB.xdl +++ b/wizards/source/formwizard/DlgFormDB.xdl @@ -39,10 +39,10 @@ </dlg:button> <dlg:radiogroup> <dlg:radio dlg:id="optIgnoreBinaries" dlg:tab-index="15" dlg:left="122" dlg:top="169" dlg:width="104" dlg:height="10" dlg:page="1" dlg:help-url="HID:34427" dlg:value="optIgnoreBinaries"> - <script:event script:event-name="on-performaction" script:location="application" script:macro-name="FormWizard.DBMeta.RemoveBinaryFieldsFromWidthList" script:language="StarBasic"/> + <script:event script:event-name="on-itemstatechange" script:location="application" script:macro-name="FormWizard.DBMeta.AddOrRemoveBinaryFieldsToWidthList" script:language="StarBasic"/> </dlg:radio> <dlg:radio dlg:id="optBinariesasGraphics" dlg:tab-index="16" dlg:left="12" dlg:top="169" dlg:width="104" dlg:height="10" dlg:page="1" dlg:help-url="HID:34426" dlg:value="optBinariesasGraphics"> - <script:event script:event-name="on-performaction" script:location="application" script:macro-name="FormWizard.DBMeta.AddBinaryFieldsToWidthList" script:language="StarBasic"/> + <script:event script:event-name="on-itemstatechange" script:location="application" script:macro-name="FormWizard.DBMeta.AddOrRemoveBinaryFieldsToWidthList" script:language="StarBasic"/> </dlg:radio> </dlg:radiogroup> <dlg:menulist dlg:id="lstFields" dlg:tab-index="17" dlg:left="6" dlg:top="81" dlg:width="110" dlg:height="70" dlg:page="1" dlg:help-url="HID:34420" dlg:multiselection="true"> diff --git a/wizards/source/formwizard/FormWizard.xba b/wizards/source/formwizard/FormWizard.xba index 1524ec8156d0..9363621a246b 100644 --- a/wizards/source/formwizard/FormWizard.xba +++ b/wizards/source/formwizard/FormWizard.xba @@ -14,6 +14,8 @@ Public TexturePath as String Public sQueryName as String Public NumberofStyles as Integer Public oDBConnection as Object +Public bWithBackGraphic as Boolean + Public bNeedFieldRefresh as Boolean Public oDBForm as Object @@ -22,6 +24,7 @@ Public sDatabaseList() Public TableNames() as String Public QueryNames() as String Public FieldNames() as String +Public ImgFieldNames() as String Public oDBContext as Object Public oUcb as Object Public oDocInfo as Object @@ -91,7 +94,7 @@ Dim SelCount as Integer bNeedFieldRefresh = True With oDialogModel - .optIgnoreBinaries.State = True +' .optIgnoreBinaries.State = True .cmdBack.Enabled = False .cmdGoOn.Enabled = False .lblTables.Enabled = False @@ -100,14 +103,17 @@ Dim SelCount as Integer .lstDatabases.StringItemList()= sDatabaseList()' = AddItem(sDatabaseList(i) End With If Not IsMissing(DataSourceName) Then + sDBName = DataSourceName DlgFormDB.GetControl("lstDatabases").SelectItem(DataSourceName, True) If Not IsMissing(oConnection) Then ' Scenario 3: a data source and a connection are given Set oDBConnection = oConnection + oDataSource = oDBContext.GetByName(DataSourceName) oDialogModel.lstTables.Enabled = True oDialogModel.lblTables.Enabled = True If GetDBMetaData() Then oDialogModel.lstTables.StringItemList() = AddListToList(TableNames(), QueryNames()) + iCommandTypes = CreateCommandTypeList() If Not IsMissing(sContent) Then ' Scenario 4: all parameters (data source name, connection, object type and object) are given iCommandTypes() = CreateCommandTypeList() @@ -120,7 +126,7 @@ Dim SelCount as Integer DlgFormDB.GetControl("lstTables").SelectItemPos(SelIndex, True) ElseIf CommandType = com.sun.star.sdb.CommandType.TABLE Then SelIndex = IndexInArray(sContent, TableNames() - DlgFormDB.GetControl("lstTables").SelectItemPos(Ubound(QueryNames()+1 + SelIndex, True) + DlgFormDB.GetControl("lstTables").SelectItemPos(Ubound(QueryNames()+1 + SelIndex, True) End If End If CurCommandType = CommandType @@ -132,7 +138,7 @@ Dim SelCount as Integer GetSelectedDBMetaData() End If Else - ' Scenario 1: No parameters are given + ' Scenario 1: No parameters are given ToggleListboxControls(oDialogModel, False) End If @@ -149,9 +155,9 @@ Dim SelCount as Integer If Not IsNull(oDBConnection) Then oDBConnection.Dispose() End If - If bDisposeDoc Then - oDocument.Dispose - End If +' If bDisposeDoc Then +' oDocument.Dispose +' End If Exit Sub GlobalError: MsgBox(sMsgErrMsg , 16, sMsgWizardName) @@ -260,11 +266,11 @@ End Sub Sub ToggleDatabasePage(bDoEnable as Boolean) With oDialogModel - .hlnBinaries.Enabled = bDoEnable - .optIgnoreBinaries.Enabled = bDoEnable - .optBinariesasGraphics.Enabled = bDoEnable .cmdHelp.Enabled = bDoEnable .cmdGoOn.Enabled = Ubound(oDialogModel.lstSelFields.StringItemList()) <> -1 + .hlnBinaries.Enabled = ((bDoEnable = True) And (bEnableBinaryOptionGroup = True)) + .optIgnoreBinaries.Enabled = ((bDoEnable = True) And (bEnableBinaryOptionGroup = True)) + .optBinariesasGraphics.Enabled = ((bDoEnable = True) And (bEnableBinaryOptionGroup = True)) End With End Sub @@ -300,10 +306,13 @@ Dim sBaseBookmarkName as String i = i + 1 sBookmarkName = sBaseBookmarkName & "_" & i Else - oDBBookmarks.insertByName(sBookmarkName, sTargetPath) + oDBBookmarks.insertByName(sBookmarkName, sTargetPath) End If Loop Until Not bLinkExists bDisposeDoc = False DlgFormDB.EndExecute() + ToggleDesignMode(oDocument) + ' Todo: evtl unsinnige Standardwerte für Controls rauswerfen + oDBForm.Reload() End If End Sub</script:module>
\ No newline at end of file diff --git a/wizards/source/formwizard/Layouter.xba b/wizards/source/formwizard/Layouter.xba index 4e17d48143cd..13f9aeb8ad61 100644 --- a/wizards/source/formwizard/Layouter.xba +++ b/wizards/source/formwizard/Layouter.xba @@ -156,7 +156,6 @@ Dim aSize As New com.sun.star.awt.Size aSize.Width = nPageHeight aSize.Height = nPageWidth oPageStyle.Size = aSize - nPageWidth = nPageHeight nPageHeight = oPageStyle.Size.Height nFormWidth = nPageWidth - oPageStyle.RightMargin - oPageStyle.LeftMargin - 2 * cXOffset @@ -169,6 +168,7 @@ Sub ChangeBorderLayouts(oEvent as Object) Dim oModel as Object Dim i as Integer Dim oCurModel as Object +Dim sLocText as String oModel = oEvent.Source.Model SwitchBorderMode(Val(Right(oModel.Name,1))) ToggleLayoutPage(False) @@ -181,10 +181,7 @@ Dim oCurModel as Object Else If OldBorderType <> CurBorderType Then For i = 0 To MaxIndex - oCurModel = oDBShapeList(i).GetControl - If oCurModel.PropertySetInfo.HasPropertyByName("Border")Then - oCurModel.Border = CurBorderType - End If + oDBModelList(i).Border = CurBorderType Next i End If End If @@ -195,7 +192,6 @@ End Sub Sub ChangeLabelAlignments(oEvent as Object) Dim i as Integer -Dim oCurModel as Object Dim oModel as Object oModel = oEvent.Source.Model SwitchAlignMode(Val(Right(oModel.Name,1))) @@ -203,8 +199,7 @@ Dim oModel as Object oDocument.LockControllers() If OldAlignMode <> CurAlignMode Then For i = 0 To MaxIndex - oCurModel = oTCShapeList(i).GetControl - oCurModel.Align = CurAlignmode + oTCShapeList(i).GetControl.Align = CurAlignmode Next i End If oDocument.UnlockControllers() @@ -253,16 +248,16 @@ End Sub Sub ToggleAlignGroup(ByVal bDoEnable as Boolean) With oDialogModel If bDoEnable Then - bDoEnable = CurArrangement <> cTabled + bDoEnable = CurArrangement = cColumnarLeft End If .hlnAlign.Enabled = bDoEnable .optAlign0.Enabled = bDoEnable - .optAlign2.Enabled = bDoEnable ' + .optAlign2.Enabled = bDoEnable End With End Sub -Sub ToggleLayoutPage(bDoEnable as Boolean) +Sub ToggleLayoutPage(bDoEnable as Boolean, Optional FocusControlName as String) With oDialogModel .hlnArrangements.Enabled = bDoEnable .cmdArrange1.Enabled = bDoEnable @@ -272,16 +267,14 @@ Sub ToggleLayoutPage(bDoEnable as Boolean) .cmdArrange5.Enabled = bDoEnable .lstStyles.Enabled = bDoEnable .lblStyles.Enabled = bDoEnable - .hlnBackground.Enabled = bDoEnable - .optTiled.Enabled = bDoEnable - .optArea.Enabled = bDoEnable .cmdHelp.Enabled = bDoEnable .cmdBack.Enabled = bDoEnable .cmdGoOn.Enabled = bDoEnable -' If DlgFormDB.GetControl("imgTheme").Visible Then -' .imgTheme.Enabled = bDoEnable -' End If + If Not IsMissing(FocusControlName) Then + DlgFormDB.GetControl(FocusControlName).SetFocus() + End If End With + ToggleOptionButtons(oDialogModel,((bWithBackGraphic = True) AND (bDoEnable = True))) ToggleAlignGroup(bDoEnable) ToggleBorderGroup(bDoEnable) End Sub @@ -318,5 +311,4 @@ End Sub Sub SwitchAlignMode(ByVal LocAlignMode as Integer) OldAlignMode = CurAlignMode CurAlignMode = LocAlignMode -End Sub -</script:module>
\ No newline at end of file +End Sub</script:module>
\ No newline at end of file diff --git a/wizards/source/formwizard/develop.xba b/wizards/source/formwizard/develop.xba index 0c5b6fb11c90..22389d8507da 100644 --- a/wizards/source/formwizard/develop.xba +++ b/wizards/source/formwizard/develop.xba @@ -5,6 +5,7 @@ Option Explicit Public oDBShapeList() as Object Public oTCShapeList() as Object +Public oDBModelList() as Object Public oGridShape as Object Public a as Integer Public StartA as Integer @@ -36,15 +37,18 @@ Dim i as Integer StartA = 0 nMaxRowY = 0 nSecMaxRowY = 0 + If CurArrangement = cLeftJustified Or cTopJustified Then + oDialogModel.optAlign0.State = 1 + End If For i = 0 To MaxIndex GetCurrentMetaValues(i) oTCModel = InsertTextControl(i) If CurFieldType = com.sun.star.sdbc.DataType.TIMESTAMP Then InsertTimeStampShape(i) Else - InsertDBControl(oDBModel, i) + InsertDBControl(i) bIsVeryFirstRun = False - oDBModel.LabelControl = oTCModel +' oDBModel.LabelControl = oTCModel End If ResetPosSizes(i) oProgressbar.Value = i @@ -102,16 +106,12 @@ Sub RepositionColumnarLeftControls(LastIndex as Integer) Dim aSize As New com.sun.star.awt.Size Dim aPoint As New com.sun.star.awt.Point Dim i as Integer -Dim oLocTextShape as Object -Dim oLocDBShape as Object aSize = GetSize(nMaxTCWidth, nTCHeight) bIsFirstRun = True For i = StartA To LastIndex - Set oLocTextShape = oTCShapeList(i) - Set oLocDBShape = oDBShapeList(i) oLocTextShape.Size = aSize If i = StartA Then - nXTCPos = oLocTextShape.Position.X + nXTCPos = oTCShapeList(i).Position.X nXDBPos = nXTCPos + nMaxTCWidth + cHoriDistance End If ' If oLocDBShape.SupportsService("com.sun.star.drawing.Shapes") Then @@ -119,7 +119,7 @@ Dim oLocDBShape as Object ' ResetDBShape(oLocDBShape(1), nXDBPos + oLocDBShape(0).Size.Width) ' printdbgInfo oLocDBShape ' Else - ResetDBShape(oLocDBShape, nXDBPos) + ResetDBShape(oDBShapeList(i), nXDBPos) CheckOuterPoints(nXDBPos, nDBWidth, nYDBPos, nDBHeight, True) ' End If ' GroupShapes(oDrawPage, oLocTextShape, oLocDBShape) @@ -135,8 +135,7 @@ Dim aPoint As New com.sun.star.awt.Point nDBHeight = oLocDBShape.Size.Height aPoint = GetPoint(iXPos,nYDBPos) oLocDBShape.SetPosition(aPoint) -End Sub - +End Sub Sub InitializePosSizes() @@ -162,11 +161,14 @@ Dim oShape as Object Dim oModel as Object Dim aPoint as New com.sun.star.awt.Point Dim aSize As New com.sun.star.awt.Size - If bControlsareCreated Then Set oShape = oTCShapeList(i) Set oModel = oShape.GetControl - nTCWidth = oShape.Size.Width + If CurArrangement = cLeftJustified Then + nTCWidth = GetPreferredWidth(oModel, True, CurFieldname) + Else + nTCWidth = oShape.Size.Width + End If nTCHeight = oShape.Size.Height oShape.Position = GetPoint(nXTCPos, nYTCPos) If CurArrangement = cColumnarTop Then @@ -204,6 +206,7 @@ Dim aSize As New com.sun.star.awt.Size Case cLeftJustified nXDBPos = nMaxColRightX Case cColumnarTop,cTopJustified + oModel.Align = com.sun.star.awt.TextAlign.LEFT nXDBPos = nXTCPos nYDBPos = nYTCPos + nTCHeight If CurFieldLength = 20 And nDBWidth > 2 * nTCWidth Then @@ -215,43 +218,37 @@ Dim aSize As New com.sun.star.awt.Size End Function -Sub InsertDBControl(oDBModel as Object, i as Integer) +Sub InsertDBControl(i as Integer) Dim aPoint as New com.sun.star.awt.Point Dim aSize As New com.sun.star.awt.Size -Dim oShape as Object Dim oControl as Object Dim iColRightX as Long aPoint = GetPoint(nXDBPos, nYDBPos) If bControlsAreCreated Then - Set oShape = oDBShapeList(i) - Set oDBModel = oShape.GetControl - oShape.Position = aPoint +' Set oDBModel = oDBModelList(i) 'oDBShapeList(i).GetControl + oDBShapeList(i).Position = aPoint Else - oDBModel = CreateUnoService(oModelService(CurControlType)) -' oDBModel.Name = CurControlName - SetNumerics(oDBModel, CurFieldType) - oShape = InsertControl(oDrawPage, oDBModel, aPoint, aSize) - Set oDBShapeList(i)= oShape + oDBModelList(i) = CreateUnoService(oModelService(CurControlType)) + oDBShapeList(i) = InsertControl(oDrawPage, oDBModelList(i), aPoint, aSize) + SetNumerics(oDBModelList(i), CurFieldType) ' Todo: According to FS this handling should be verified. I should not rely on the shape to create a model on its ' own. therefor the model should be inserted before the shape ' oDBForm.InsertByName(oDBModel.Name, oDBModel) If CurControlType = cCheckBox Then - oDBModel.Label = "" + oDBModelList(i).Label = "" End If End If - - nDBHeight = GetDBHeight(oDBModel) - nDBWidth = GetPreferredWidth(oDBModel,True) - + nDBHeight = GetDBHeight(oDBModelList(i)) + nDBWidth = GetPreferredWidth(oDBModelList(i),True) aSize = GetSize(nDBWidth,nDBHeight) - oShape.SetSize(aSize) + oDBShapeList(i).SetSize(aSize) CheckOuterPoints(nXDBPos, nDBWidth, nYDBPos, nDBHeight, True) - oDBModel.DataField = CurFieldName + oDBModelList(i).DataField = CurFieldName End Sub -Function InsertTimeStampShape(i as Integer) +Function InsertTimeStampShape(i as Integer) as Object Dim oDateModel as Object Dim oTimeModel as Object Dim oDateShape as Object @@ -263,47 +260,41 @@ Dim nDateWidth as Long Dim nTimeWidth as Long Dim oGroupShape as Object - aPoint = GetPoint(nXDBPos, nYDBPos) +' aPoint = GetPoint(nXDBPos, nYDBPos) oGroupShape = oDocument.CreateInstance("com.sun.star.drawing.GroupShape") - aSize = GetSize(2000, 600) - oGroupShape.Size = aSize - oGroupShape.Position = (aPoint) 'oFirstShape.Position - oGroupShape.AnchorType = com.sun.star.text.TextContentAnchorType.AT_PARAGRAPH - oDrawPage.Add(oGroupShape) - printdbgInfo oGroupShape - aSize = GetSize(1000, 600) - aPoint = GetPoint(0,0) +' aSize = GetSize(2000, 600) +' oGroupShape.Size = aSize +' oGroupShape.Position = (aPoint) 'oFirstShape.Position +' oGroupShape.AnchorType = com.sun.star.text.TextContentAnchorType.AT_PARAGRAPH +' aSize = GetSize(1000, 600) +' aPoint = GetPoint(0,0) + CurFieldType = com.sun.star.sdbc.DataType.DATE oDateModel = CreateUnoService("com.sun.star.form.component.DateField") - oDateModel.DataField = CurFieldName - oDateShape = InsertControl(oGroupShape, oDateModel, aPoint, aSize) - - oTimeModel = CreateUnoService("com.sun.star.form.component.TimeField") - oTimeShape = InsertControl(oDrawPage, oTimeModel, aPoint, aSize) - - oGroupShape.Add(oFirstShape) - oGroupShape.Add(oSecShape) - CreateDateTimeShapeCollection() = oGroupShape - - + oDateModel.DataField = CurFieldName + oDateShape = InsertControl(oDrawPage, oDateModel, aPoint, aSize) + SetNumerics(oDateModel, CurFieldType) nDBHeight = GetDBHeight(oDateModel) nDateWidth = GetPreferredWidth(oDateModel,True) aSize = GetSize(nDateWidth,nDBHeight) oDateShape.SetSize(aSize) aPoint = GetPoint(nXDBPos+nDateWidth, nYDBPos) + + CurFieldType = com.sun.star.sdbc.DataType.TIME + oTimeModel = CreateUnoService("com.sun.star.form.component.TimeField") + oTimeModel.DataField = CurFieldName + oTimeShape = InsertControl(oGroupShape, oTimeModel, aPoint, aSize) nTimeWidth = GetPreferredWidth(oTimeModel) aSize = GetSize(nTimeWidth,nDBHeight) oTimeShape.SetSize(aSize) - oTimeModel.DataField = CurFieldName - - -' oDateTimeShape = CreateDateTimeShapeCollection(oDrawPage, oDateShape, oTimeShape) -' ShowSupportedServiceNames(oDateTimeShape) Set oDBShapeList(i)= oDateTimeShape + oGroupShape.Add(oTimeShape) nDBWidth = nDateWidth + nTimeWidth CheckOuterPoints(nXDBPos, nDBWidth, nYDBPos, nDBHeight, True) + InsertTimeStampShape() = oGroupShape End Function + Sub CheckJustifiedPosition() Dim nLeftDist as Long Dim nRightDist as Long @@ -489,7 +480,7 @@ Dim aSize as New com.sun.star.awt.Size aSize = GetSize(nFormWidth, nFormHeight) oDBForm.InsertByName (oGridModel.Name, oGridModel) oGridShape = InsertControl(oDrawPage, oGridModel, aPoint, aSize) -End function +End Function diff --git a/wizards/source/formwizard/tools.xba b/wizards/source/formwizard/tools.xba index 87d5ec117d58..32be2b6d9c9c 100644 --- a/wizards/source/formwizard/tools.xba +++ b/wizards/source/formwizard/tools.xba @@ -45,7 +45,6 @@ Dim oControl as Object End Function - Function GetPeerSize(oModel as Object, oControl as Object, Optional LocText) Dim oPeer as Object Dim aPeerSize as new com.sun.star.awt.Size @@ -67,10 +66,10 @@ Dim aPeerSize as new com.sun.star.awt.Size ElseIf CurFieldType = com.sun.star.sdbc.DataType.TIME Then oControl.Time = Time Else - Dim sText as String - sText = Mid(SBSIZETEXT,1,CurFieldLength) - oControl.Text = sText -' oControl.Model.Text = sText +' oControl.Text = Mid(SBSIZETEXT,1,CurFieldLength) + aPeerSize = oPeer.PreferredSize() + GetPeerSize() = aPeerSize + Exit Function End If aPeerSize = oPeer.PreferredSize() GetPeerSize = aPeerSize @@ -96,7 +95,7 @@ Function PixelTo100thMMX(oControl as Object) as long oPeer = oControl.GetPeer() PixelTo100mmX = Clng(Peer.GetInfo.PixelPerMeterX/100000) -' PixelTo100thMM = nValue * 28 ' nur ungefähre Berechnung +' PixelTo100thMM = nValue * 28 ' nur ungefähre Berechnung End function @@ -104,7 +103,7 @@ Function PixelTo100thMMY(oControl as Object) as long oPeer = oControl.GetPeer() PixelTo100mmX = Clng(Peer.GetInfo.PixelPerMeterY/100000) -' PixelTo100thMM = nValue * 28 ' nur ungefähre Berechnung +' PixelTo100thMM = nValue * 28 ' nur ungefähre Berechnung End function @@ -127,7 +126,6 @@ End Function Sub ImportStyles() Dim CurIndex as Integer Dim sImportPath as String -Dim bWithBackGraphic as Boolean ToggleLayoutPage(False) oDocument.LockControllers CurIndex = GetCurIndex(oDialogModel.lstStyles, Styles(), NumberofStyles,8) @@ -137,7 +135,7 @@ Dim bWithBackGraphic as Boolean ToggleOptionButtons(oDialogModel, bWithBackGraphic) ConfigurePageStyle() oDocument.UnlockControllers - ToggleLayoutPage(True) + ToggleLayoutPage(True, "lstStyles") End Sub @@ -168,11 +166,13 @@ Function SetNumerics(ByVal oLocObject as Object, iLocFieldType as Integer) as Ob Case com.sun.star.sdbc.DataType.CHAR, com.sun.star.sdbc.DataType.VARCHAR, com.sun.star.sdbc.DataType.LONGVARCHAR If oLocObject.MaxTextLen = 0 Or oLocObject.MaxTextLen > 30 Then oLocObject.MaxTextLen = 30 + CurFieldLength = 30 Else oLocObject.MaxTextLen = CurFieldLength End If + oLocObject.DefaultText = Mid(SBSIZETEXT,1,CurFieldLength) Case com.sun.star.sdbc.DataType.DATE, com.sun.star.sdbc.DataType.TIME - oLocObject.MaxTextLen = CurFieldLength + oLocObject.MaxTextLen = CurFieldLength End Select End Function @@ -231,7 +231,7 @@ Dim ResCount as Integer End Function -Function GetDBHeight(oDBModel as Object) +Function GetDBHeight(oDBModel as Object) If CurControlType = cImageControl Then nDBWidth = 2000 Else |