diff options
author | Behrend Cornelius <bc@openoffice.org> | 2001-11-02 10:18:29 +0000 |
---|---|---|
committer | Behrend Cornelius <bc@openoffice.org> | 2001-11-02 10:18:29 +0000 |
commit | 958eeb74445145d947172ba1d8e3844aef1bff53 (patch) | |
tree | 06dff273f16b7c970b4ca6ec2d5e83e53c7c109b /wizards/source/webwizard/HtmlAutoPilotBasic.xba | |
parent | 1113c19b1313535c4dcc6d4fd1f445be362c2e4d (diff) |
92814# Now whole dialog instead of controls toggled
Diffstat (limited to 'wizards/source/webwizard/HtmlAutoPilotBasic.xba')
-rw-r--r-- | wizards/source/webwizard/HtmlAutoPilotBasic.xba | 133 |
1 files changed, 66 insertions, 67 deletions
diff --git a/wizards/source/webwizard/HtmlAutoPilotBasic.xba b/wizards/source/webwizard/HtmlAutoPilotBasic.xba index 14b4c6c9b..4aedd41f3 100644 --- a/wizards/source/webwizard/HtmlAutoPilotBasic.xba +++ b/wizards/source/webwizard/HtmlAutoPilotBasic.xba @@ -3,6 +3,9 @@ <script:module xmlns:script="http://openoffice.org/2000/script" script:name="HtmlAutoPilotBasic" script:language="StarBasic">' Variables must be declared Option Explicit +Public CurDocIndex as Integer +Public CurWebPageIndex as Integer + Public bWithBackGraphic as Boolean Public oStyle as Object @@ -44,6 +47,7 @@ Public DialogModel as Object Sub Main +Dim RetValue 'On Local Error Goto GlobalErrorHandler Dim SOBitmapPath,sBitmapPath as String BasicLibraries.LoadLibrary("Tools") @@ -78,9 +82,17 @@ Sub Main sBitmapPath = SOBitmapPath & "webwizard.bmp" DialogModel.ImagePreview.ImageURL = sBitmapPath ToggleOptionButtons(DialogModel, bWithBackGraphic) - MainDialog.GetControl("lbTemplate").SetFocus = True + MainDialog.GetControl("lbTemplate").SetFocus() DialogModel.cbGoOn.DefaultButton = True - MainDialog.Execute + RetValue = MainDialog.Execute + Select Case RetValue + Case 0 + MainDialog.Dispose() + oBaseDocument.Dispose() + Case 1 + EndDialog() + MainDialog.Dispose() + End Select GLOBALERRORHANDLER: If Err <> 0 Then MsgBox (WebWiz_gErrMsg$, 16, WebWiz_gWizardName$) @@ -99,53 +111,57 @@ End Function Sub ReloadCurrentDocument() -Dim CurInd as Integer -'On Local Error Goto ErrorOcurred -' Todo:Check if the pointer is really disabled, when set to Hourglass - ToggleDialogControls(False) +Dim OldDocIndex as Integer +On Local Error Goto ErrorOcurred oBaseDocument.LockControllers - ' Get selected list entry and corresponding file name - CurInd = GetCurIndex(DialogModel.lbTemplate, Layout(), NumberofLayouts%, 2) - oCursor = oBaseDocument.Text.CreateTextCursor() - oCursor.GotoStart(False) - oCursor.GotoEnd(True) - oCursor.SetPropertyToDefault("CharHeight") - oCursor.InsertDocumentfromURL(FileStr, NoArgs()) - SetBulletAndGraphics - CheckControls(oBaseDocument.DrawPage) -ErrorOcurred: - If Err <> 0 Then - MsgBox(WebWiz_gErrWhileReloading$, 16, WebWiz_gWizardName$) - End If - oBaseDocument.UnlockControllers - oViewCursor.GotoStart(False) + OldDocIndex = CurDocIndex + CurDocIndex = GetCurIndex(DialogModel.lbTemplate, Layout(), NumberofLayouts%, 2) + If OldDocIndex <> CurDocIndex Then + ToggleDialogControls(False) + oCursor = oBaseDocument.Text.CreateTextCursor() + oCursor.GotoStart(False) + oCursor.GotoEnd(True) + oCursor.SetPropertyToDefault("CharHeight") + oCursor.InsertDocumentfromURL(FileStr, NoArgs()) + SetBulletAndGraphics + CheckControls(oBaseDocument.DrawPage) + ErrorOcurred: + If Err <> 0 Then + MsgBox(WebWiz_gErrWhileReloading$, 16, WebWiz_gWizardName$) + End If + oBaseDocument.UnlockControllers + oViewCursor.GotoStart(False) ToggleDialogControls(True, "lbTemplate") + End If End Sub Sub LoadWebPageStyles() -Dim CurIndex as Integer - ToggleDialogControls(False) - oBaseDocument.LockControllers - CurIndex = GetCurIndex(DialogModel.lbStyles, Style(), NumberofStyles%,8) - bWithBackGraphic = LoadNewStyles(oBaseDocument, DialogModel, CurIndex, FileStr, Style(), TextureDir) - CurrentBullet$ = BulletDir + Style(6, CurIndex) - CurrentPrev$ = GraphicsDir + Style(2, CurIndex) - CurrentNext$ = GraphicsDir + Style(3, CurIndex) - CurrentHome$ = GraphicsDir + Style(4, CurIndex) - CurrentTop$ = GraphicsDir + Style(5, CurIndex) - With oBaseDocument.DocumentInfo - .GetUserFieldValue(0) = ExtractGraphicNames(CurIndex,2) - .GetUserFieldValue(1) = ExtractGraphicNames(CurIndex, 4) - .GetUserFieldValue(2) = Style(6, CurIndex) ' Bullet - .GetUserFieldValue(3) = Style(7, CurIndex) ' Background - End With - SetBulletAndGraphics() - CheckControls(oBaseDocument.DrawPage) - oViewCursor.GotoStart(False) - oBaseDocument.UnlockControllers - ToggleDialogControls(True, "lbStyles") +Dim OldWebPageIndex as Integer + OldWebPageIndex = CurWebPageIndex + CurWebPageIndex = GetCurIndex(DialogModel.lbStyles, Style(), NumberofStyles%,8) + If OldWebPageIndex <> CurWebPageIndex Then + ToggleDialogControls(False) + oBaseDocument.LockControllers + bWithBackGraphic = LoadNewStyles(oBaseDocument, DialogModel, CurWebPageIndex, FileStr, Style(), TextureDir) + CurrentBullet$ = BulletDir + Style(6, CurWebPageIndex) + CurrentPrev$ = GraphicsDir + Style(2, CurWebPageIndex) + CurrentNext$ = GraphicsDir + Style(3, CurWebPageIndex) + CurrentHome$ = GraphicsDir + Style(4, CurWebPageIndex) + CurrentTop$ = GraphicsDir + Style(5, CurWebPageIndex) + With oBaseDocument.DocumentInfo + .GetUserFieldValue(0) = ExtractGraphicNames(CurWebPageIndex,2) + .GetUserFieldValue(1) = ExtractGraphicNames(CurWebPageIndex, 4) + .GetUserFieldValue(2) = Style(6, CurWebPageIndex) ' Bullet + .GetUserFieldValue(3) = Style(7, CurWebPageIndex) ' Background + End With + SetBulletAndGraphics() + CheckControls(oBaseDocument.DrawPage) + oViewCursor.GotoStart(False) + oBaseDocument.UnlockControllers + ToggleDialogControls(True, "lbStyles") + End If End Sub @@ -192,15 +208,7 @@ Sub EndDialog() Else SetEvent() End If - MainDialog.EndExecute() - MainDialog.Dispose() -End Sub - - -Sub CancelHTMLWizard() - MainDialog.EndExecute() - MainDialog.Dispose() - oBaseDocument.Dispose() +' MainDialog.EndExecute() End Sub @@ -392,24 +400,15 @@ Dim Bitmap As Object Dim sBitmapPath as String sBitmapPath = SOBitmapPath & "webwizard.bmp" WebWzrd.ImagePreview.ImageURL = sBitmapPath -End Sub +End Sub Sub ToggleDialogControls(ByVal bDoEnable as Boolean, Optional FocusControlName as String) - With DialogModel - .cbCancel.Enabled = bDoEnable - .cbGoOn.Enabled = bDoEnable - .cbHelp.Enabled = bDoEnable - .lblTemplate.Enabled = bDoEnable - .lblStyle.Enabled = bDoEnable - .chkSaveasTemplate.Enabled = bDoEnable - .lbTemplate.Enabled = bDoEnable - .lbStyles.Enabled = bDoEnable - If bDoEnable Then - ' Enable Controls referring to Background graphic only when this Property is set - bDoEnable = bWithBackGraphic - MainDialog.GetControl(FocusControlName).SetFocus = True - End If + DialogModel.Enabled = bDoEnable + If bDoEnable Then + ' Enable Controls referring to Background graphic only when this Property is set + bDoEnable = bWithBackGraphic ToggleOptionButtons(DialogModel, bDoEnable) - End With + MainDialog.GetControl(FocusControlName).SetFocus() + End If End Sub</script:module>
\ No newline at end of file |