#94903#Toggling and saving improved
This commit is contained in:
parent
9573e34faf
commit
9adb2bb8a9
8 changed files with 39 additions and 54 deletions
|
@ -10,9 +10,7 @@
|
|||
<script:event script:event-name="on-itemstatechange" script:location="application" script:macro-name="FormWizard.FormWizard.FormGetFields" script:language="StarBasic"/>
|
||||
</dlg:menulist>
|
||||
<dlg:img dlg:id="imgTheme" dlg:tab-index="3" dlg:left="6" dlg:top="6" dlg:width="258" dlg:height="26"/>
|
||||
<dlg:button dlg:id="cmdCancel" dlg:tab-index="4" dlg:left="6" dlg:top="190" dlg:width="53" dlg:height="14" dlg:help-url="HID:34401" dlg:value="cmdCancel">
|
||||
<script:event script:event-name="on-performaction" script:location="application" script:macro-name="FormWizard.FormWizard.CancelFormWizard" script:language="StarBasic"/>
|
||||
</dlg:button>
|
||||
<dlg:button dlg:id="cmdCancel" dlg:tab-index="4" dlg:left="6" dlg:top="190" dlg:width="53" dlg:height="14" dlg:help-url="HID:34401" dlg:value="cmdCancel" dlg:button-type="cancel"/>
|
||||
<dlg:button dlg:id="cmdHelp" dlg:tab-index="5" dlg:left="63" dlg:top="190" dlg:width="53" dlg:height="14" dlg:tag="34400" dlg:value="cmdHelp" dlg:button-type="help"/>
|
||||
<dlg:button dlg:id="cmdBack" dlg:tab-index="6" dlg:left="155" dlg:top="190" dlg:width="53" dlg:height="14" dlg:help-url="HID:34402" dlg:value="cmdBack">
|
||||
<script:event script:event-name="on-performaction" script:location="application" script:macro-name="FormWizard.FormWizard.PreviousStep" script:language="StarBasic"/>
|
||||
|
@ -83,7 +81,7 @@
|
|||
</dlg:radiogroup>
|
||||
<dlg:fixedline dlg:id="hlnBinaries" dlg:tab-index="29" dlg:left="6" dlg:top="158" dlg:width="258" dlg:height="8" dlg:page="1" dlg:value="hlnBinaries"/>
|
||||
<dlg:radiogroup>
|
||||
<dlg:radio dlg:id="optTiled" dlg:tab-index="30" dlg:left="156" dlg:top="154" dlg:width="81" dlg:height="10" dlg:page="2" dlg:tag="11" dlg:help-url="HID:34444" dlg:value="optTiled">
|
||||
<dlg:radio dlg:id="optTiled" dlg:tab-index="30" dlg:left="156" dlg:top="154" dlg:width="81" dlg:height="10" dlg:page="2" dlg:tag="11" dlg:help-url="HID:34444" dlg:value="optTiled" dlg:checked="true">
|
||||
<script:event script:event-name="on-mouseup" script:location="application" script:macro-name="WebWizard.Common.SetBackGraphicStyle" script:language="StarBasic"/>
|
||||
</dlg:radio>
|
||||
<dlg:radio dlg:id="optArea" dlg:tab-index="31" dlg:left="156" dlg:top="168" dlg:width="81" dlg:height="10" dlg:page="2" dlg:tag="10" dlg:help-url="HID:34445" dlg:value="optArea">
|
||||
|
@ -94,15 +92,14 @@
|
|||
<dlg:fixedline dlg:id="hlnAlign" dlg:tab-index="33" dlg:left="6" dlg:top="143" dlg:width="137" dlg:height="8" dlg:page="2" dlg:value="hlnAlign"/>
|
||||
<dlg:fixedline dlg:id="hlnBorderLayout" dlg:tab-index="34" dlg:left="6" dlg:top="83" dlg:width="137" dlg:height="8" dlg:page="2" dlg:value="hlnBorderLayout"/>
|
||||
<dlg:fixedline dlg:id="hlnArrangements" dlg:tab-index="35" dlg:left="6" dlg:top="39" dlg:width="137" dlg:height="8" dlg:page="2" dlg:value="hlnArrangements"/>
|
||||
<dlg:button dlg:id="CommandButton1" dlg:tab-index="36" dlg:left="-15" dlg:top="138" dlg:width="0" dlg:height="2" dlg:page="2" dlg:tag="1" dlg:value="CommandButton1"/>
|
||||
<dlg:radiogroup>
|
||||
<dlg:radio dlg:id="optAlign0" dlg:tab-index="37" dlg:left="12" dlg:top="154" dlg:width="131" dlg:height="10" dlg:page="2" dlg:help-url="HID:34441" dlg:value="optAlign0">
|
||||
<dlg:radio dlg:id="optAlign0" dlg:tab-index="36" dlg:left="12" dlg:top="154" dlg:width="131" dlg:height="10" dlg:page="2" dlg:help-url="HID:34441" dlg:value="optAlign0">
|
||||
<script:event script:event-name="on-performaction" script:location="application" script:macro-name="FormWizard.Layouter.ChangeLabelAlignments" script:language="StarBasic"/>
|
||||
</dlg:radio>
|
||||
<dlg:radio dlg:id="optAlign2" dlg:tab-index="38" dlg:left="12" dlg:top="168" dlg:width="131" dlg:height="10" dlg:page="2" dlg:help-url="HID:34442" dlg:value="optAlign2">
|
||||
<dlg:radio dlg:id="optAlign2" dlg:tab-index="37" dlg:left="12" dlg:top="168" dlg:width="131" dlg:height="10" dlg:page="2" dlg:help-url="HID:34442" dlg:value="optAlign2">
|
||||
<script:event script:event-name="on-performaction" script:location="application" script:macro-name="FormWizard.Layouter.ChangeLabelAlignments" script:language="StarBasic"/>
|
||||
</dlg:radio>
|
||||
</dlg:radiogroup>
|
||||
<dlg:fixedline dlg:id="FixedLine1" dlg:tab-index="39" dlg:left="6" dlg:top="180" dlg:width="258" dlg:height="6"/>
|
||||
<dlg:fixedline dlg:id="FixedLine1" dlg:tab-index="38" dlg:left="6" dlg:top="180" dlg:width="258" dlg:height="6"/>
|
||||
</dlg:bulletinboard>
|
||||
</dlg:window>
|
|
@ -90,6 +90,7 @@ Dim SelCount as Integer
|
|||
TexturePath = GetOfficeSubPath("Gallery", "www-back/")
|
||||
WorkPath = GetPathSettings("Work")
|
||||
OpenFormDocument()
|
||||
ToggleWindow(False)
|
||||
GetDatabaseNames()
|
||||
InitializeWidthList()
|
||||
LoadLanguage
|
||||
|
@ -126,7 +127,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
|
||||
|
@ -141,26 +142,25 @@ Dim SelCount as Integer
|
|||
' Scenario 1: No parameters are given
|
||||
ToggleListboxControls(oDialogModel, False)
|
||||
End If
|
||||
|
||||
DlgFormDB.Title = WizardTitle(1)
|
||||
NumberofStyles = FillupWebListbox(oUcb, "/stl", DlgFormDB, "lstStyles", Styles())
|
||||
ImportStyles()
|
||||
CurIndex = GetCurIndex(oDialogModel.lstStyles, Styles(), NumberofStyles,8)
|
||||
SetImportStyle()
|
||||
ConfigurePageStyle()
|
||||
ToggleWindow(True)
|
||||
oDialogModel.imgTheme.ImageURL = FormPath & "FormWizard_1.bmp"
|
||||
ToggleDatabasePage(True)
|
||||
DlgFormDB.GetControl("lstDatabases").SetFocus()
|
||||
oDialogModel.cmdGoOn.DefaultButton = True
|
||||
DlgFormDB.Execute()
|
||||
DlgFormDB.Dispose
|
||||
If Not IsNull(oDBConnection) Then
|
||||
oDBConnection.Dispose()
|
||||
End If
|
||||
If bDisposeDoc Then
|
||||
oDocument.Dispose
|
||||
oDocument.Dispose()
|
||||
End If
|
||||
WIZARDERROR:
|
||||
ShowErrorMessage(True)
|
||||
ToggleWindow(True)
|
||||
End Sub
|
||||
|
||||
|
||||
|
@ -203,10 +203,6 @@ NOFIELDS:
|
|||
End Sub
|
||||
|
||||
|
||||
Sub CancelFormWizard()
|
||||
DlgFormDB.EndExecute()
|
||||
End Sub
|
||||
|
||||
|
||||
Sub PreviousStep()
|
||||
If Not bDebug Then
|
||||
|
@ -227,13 +223,10 @@ End Sub
|
|||
|
||||
|
||||
Sub NextStep()
|
||||
Dim bOldVisible as Boolean
|
||||
If Not bDebug Then
|
||||
On Local Error GoTo WIZARDERROR
|
||||
End If
|
||||
|
||||
' Note: Unfortunately it is not possible to query the visibility of the imagecontrol directly
|
||||
bOldVisible = oDialogModel.Height > 40
|
||||
Select Case oDialogModel.Step
|
||||
Case 1
|
||||
bControlsAreCreated = Not (CBool(oDialogModel.lstSelFields.Tag))
|
||||
|
@ -251,7 +244,6 @@ Dim bOldVisible as Boolean
|
|||
Case 2
|
||||
StoreForm()
|
||||
End Select
|
||||
DlgFormDB.GetControl("imgTheme").Visible = bOldVisible
|
||||
oDialogModel.imgTheme.ImageUrl = FormPath & "FormWizard_" & oDialogModel.Step & ".bmp"
|
||||
DlgFormDB.Title = WizardTitle(oDialogModel.Step)
|
||||
WIZARDERROR:
|
||||
|
@ -260,11 +252,6 @@ End Sub
|
|||
|
||||
|
||||
Sub InitializeLayoutSettings()
|
||||
If oPageStyle.BackGraphicLocation = com.sun.star.style.GraphicLocation.TILED Then
|
||||
oDialogModel.optTiled.State = 1
|
||||
Else
|
||||
oDialogModel.optArea.State = 1
|
||||
End If
|
||||
SwitchArrangementButtons(cTabled)
|
||||
SwitchAlignMode(SBALIGNLEFT)
|
||||
SwitchBorderMode(SB3DBORDER)
|
||||
|
@ -305,7 +292,7 @@ Dim sBaseBookmarkName as String
|
|||
FilterNames(0,0) = oFilters.GetByName("swriter: StarOffice XML (Writer)").UIName
|
||||
FilterNames(0,1) = "*.sxw"
|
||||
FilterNames(0,2) = ""
|
||||
sTargetPath = StoreDocument(oDocument, FilterNames(), "Form_" & sDBName & "_" & TableName, WorkPath)
|
||||
sTargetPath = StoreDocument(oDocument, FilterNames(), "Form_" & sDBName & "_" & TableName & ".sxw", WorkPath)
|
||||
If sTargetPath <> "" Then
|
||||
sBookmarkName = GetFileNamewithoutExtension(FileNameoutofPath(sTargetPath))
|
||||
sBaseBookmarkName = sBookmarkName
|
||||
|
|
|
@ -27,9 +27,6 @@ Dim sMsgCreatedForm as String
|
|||
Dim sMsgErrCouldNotOpenObject as String
|
||||
Dim sMsgErrNameToLong as String
|
||||
|
||||
|
||||
Dim Form_ilFormTitleSuggestPrefix as String
|
||||
|
||||
Dim sTimeAppendix as String
|
||||
Dim sDateAppendix as String
|
||||
|
||||
|
@ -58,7 +55,6 @@ Sub LoadLanguage ()
|
|||
sMsgErrCouldNotOpenObject = GetResText (RID_COMMON + 13)
|
||||
|
||||
' Internal Logic
|
||||
Form_ilFormTitleSuggestPrefix = GetResText(RID_FORM + 3)
|
||||
sDateAppendix = GetResText(RID_FORM + 4)
|
||||
sTimeAppendix = GetResText(RID_FORM + 5)
|
||||
|
||||
|
@ -70,6 +66,7 @@ End Sub
|
|||
Sub SetDialogLanguage ()
|
||||
DlgFormDB = LoadDialog("FormWizard", "DlgFormDB")
|
||||
oDialogModel = DlgFormDB.Model
|
||||
|
||||
With oDialogModel
|
||||
.cmdCancel.Label = GetResText(RID_COMMON + 1)
|
||||
.cmdBack.Label = GetResText(RID_COMMON + 2)
|
||||
|
|
|
@ -172,7 +172,7 @@ Dim sLocText as String
|
|||
End If
|
||||
WIZARDERROR:
|
||||
ShowErrorMessage(True)
|
||||
oDocument.UnlockControllers
|
||||
oDocument.UnlockControllers()
|
||||
ToggleLayoutPage(True)
|
||||
End Sub
|
||||
|
||||
|
@ -184,7 +184,6 @@ Dim oModel as Object
|
|||
If Not bDebug Then
|
||||
On Local Error GoTo WIZARDERROR
|
||||
End If
|
||||
|
||||
oModel = oEvent.Source.Model
|
||||
SwitchAlignMode(Val(Right(oModel.Name,1)))
|
||||
ToggleLayoutPage(False)
|
||||
|
@ -203,7 +202,7 @@ Dim oModel as Object
|
|||
End If
|
||||
WIZARDERROR:
|
||||
ShowErrorMessage(True)
|
||||
oDocument.UnlockControllers(False)
|
||||
oDocument.UnlockControllers()
|
||||
ToggleLayoutPage(True)
|
||||
End Sub
|
||||
|
||||
|
@ -265,15 +264,16 @@ End Sub
|
|||
|
||||
|
||||
Sub ToggleLayoutPage(bDoEnable as Boolean, Optional FocusControlName as String)
|
||||
oDialogModel.Enabled = bDoEnable
|
||||
If Not IsMissing(FocusControlName) Then
|
||||
DlgFormDB.GetControl(FocusControlName).SetFocus()
|
||||
End If
|
||||
' Todo: Diese Zeile wieder reinnehmen und schauen, ob alles richtig getogglet wird.
|
||||
' oDialogModel.Enabled = bDoEnable
|
||||
If bDoEnable Then
|
||||
ToggleOptionButtons(oDialogModel,(bWithBackGraphic = True))
|
||||
ToggleAlignGroup(bDoEnable)
|
||||
ToggleBorderGroup(bDoEnable)
|
||||
End If
|
||||
If Not IsMissing(FocusControlName) Then
|
||||
DlgFormDB.GetControl(FocusControlName).SetFocus()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
@ -283,7 +283,7 @@ Dim oShape as Object
|
|||
For i = oDrawPage.Count-1 To 0 Step -1
|
||||
oShape = oDrawPage.GetByIndex(i)
|
||||
If oShape.ShapeType = "com.sun.star.drawing.ControlShape" Then
|
||||
oShape.Dispose
|
||||
oShape.Dispose()
|
||||
End If
|
||||
Next i
|
||||
End Sub
|
||||
|
|
|
@ -445,10 +445,9 @@ Dim n as Integer
|
|||
Dim oColumn as Object
|
||||
Dim aPoint as New com.sun.star.awt.Point
|
||||
Dim aSize as New com.sun.star.awt.Size
|
||||
oDocument.LockControllers()
|
||||
If bControlsareCreated Then
|
||||
oDocument.LockControllers()
|
||||
ShapesToNirwana()
|
||||
oDocument.UnlockControllers()
|
||||
End If
|
||||
oGridModel = CreateUnoService(oModelService(cGridControl))
|
||||
oGridModel.Name = "Grid1"
|
||||
|
@ -470,6 +469,7 @@ Dim aSize as New com.sun.star.awt.Size
|
|||
End If
|
||||
oProgressbar.Value = n
|
||||
next n
|
||||
oDocument.UnlockControllers()
|
||||
End Function
|
||||
|
||||
|
||||
|
|
|
@ -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>
|
||||
</library:library>
|
|
@ -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>
|
|
@ -140,7 +140,6 @@ End Function
|
|||
|
||||
Sub ImportStyles()
|
||||
Dim OldIndex as Integer
|
||||
Dim sImportPath as String
|
||||
If Not bDebug Then
|
||||
On Local Error GoTo WIZARDERROR
|
||||
End If
|
||||
|
@ -149,19 +148,24 @@ Dim sImportPath as String
|
|||
If CurIndex <> OldIndex Then
|
||||
ToggleLayoutPage(False)
|
||||
oDocument.LockControllers
|
||||
sImportPath = Styles(8,CurIndex)
|
||||
bWithBackGraphic = LoadNewStyles(oDocument, oDialogModel, CurIndex, sImportPath, Styles(), TexturePath)
|
||||
ControlCaptionsToStandardLayout()
|
||||
SetImportStyle()
|
||||
ToggleOptionButtons(oDialogModel, bWithBackGraphic)
|
||||
ConfigurePageStyle()
|
||||
ToggleLayoutPage(True, "lstStyles")
|
||||
oDocument.UnlockControllers
|
||||
oDocument.UnlockControllers()
|
||||
End If
|
||||
WIZARDERROR:
|
||||
ShowErrorMessage(True)
|
||||
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
|
||||
Select Case iLocFieldType
|
||||
Case com.sun.star.sdbc.DataType.BIGINT
|
||||
|
@ -278,9 +282,9 @@ Sub ShowErrorMessage(bEndExecute as Boolean)
|
|||
ToggleWindow(True)
|
||||
Resume LOCERROR
|
||||
LOCERROR:
|
||||
On Local Error Goto 0
|
||||
If bEndExecute Then
|
||||
DlgFormDB.EndExecute()
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
</script:module>
|
||||
End Sub</script:module>
|
Loading…
Reference in a new issue