summaryrefslogtreecommitdiff
path: root/wizards
diff options
context:
space:
mode:
authorBehrend Cornelius <bc@openoffice.org>2001-06-22 13:25:07 +0000
committerBehrend Cornelius <bc@openoffice.org>2001-06-22 13:25:07 +0000
commit29190190d9bb3dfa025a5327fe80bf640c953f85 (patch)
tree9d579c46ad0a7e44c20d7c392baeb732ba9c7879 /wizards
parentbc5c68ab1d6185a4850da4349d5cbce23f50cd5a (diff)
#88615# Storing improved, finetuning
Diffstat (limited to 'wizards')
-rw-r--r--wizards/source/formwizard/DBMeta.xba7
-rw-r--r--wizards/source/formwizard/FormWizard.xba32
-rw-r--r--wizards/source/formwizard/Language.xba16
-rw-r--r--wizards/source/formwizard/Layouter.xba2
-rw-r--r--wizards/source/formwizard/dbwizres.src22
-rw-r--r--wizards/source/formwizard/develop.xba64
-rw-r--r--wizards/source/formwizard/tools.xba6
7 files changed, 102 insertions, 47 deletions
diff --git a/wizards/source/formwizard/DBMeta.xba b/wizards/source/formwizard/DBMeta.xba
index 72766c021745..92cda5d69298 100644
--- a/wizards/source/formwizard/DBMeta.xba
+++ b/wizards/source/formwizard/DBMeta.xba
@@ -1,6 +1,8 @@
<?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="DBMeta" script:language="StarBasic">REM ***** BASIC *****
+Option Explicit
+
Public sDatabaseList()
@@ -15,6 +17,7 @@ Sub GetSelectedDBMetaData()
Dim NullList()
Dim OldsDBname as String
Dim bGetMetaData as Boolean
+Dim DBIndex as Integer
If Ubound(oDialogModel.lstDatabases.SelectedItems()) &gt; -1 Then
ToggleDatabasePage(False)
DBIndex = oDialogModel.lstDatabases.SelectedItems(0)
@@ -83,6 +86,10 @@ Sub GetTableMetaData()
Dim iType as Long
Dim m as Integer
Dim Found as Boolean
+Dim i as Integer
+Dim sFieldName as String
+Dim n as Integer
+
MaxIndex = Ubound(oDialogModel.lstSelFields.StringItemList())
Dim ColumnMap(MaxIndex)as Integer
diff --git a/wizards/source/formwizard/FormWizard.xba b/wizards/source/formwizard/FormWizard.xba
index bcf9c049ff01..f1e0460a448b 100644
--- a/wizards/source/formwizard/FormWizard.xba
+++ b/wizards/source/formwizard/FormWizard.xba
@@ -2,6 +2,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="FormWizard" script:language="StarBasic">Option Explicit
+&apos; Todo: Gruppieren der DBControls mit den Textfeldern einbinden
+&apos; Evtl könnte dies auch am Ende geschehen
Public DocumentName as String
Public FormPath$, FormDBName$, FormReturnValue$
Public TemplatePath$
@@ -105,7 +107,7 @@ Dim i as Integer
GlobalError:
MsgBox(sMsgErrMsg , 16, sMsgWizardName)
ToggleWindow(True)
- DlgFormDB.EndExecute()
+ DlgFormDB.Execute()
Reset
Stop
End Sub
@@ -139,6 +141,7 @@ NOFIELDS:
MsgBox sMsgErrCouldNotOpenObject, 16, sMsgWizardName
End Sub
+
Sub CancelFormWizard()
DlgFormDB.EndExecute()
DlgFormDB.Dispose()
@@ -226,23 +229,28 @@ Sub StoreForm()
Dim oFileDialog
Dim iAccept as Integer
Dim sPath as String
-Dim oStoreProperties(0) as New com.sun.star.beans.PropertyValue
Dim ListAny(0)
-&apos; Todo: Laut DV soll hierfür ein integer Wert gesetzt werden
- ListAny(0) = &quot;FileSave_AutoextPwdBox&quot;
- oFileDialog = CreateUnoService(&quot;com.sun.star.ui.FilePicker&quot;)
- oFileDialog.AppendFilter(&quot;Writer 6.0&quot;, &quot;*.sxw&quot;)
- oFileDialog.AppendFilter(&quot;Writer 6.0 Vorlage&quot;, &quot;*.stw&quot;)
+ ListAny(0) = com.sun.star.ui.dialogs.TemplateDescription.FILESAVE_AUTOEXTENSION_PASSWORD_FILTEROPTIONS
+ oFileDialog = CreateUnoService(&quot;com.sun.star.ui.dialogs.FilePicker&quot;)
+ oFileDialog.AppendFilter(sWriterFiltername, &quot;*.sxw&quot;)
+ oFileDialog.AppendFilter(sWriterTemplateFiltername, &quot;*.stw&quot;)
oFileDialog.SetCurrentFilter(&quot;Writer 6.0&quot;)
oFileDialog.Initialize(ListAny())
oFileDialog.SetDisplayDirectory(WorkPath)
oFileDialog.SetDefaultName(&quot;Form_&quot; &amp; sDBName &amp; &quot;.&quot; &amp; TableName
iAccept = oFileDialog.Execute()
If iAccept = 1 Then
- sPath = oFileDialog.Path(0)
- oStoreProperties(0).Name = &quot;FilterName&quot;
- oStoreProperties(0).Value = oFileDialog.GetCurrentFilter
- oDocument.StoreAsUrl(sPath, oStoreProperties())
+ sPath = oFileDialog.Files(0)
+ If oFileDialog.GetCurrentFilter() = sWriterTemplateFiltername Then
+ Dim oStoreProperties(0) as New com.sun.star.beans.PropertyValue
+ oStoreProperties(0).Name = &quot;FilterName&quot;
+ oStoreProperties(0).Value = &quot;swriter: writer_StarOffice_XML_Writer_Template&quot;
+ oDocument.StoreAsUrl(sPath, oStoreProperties())
+ Else
+ Dim NoArgs() as New com.sun.star.beans.PropertyValue
+ oDocument.StoreAsUrl(sPath, NoArgs())
+ End If
DlgFormDB.EndExecute()
End If
-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/Language.xba b/wizards/source/formwizard/Language.xba
index 22d41c8b6387..ae424e735fc7 100644
--- a/wizards/source/formwizard/Language.xba
+++ b/wizards/source/formwizard/Language.xba
@@ -1,6 +1,8 @@
<?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="Language" script:language="StarBasic">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Language" script:language="StarBasic">Option Explicit
+
+
Global Const RID_COMMON = 1000
Global Const RID_FORM = 2200
@@ -36,6 +38,8 @@ Public sReady as String
Public sMsgNoConnection as String
Public sReduceDialog as String
Public sHeightenDialog as String
+Public sWriterFilterName as String
+Public sWriterTemplateFiltername as String
Sub LoadLanguage ()
@@ -130,6 +134,9 @@ Sub SetDialogLanguage ()
.cmdSwitchHeight.HelpText = sReduceDialog
.cmdSwitchHeight.Label = CHR(9653)
+
+ sWriterFilterName = GetResText(RID_FORM + 70)
+ sWriterTemplateFilterName = GetResText(RID_FORM + 71)
End With
End Sub
@@ -235,10 +242,11 @@ Sub InitializeWidthList()
&apos; Todo: Die folgenden Felder auffüllen!
WidthList(15,0) = com.sun.star.sdbc.DataType.TIMESTAMP &apos; = 93;
-&apos; WidthList(15,1) = Datum-Zeit Feld
-&apos; WidthList(15,2) =
+ WidthList(15,1) = 20
+&apos; Todo: Dieses Control ist keine cDatebox sondern Kollektion aus Time und Datefield
+ WidthList(15,2) = cDateBox
WidthList(15,3) = False
-&apos; WidthList(15,4) =
+ WidthList(15,4) = &quot;DateField&quot;
ImgWidthList(0,0) = com.sun.star.sdbc.DataType.BINARY &apos; = -2;
diff --git a/wizards/source/formwizard/Layouter.xba b/wizards/source/formwizard/Layouter.xba
index 842e7147fde0..b0b3f87aef1d 100644
--- a/wizards/source/formwizard/Layouter.xba
+++ b/wizards/source/formwizard/Layouter.xba
@@ -104,7 +104,7 @@ Dim i as Integer
&apos; nFieldPostfixes() = nFldLabelPostfixes$()
oProgressbar = oDocument.GetCurrentController.GetFrame.CreateStatusIndicator
oProgressbar.Start(&quot;&quot;, MaxIndex)
- If OldArrangement = cTabled Then
+ If oDBForm.HasbyName(&quot;Grid1&quot;) Then
oGridshape.Dispose
End If
ToggleLayoutPage(False)
diff --git a/wizards/source/formwizard/dbwizres.src b/wizards/source/formwizard/dbwizres.src
index 21930c1be14e..6582b3dd79ed 100644
--- a/wizards/source/formwizard/dbwizres.src
+++ b/wizards/source/formwizard/dbwizres.src
@@ -2,9 +2,9 @@
*
* $RCSfile: dbwizres.src,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: bc $ $Date: 2001-06-15 15:29:19 $
+ * last change: $Author: bc $ $Date: 2001-06-22 14:25:07 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -2540,6 +2540,24 @@ String RID_DB_FORM_WIZARD_START + 66
};
+String RID_DB_FORM_WIZARD_START + 70
+{
+ Text = "Writer 6.0";
+ Text[English] = "Writer 6.0";
+ Text[ English_us ] = "Writer 6.0";
+ Text[ language_user1 ] = "Dateityp fr Textdokumente";
+};
+
+String RID_DB_FORM_WIZARD_START + 71
+{
+ Text = "Writer 6.0 Vorlage";
+ Text[English] = "Writer 6.0 Template";
+ Text[ English_us ] = "Writer 6.0 Template";
+ Text[ language_user1 ] = "Dateityp fr Textvorlage";
+};
+
+
+
// ============================================================================
String RID_DB_QUERY_WIZARD_START + 0
diff --git a/wizards/source/formwizard/develop.xba b/wizards/source/formwizard/develop.xba
index be83ef6767e1..fd0f81c30cb0 100644
--- a/wizards/source/formwizard/develop.xba
+++ b/wizards/source/formwizard/develop.xba
@@ -1,6 +1,8 @@
<?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="develop" script:language="StarBasic">REM ***** BASIC *****
+Option Explicit
+
Public oDBShapeList() as Object
Public oTCShapeList() as Object
Public oGridShape as Object
@@ -42,7 +44,6 @@ Dim i as Integer
oTCModel = InsertTextControl(i)
InsertDBControl(oDBModel, i)
bIsVeryFirstRun = False
-&apos; Todo: Klären, wieso er bei der folgenden Zeile abstürzt
oDBModel.LabelControl = oTCModel
ResetPosSizes(i)
oProgressbar.Value = i
@@ -57,13 +58,13 @@ Sub ResetPosSizes(LastIndex as Integer)
Case cColumnarLeft
nYDBPos = nYDBPos + nDBHeight + cVertDistance
If (nYDBPos &gt; cYOffset + nFormHeight) Or (LastIndex = MaxIndex) Then
- RepositionControls(LastIndex)
- nXDBPos = nMaxColRightX + cHoriDistance + nMaxTCWidth
- nXTCPos = nMaxColRightX + cHoriDistance
+ RepositionColumnarLeftControls(LastIndex)
+ nXTCPos = nMaxColRightX + 2 * cHoriDistance
+ nXDBPos = nXTCPos + cHoriDistance + nMaxTCWidth
nYDBPos = cYOffset
nYTCPos = cYOffset
bIsFirstRun = True
- StartA = a + 1
+ StartA = LastIndex + 1
a = 0
Else
a = a + 1
@@ -74,10 +75,10 @@ Sub ResetPosSizes(LastIndex as Integer)
If nYTCPos &gt; cYOffset + nFormHeight Then
nXDBPos = nMaxColRightX + cHoriDistance
nXTCPos = nMaxColRightX + cHoriDistance
- nYDBPos = cYOffset + nTCHeight + cVertiDistance
+ nYDBPos = cYOffset + nTCHeight + cVertDistance
nYTCPos = cYOffset
bIsFirstRun = True
- StartA = a + 1
+ StartA = LastIndex + 1
a = 0
Else
a = a + 1
@@ -96,13 +97,14 @@ Sub ResetPosSizes(LastIndex as Integer)
End Sub
-Sub RepositionControls(LastIndex as Integer)
+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)
@@ -111,10 +113,13 @@ Dim oLocDBShape as Object
nXTCPos = oLocTextShape.Position.X
nXDBPos = nXTCPos + nMaxTCWidth + cHoriDistance
End If
- nYDBPos = oLocTextShape.Position.Y
+ nYDBPos = oLocDBShape.Position.Y
+ nDBWidth = oLocDBShape.Size.Width
+ nDBHeight = oLocDBShape.Size.Height
aPoint = GetPoint(nXDBPos,nYDBPos)
oLocDBShape.SetPosition(aPoint)
- GroupShapes(oDrawPage, oLocTextShape, oLocDBShape)
+ CheckOuterPoints(nXDBPos, nDBWidth, nYDBPos, nDBHeight)
+&apos; GroupShapes(oDrawPage, oLocTextShape, oLocDBShape)
Next i
End Sub
@@ -151,7 +156,7 @@ Dim aSize As New com.sun.star.awt.Size
oShape.Position = GetPoint(nXTCPos, nYTCPos)
Else
oModel = CreateUnoService(oModelService(cLabel))
- oModel.Label = CurFieldName &apos; + nFieldPostfixes(i) (Todo: Was ist ein fieldPostfix?)
+&apos; oModel.Label = CurFieldName &apos; + nFieldPostfixes(i) (Todo: Was ist ein fieldPostfix?)
oDBForm.InsertByName(oModel.Name, oModel)
aPoint = GetPoint(nXTCPos, nYTCPos)
aSize = GetSize(nTCWidth,nTCHeight)
@@ -165,21 +170,22 @@ Dim aSize As New com.sun.star.awt.Size
End If
nTCWidth = GetPreferredWidth(oModel, True, CurFieldname)
End If
+ If CurArrangement = cColumnarLeft Then
+ &apos; Note This If Sequence must be called before retrieving the outer Points
+ If bIsFirstRun Then
+ nMaxTCWidth = nTCWidth
+ bIsFirstRun = False
+ ElseIf nTCWidth &gt; nMaxTCWidth Then
+ nMaxTCWidth = nTCWidth
+ End If
+ End If
CheckOuterPoints(oShape.Position.X, nTCWidth, nYTCPos, nTCHeight)
Select Case CurArrangement
Case cLeftJustified
nXDBPos = nMaxColRightX
- Case cColumnarLeft
- If bIsFirstRun Then
- nMaxTCWidth = nTCWidth
- bIsFirstRun = False
- ElseIf nTCWidth &gt; nMaxTCWidth Then
- nMaxTCWidth = nTCWidth
- End If
Case cColumnarTop,cTopJustified
nXDBPos = nXTCPos
nYDBPos = nYTCPos + nTCHeight
-
If CurFieldLength = 20 And nDBWidth &gt; 2 * nTCWidth Then
iReduceWidth = iReduceWidth + 1
End If
@@ -214,6 +220,10 @@ Dim iColRightX as Long
oShape = InsertControl(oDBModel, aPoint, aSize)
Set oDBShapeList(i)= oShape
oDBForm.InsertByName(oDBModel.Name, oDBModel)
+ If CurControlType = cCheckBox Then
+ oDBModel.Label = &quot;&quot;
+ End If
+
End If
If CurControlType = cImageControl Then
&apos; Todo: Dies ist nur eine vorsichtige Schätzung
@@ -249,7 +259,6 @@ Dim oLocDBShape as Object
Dim oLocTextShape as Object
Dim nBaseWidth as Long
nBaseWidth = nFormWidth + cXOffset
-
nLeftDist = nMaxColRightX - nBaseWidth
nRightDist = nBaseWidth - nXTCPos + cHoriDistance
If nLeftDist &lt; 0.5 * nRightDist and iReduceWidth &gt; 2 Then
@@ -257,7 +266,7 @@ Dim nBaseWidth as Long
AdjustLineWidth(StartA, a, nLeftDist, - 1)
If CurArrangement = cLeftjustified Then
nYDBPos = nMaxRowY + cVertDistance
- nYTCPos = nYDBPos
+ nYTCPos = nYDBPos + 5
nXTCPos = cXOffset
Else
nYTCPos = nMaxRowY + cVertDistance
@@ -282,13 +291,13 @@ Dim nBaseWidth as Long
CheckOuterPoints(nXDBPos, nDBWidth, nYDBPos, nDBHeight)
nXDBPos = nMaxColRightX + cHoriDistance
Else
- nYDBPos = nYTCPOS + nTCHeight
+ nYDBPos = nYTCPOS + nTCHeight
nXDBPos = cXOffset
nXTCPos = cXOffset
oLocTextShape.Position = GetPoint(cXOffset, nYTCPos)
oLocDBShape.Position = GetPoint(cXOffset, nYDBPos)
bIsFirstRun = True
- If nDBWidth &gt; nXTCWidth Then
+ If nDBWidth &gt; nTCWidth Then
CheckOuterPoints(nXDBPos, nDBWidth, nYDBPos, nDBHeight)
Else
CheckOuterPoints(nXDBPos, nTCWidth, nYDBPos, nDBHeight)
@@ -341,6 +350,11 @@ Dim ShapeCount as Integer
oLocDBShape.Size = GetSize(oLocDBShape.Size.Width + WidthFactor * CorrWidth, oLocDBShape.Size.Height)
End If
iLocTCPosX = oLocDBShape.Position.X + oLocDBShape.Size.Width + cHoriDistance
+ If CurArrangement = cTopJustified Then
+ If oLocTCShape.Size.Width &gt; oLocDBShape.Size.Width Then
+ iLocTCPosX = oLocDBShape.Position.X + oLocTCShape.Size.Width + cHoriDistance
+ End If
+ End If
Next i
End Sub
@@ -382,7 +396,7 @@ Dim nWidth as Long
ShapesToNirwana()
End If
oGridModel = CreateUnoService(oModelService(cGridControl))
-
+ oGridModel.Name = &quot;Grid1&quot;
nWidth = 0
For n = 0 to MaxIndex
CurFieldType = FieldMetaValues(n,0)
@@ -435,7 +449,7 @@ Dim iStandardColor as Long
End Sub
-Sub GroupShapes(oDrawPage as Object, TextShape as Object, DBShape as Object)
+Sub GroupShapes(oDrawPage as Object, oLocTextShape as Object, oLocDBShape as Object)
Dim oShapes as Object
oShapes = createUnoService(&quot;com.sun.star.drawing.ShapeCollection&quot;)
oShapes.Add(oLocTextShape)
diff --git a/wizards/source/formwizard/tools.xba b/wizards/source/formwizard/tools.xba
index 6b2d8fd572a2..2f5c96db43e4 100644
--- a/wizards/source/formwizard/tools.xba
+++ b/wizards/source/formwizard/tools.xba
@@ -1,7 +1,7 @@
<?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="tools" script:language="StarBasic">REM ***** BASIC *****
-
+Option Explicit
Function SetProgressValue(iValue as Integer)
If iValue = 0 Then
@@ -49,9 +49,8 @@ Dim aPeerSize as new com.sun.star.awt.Size
oControl = oController.GetControl(oModel)
oPeer = oControl.GetPeer()
If oControl.Model.PropertySetInfo.HasPropertybyName(&quot;EffectiveMax&quot;) Then
- oControl.Model.EffectiveDefault = oControl.Model.EffectiveMax
&apos; Todo: Remove this Hack due to Bug #88391
-&apos; oControl.Model.EffectiveValue = oControl.Model.EffectiveMax
+ oControl.Model.EffectiveValue = oControl.Model.EffectiveMax
aPeerSize = oPeer.PreferredSize()
ElseIf Not IsMissing(LocText) Then
oControl.Text = LocText
@@ -142,6 +141,7 @@ End Function
Sub RemoveShapes()
Dim n as Integer
Dim oControl as Object
+Dim oShape as Object
For n = oDrawPage.Count-1 To 0 Step -1
oShape = oDrawPage(n)
If oShape.Position.Y &gt; -2000 Then