summaryrefslogtreecommitdiff
path: root/wizards
diff options
context:
space:
mode:
authorBehrend Cornelius <bc@openoffice.org>2002-07-10 14:32:07 +0000
committerBehrend Cornelius <bc@openoffice.org>2002-07-10 14:32:07 +0000
commit0c5108d047eaf8054492fa65133e6c708ffaa055 (patch)
treee07ce4181642cc67838e4ea6a3f32efff812db26 /wizards
parentd7ac1dd77234eb241e5867f4313c21aa4f21823d (diff)
#100987# dialog now created later
Diffstat (limited to 'wizards')
-rw-r--r--wizards/source/formwizard/DBMeta.xba32
-rw-r--r--wizards/source/formwizard/FormWizard.xba74
-rw-r--r--wizards/source/formwizard/Language.xba7
-rw-r--r--wizards/source/formwizard/Layouter.xba12
-rw-r--r--wizards/source/formwizard/develop.xba3
-rw-r--r--wizards/source/formwizard/dialog.xlb2
-rw-r--r--wizards/source/formwizard/script.xlb4
-rw-r--r--wizards/source/formwizard/tools.xba14
8 files changed, 74 insertions, 74 deletions
diff --git a/wizards/source/formwizard/DBMeta.xba b/wizards/source/formwizard/DBMeta.xba
index 346e7a1d9180..8f8859942aa3 100644
--- a/wizards/source/formwizard/DBMeta.xba
+++ b/wizards/source/formwizard/DBMeta.xba
@@ -20,13 +20,13 @@ End Sub
Sub GetSelectedDBMetaData()
Dim OldsDBname as String
Dim DBIndex as Integer
- If Ubound(oDialogModel.lstDatabases.SelectedItems()) &gt; -1 Then
+ If Ubound(DialogModel.lstDatabases.SelectedItems()) &gt; -1 Then
ToggleDatabasePage(False)
- DBIndex = oDialogModel.lstDatabases.SelectedItems(0)
+ DBIndex = DialogModel.lstDatabases.SelectedItems(0)
sDBName = sDatabaseList(DBIndex)
If GetConnection(sDBName) Then
If GetDBMetaData() Then
- With oDialogModel
+ With DialogModel
.lstTables.Enabled = True
.lblTables.Enabled = True
.lstTables.StringItemList() = AddListToList(TableNames(), QueryNames())
@@ -78,10 +78,10 @@ Dim Nulllist()
Loop Until bExitLoop
On Local Error Goto 0
If Not bGetConnection Then
- oDialogModel.lstDatabases.SelectedItems() = Nulllist()
- oDialogModel.lstTables.StringItemList() = NullList()
- oDialogModel.lstFields.StringItemList() = NullList()
- oDialogModel.lstSelFields.StringItemList() = NullList()
+ DialogModel.lstDatabases.SelectedItems() = Nulllist()
+ DialogModel.lstTables.StringItemList() = NullList()
+ DialogModel.lstFields.StringItemList() = NullList()
+ DialogModel.lstSelFields.StringItemList() = NullList()
End If
GetConnection() = bGetConnection
End If
@@ -109,9 +109,9 @@ Dim sFieldName as String
Dim n as Integer
Dim WidthIndex as Integer
Dim oField as Object
- MaxIndex = Ubound(oDialogModel.lstSelFields.StringItemList())
+ MaxIndex = Ubound(DialogModel.lstSelFields.StringItemList())
Dim ColumnMap(MaxIndex)as Integer
- FieldNames() = oDialogModel.lstSelFields.StringItemList()
+ FieldNames() = DialogModel.lstSelFields.StringItemList()
&apos; Build a structure which maps the position of a selected field (within the selection) to the the column position within
&apos; 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())
@@ -165,7 +165,7 @@ Dim iType as Integer
Dim oField as Object
Dim MaxIndex as Integer
Dim EmptyList()
- If Ubound(oDialogModel.lstTables.StringItemList()) &gt; -1 Then
+ If Ubound(DialogModel.lstTables.StringItemList()) &gt; -1 Then
FieldNames() = oColumns.GetElementNames()
MaxIndex = Ubound(FieldNames())
If MaxIndex &lt;&gt; -1 Then
@@ -193,8 +193,8 @@ Dim EmptyList()
Redim Preserve ResultFieldNames(m-1)
Redim Preserve FieldNames(m-1)
FieldNames() = ResultFieldNames()
- oDialogModel.lstFields.StringItemList = FieldNames()
- InitializeListboxProcedures(oDialogModel, oDialogModel.lstFields, oDialogModel.lstSelFields)
+ DialogModel.lstFields.StringItemList = FieldNames()
+ InitializeListboxProcedures(DialogModel, DialogModel.lstFields, DialogModel.lstSelFields)
End If
GetSpecificFieldNames = MaxIndex
Else
@@ -227,7 +227,7 @@ Dim m as Integer
If Not bDebug Then
On Local Error GoTo WIZARDERROR
End If
- If oDialogModel.optBinariesasGraphics.State = 1 Then
+ If DialogModel.optBinariesasGraphics.State = 1 Then
OldMaxIndex = Ubound(WidthList(),1)
If OldMaxIndex = 15 Then
MaxIndex = Ubound(WidthList(),1) + Ubound(ImgWidthList(),1) + 1
@@ -239,13 +239,13 @@ Dim m as Integer
Next m
s = s + 1
Next n
- MergeList(oDialogModel.lstFields, ImgFieldNames())
+ MergeList(DialogModel.lstFields, ImgFieldNames())
End If
Else
ReDim Preserve WidthList(15, 4)
- RemoveListItems(oDialogModel.lstFields(), oDialogModel.lstSelFields(), ImgFieldNames())
+ RemoveListItems(DialogModel.lstFields(), DialogModel.lstSelFields(), ImgFieldNames())
End If
- oDialogModel.lstSelFields.Tag = True
+ DialogModel.lstSelFields.Tag = True
WIZARDERROR:
If Err &lt;&gt; 0 Then
Msgbox(sMsgErrMsg, 16, GetProductName())
diff --git a/wizards/source/formwizard/FormWizard.xba b/wizards/source/formwizard/FormWizard.xba
index 36048a591ccf..ecd888a770b3 100644
--- a/wizards/source/formwizard/FormWizard.xba
+++ b/wizards/source/formwizard/FormWizard.xba
@@ -9,7 +9,6 @@ Public WebWizardPath as String
Public WorkPath as String
Public TexturePath as String
Public sQueryName as String
-Public NumberofStyles as Integer
Public oDBConnection as Object
Public bWithBackGraphic as Boolean
Public bNeedFieldRefresh as Boolean
@@ -63,6 +62,8 @@ Sub MainWithDefault(Optional DatasourceName as String, Optional oConnection as O
Dim i as Integer
Dim SelCount as Integer
Dim RetValue as Integer
+Dim SelList(0) as Integer
+ SelList(0) = 0
BasicLibraries.LoadLibrary(&quot;Tools&quot;)
BasicLibraries.LoadLibrary(&quot;WebWizard&quot;)
bDebug = False
@@ -91,11 +92,17 @@ Dim RetValue as Integer
oProgressBar.Value = 10
InitializeWidthList()
oProgressBar.Value = 20
- LoadLanguage
- InitializeLabelValues()
+ LoadLanguage()
oProgressBar.Value = 30
+ Styles() = getListBoxArrays(oUcb, &quot;/stl&quot;)
+ CurIndex = GetCurIndex(DialogModel, Styles(), 2)
+ oProgressBar.Value = 40
+ ConfigurePageStyle()
+ oProgressBar.Value = 50
+ InitializeLabelValues()
bNeedFieldRefresh = True
- With oDialogModel
+ SetDialogLanguage()
+ With DialogModel
.cmdBack.Enabled = False
.cmdGoOn.Enabled = False
.lblTables.Enabled = False
@@ -103,6 +110,7 @@ Dim RetValue as Integer
.Step = 1
.lstDatabases.StringItemList()= sDatabaseList()&apos; = AddItem(sDatabaseList(i)
End With
+ oProgressBar.Value = 60
If Not IsMissing(DataSourceName) Then
sDBName = DataSourceName
DlgFormDB.GetControl(&quot;lstDatabases&quot;).SelectItem(DataSourceName, True)
@@ -110,15 +118,15 @@ Dim RetValue as Integer
&apos; 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
+ DialogModel.lstTables.Enabled = True
+ DialogModel.lblTables.Enabled = True
If GetDBMetaData() Then
- oDialogModel.lstTables.StringItemList() = AddListToList(TableNames(), QueryNames())
+ DialogModel.lstTables.StringItemList() = AddListToList(TableNames(), QueryNames())
iCommandTypes = CreateCommandTypeList()
If Not IsMissing(sContent) Then
&apos; Scenario 4: all parameters (data source name, connection, object type and object) are given
iCommandTypes() = CreateCommandTypeList()
- SelCount = CountItemsInArray(oDialogModel.lstTables.StringItemList(), sContent)
+ SelCount = CountItemsInArray(DialogModel.lstTables.StringItemList(), sContent)
If SelCount = 1 Then
DlgFormDB.GetControl(&quot;lstTables&quot;).SelectItem(sContent, True)
Else
@@ -140,20 +148,18 @@ Dim RetValue as Integer
End If
Else
&apos; Scenario 1: No parameters are given
- ToggleListboxControls(oDialogModel, False)
+ ToggleListboxControls(DialogModel, False)
End If
- oProgressBar.Value = 50
- DlgFormDB.Title = WizardTitle(1)
- NumberofStyles = FillupWebListbox(oUcb, &quot;/stl&quot;, DlgFormDB, &quot;lstStyles&quot;, Styles())
- oProgressBar.Value = 60
- CurIndex = GetCurIndex(oDialogModel.lstStyles, Styles(), NumberofStyles,8)
- SetImportStyle()
- oProgressBar.Value = 70
- ConfigurePageStyle()
oProgressBar.Value = 80
+ bWithBackGraphic = LoadNewStyles(oDocument, DialogModel, CurIndex, Styles(CurIndex, 8), Styles(), TexturePath)
+ DlgFormDB.Title = WizardTitle(1)
+ DialogModel.lstStyles.StringItemList() = ArrayfromMultiArray(Styles, 1)
+ DialogModel.lstStyles.SelectedItems() = SelList()
+ ControlCaptionsToStandardLayout()
+
oDocument.GetCurrentController().Frame.ComponentWindow.Enable = True
oProgressBar.Value = 90
- oDialogModel.imgTheme.ImageURL = FormPath &amp; &quot;FormWizard_1.bmp&quot;
+ DialogModel.imgTheme.ImageURL = FormPath &amp; &quot;FormWizard_1.bmp&quot;
ToggleDatabasePage(True)
oProgressBar.Value = 100
DlgFormDB.GetControl(&quot;lstDatabases&quot;).SetFocus()
@@ -192,9 +198,9 @@ Dim QueryIndex as Integer
If Not bDebug Then
On Local Error GoTo NOFIELDS
End If
- n = Ubound(oDialogModel.lstTables.SelectedItems())
+ n = Ubound(DialogModel.lstTables.SelectedItems())
If n &gt; -1 Then
- SelIndex = oDialogModel.lstTables.SelectedItems(0)
+ SelIndex = DialogModel.lstTables.SelectedItems(0)
If bGetCommandType Then
CurCommandType = iCommandTypes(SelIndex)
End If
@@ -207,7 +213,7 @@ Dim QueryIndex as Integer
oColumns = oDBConnection.Tables.GetByName(Tablename).Columns
End If
If GetSpecificFieldNames() &lt;&gt; -1 Then
- ToggleListboxControls(oDialogModel, True)
+ ToggleListboxControls(DialogModel, True)
Else
EmptyFieldsListboxes()
End If
@@ -225,7 +231,7 @@ Sub PreviousStep()
If Not bDebug Then
On Local Error GoTo WIZARDERROR
End If
- With oDialogModel
+ With DialogModel
.Step = 1
.cmdBack.Enabled = False
.cmdGoOn.Enabled = True
@@ -247,9 +253,9 @@ Sub NextStep()
If Not bDebug Then
On Local Error GoTo WIZARDERROR
End If
- Select Case oDialogModel.Step
+ Select Case DialogModel.Step
Case 1
- bControlsAreCreated = Not (cBool(oDialogModel.lstSelFields.Tag))
+ bControlsAreCreated = Not (cBool(DialogModel.lstSelFields.Tag))
If Not bControlsAreCreated Then
GetTableMetaData()
CreateDBForm()
@@ -257,15 +263,15 @@ Sub NextStep()
InitializeLayoutSettings()
oDBForm.Load
End If
- oDialogModel.cmdGoOn.Label = sReady
- oDialogModel.cmdBack.Enabled = True
- oDialogModel.Step = 2
+ DialogModel.cmdGoOn.Label = sReady
+ DialogModel.cmdBack.Enabled = True
+ DialogModel.Step = 2
bDisposeDoc = False
Case 2
StoreForm()
End Select
- oDialogModel.imgTheme.ImageUrl = FormPath &amp; &quot;FormWizard_&quot; &amp; oDialogModel.Step &amp; &quot;.bmp&quot;
- DlgFormDB.Title = WizardTitle(oDialogModel.Step)
+ DialogModel.imgTheme.ImageUrl = FormPath &amp; &quot;FormWizard_&quot; &amp; DialogModel.Step &amp; &quot;.bmp&quot;
+ DlgFormDB.Title = WizardTitle(DialogModel.Step)
WIZARDERROR:
If Err &lt;&gt; 0 Then
Msgbox(sMsgErrMsg, 16, GetProductName())
@@ -289,10 +295,10 @@ End Sub
Sub ToggleDatabasePage(bDoEnable as Boolean)
- With oDialogModel
+ With DialogModel
.cmdBack.Enabled = False
.cmdHelp.Enabled = bDoEnable
- .cmdGoOn.Enabled = Ubound(oDialogModel.lstSelFields.StringItemList()) &lt;&gt; -1
+ .cmdGoOn.Enabled = Ubound(DialogModel.lstSelFields.StringItemList()) &lt;&gt; -1
.hlnBinaries.Enabled = ((bDoEnable = True) And (bEnableBinaryOptionGroup = True))
.optIgnoreBinaries.Enabled = ((bDoEnable = True) And (bEnableBinaryOptionGroup = True))
.optBinariesasGraphics.Enabled = ((bDoEnable = True) And (bEnableBinaryOptionGroup = True))
@@ -346,9 +352,9 @@ End Sub
Sub EmptyFieldsListboxes()
Dim NullList() as String
- ToggleListboxControls(oDialogModel, False)
- oDialogModel.lstFields.StringItemList() = NullList()
- oDialogModel.lstSelFields.StringItemList() = NullList()
+ ToggleListboxControls(DialogModel, False)
+ DialogModel.lstFields.StringItemList() = NullList()
+ DialogModel.lstSelFields.StringItemList() = NullList()
bEnableBinaryOptionGroup = False
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 0a9ca054e988..853e35541eec 100644
--- a/wizards/source/formwizard/Language.xba
+++ b/wizards/source/formwizard/Language.xba
@@ -13,7 +13,7 @@ Public BasicLabelDiffHeight as Long
Public WizardTitle(1 To 3) as String
Public DlgFormDB as Object
-Public oDialogModel as Object
+Public DialogModel as Object
Dim sMsgWizardName as String
Dim sMsgErrMsg as String
@@ -57,17 +57,16 @@ Sub LoadLanguage ()
sTimeAppendix = GetResText(RID_FORM + 5)
sReady = GetResText(RID_COMMON + 0)
- SetDialogLanguage()
End Sub
Sub SetDialogLanguage ()
DlgFormDB = LoadDialog(&quot;FormWizard&quot;, &quot;DlgFormDB&quot;)
- oDialogModel = DlgFormDB.Model
+ DialogModel = DlgFormDB.Model
Dim FNameAddOn as String
- With oDialogModel
+ With DialogModel
.cmdCancel.Label = GetResText(RID_COMMON + 1)
.cmdBack.Label = GetResText(RID_COMMON + 2)
.cmdHelp.Label = GetResText(RID_COMMON + 20)
diff --git a/wizards/source/formwizard/Layouter.xba b/wizards/source/formwizard/Layouter.xba
index add3b0068ac2..994fd0b0bcd3 100644
--- a/wizards/source/formwizard/Layouter.xba
+++ b/wizards/source/formwizard/Layouter.xba
@@ -66,7 +66,7 @@ Public Const cCurrencyBox = 7
Public Const cGridControl = 8
Public Const cImageControl = 9
-Public Styles(8, 50) as String
+Public Styles(50, 8) as String
Public CurControlType as Integer
Public CurFieldlength as Double
@@ -289,7 +289,7 @@ Dim oModel as Object
ToggleAlignGroup(CurArrangement = cColumnarLeft)
If CurArrangement = cColumnarTop Then
If CurAlignMode = com.sun.star.awt.TextAlign.RIGHT Then
- oDialogModel.optAlign0.State = 1
+ DialogModel.optAlign0.State = 1
CurAlignMode = com.sun.star.awt.TextAlign.LEFT
OldAlignMode = com.sun.star.awt.TextAlign.RIGHT
End If
@@ -308,7 +308,7 @@ End Sub
Sub ToggleBorderGroup(bDoEnable as Boolean)
- With oDialogModel
+ With DialogModel
.hlnBorderLayout.Enabled = bDoEnable
.optBorder0.Enabled = bDoEnable &apos; 0: No border
.optBorder1.Enabled = bDoEnable &apos; 1: 3D border
@@ -318,7 +318,7 @@ End Sub
Sub ToggleAlignGroup(ByVal bDoEnable as Boolean)
- With oDialogModel
+ With DialogModel
If bDoEnable Then
bDoEnable = CurArrangement = cColumnarLeft
End If
@@ -330,12 +330,12 @@ End Sub
Sub ToggleLayoutPage(bDoEnable as Boolean, Optional FocusControlName as String)
- oDialogModel.Enabled = bDoEnable
+ DialogModel.Enabled = bDoEnable
If bDoEnable Then
If Not bDebug Then
oDocument.UnlockControllers()
End If
- ToggleOptionButtons(oDialogModel,(bWithBackGraphic = True))
+ ToggleOptionButtons(DialogModel,(bWithBackGraphic = True))
ToggleAlignGroup(bDoEnable)
ToggleBorderGroup(bDoEnable)
Else
diff --git a/wizards/source/formwizard/develop.xba b/wizards/source/formwizard/develop.xba
index 0fc8de89802f..5f9169dbfca6 100644
--- a/wizards/source/formwizard/develop.xba
+++ b/wizards/source/formwizard/develop.xba
@@ -31,7 +31,7 @@ Dim i as Integer
nMaxRowY = 0
nSecMaxRowY = 0
If CurArrangement = cLeftJustified Or cTopJustified Then
- oDialogModel.optAlign0.State = 1
+ DialogModel.optAlign0.State = 1
End If
For i = 0 To MaxIndex
GetCurrentMetaValues(i)
@@ -104,7 +104,6 @@ Dim i as Integer
aSize = GetSize(nMaxTCWidth, nTCHeight)
bIsFirstRun = True
For i = StartA To LastIndex
- oLocTextShape.Size = aSize
If i = StartA Then
nXTCPos = oTCShapeList(i).Position.X
nXDBPos = nXTCPos + nMaxTCWidth + cHoriDistance
diff --git a/wizards/source/formwizard/dialog.xlb b/wizards/source/formwizard/dialog.xlb
index d680f29292e8..b830134b0cc2 100644
--- a/wizards/source/formwizard/dialog.xlb
+++ b/wizards/source/formwizard/dialog.xlb
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
-<library:library xmlns:library="http://openoffice.org/2000/library" library:name="FormWizard" library:readonly="true" library:passwordprotected="false">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="FormWizard" library:readonly="false" library:passwordprotected="false">
<library:element library:name="DlgFormDB"/>
</library:library>
diff --git a/wizards/source/formwizard/script.xlb b/wizards/source/formwizard/script.xlb
index 0b79b7f078ba..abb47d8a7061 100644
--- a/wizards/source/formwizard/script.xlb
+++ b/wizards/source/formwizard/script.xlb
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
-<library:library xmlns:library="http://openoffice.org/2000/library" library:name="FormWizard" library:readonly="true" library:passwordprotected="false">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="FormWizard" library:readonly="false" library:passwordprotected="false">
<library:element library:name="FormWizard"/>
<library:element library:name="Layouter"/>
<library:element library:name="Language"/>
<library:element library:name="DBMeta"/>
<library:element library:name="tools"/>
<library:element library:name="develop"/>
-</library:library>
+</library:library> \ No newline at end of file
diff --git a/wizards/source/formwizard/tools.xba b/wizards/source/formwizard/tools.xba
index e3df429b8f84..f17afe61f49f 100644
--- a/wizards/source/formwizard/tools.xba
+++ b/wizards/source/formwizard/tools.xba
@@ -142,10 +142,13 @@ Dim OldIndex as Integer
On Local Error GoTo WIZARDERROR
End If
OldIndex = CurIndex
- CurIndex = GetCurIndex(oDialogModel.lstStyles, Styles(), NumberofStyles,8)
+ CurIndex = GetCurIndex(DialogModel.lstStyles, Styles(),8)
If CurIndex &lt;&gt; OldIndex Then
ToggleLayoutPage(False)
- SetImportStyle()
+ Dim sImportPath as String
+ sImportPath = Styles(CurIndex, 8)
+ bWithBackGraphic = LoadNewStyles(oDocument, DialogModel, CurIndex, sImportPath, Styles(), TexturePath)
+ ControlCaptionsToStandardLayout()
ToggleLayoutPage(True, &quot;lstStyles&quot;)
End If
WIZARDERROR:
@@ -157,13 +160,6 @@ WIZARDERROR:
End Sub
-Sub SetImportStyle()
-Dim sImportPath as String
- sImportPath = Styles(8,CurIndex)
- bWithBackGraphic = LoadNewStyles(oDocument, oDialogModel, CurIndex, sImportPath, Styles(), TexturePath)
- ControlCaptionsToStandardLayout()
-End Sub
-
Function SetNumerics(ByVal oLocObject as Object, iLocFieldType as Integer) as Object
&apos; Msgbox CurFieldName &amp; &quot;:&quot; &amp; chr(13) &amp; oLocObject.dbg_Properties