diff options
author | Behrend Cornelius <bc@openoffice.org> | 2002-11-27 14:33:34 +0000 |
---|---|---|
committer | Behrend Cornelius <bc@openoffice.org> | 2002-11-27 14:33:34 +0000 |
commit | c6f392c64b1d3cda31e08dbe15862b6c4ea858cd (patch) | |
tree | 72431aade403437fe7b1e97819a164b30945fa7a /wizards/source/tools/ModuleControls.xba | |
parent | 6da26523364dc0f1f00f025db93996888ac89cc9 (diff) |
#105421# Overwrite Dialog added
Diffstat (limited to 'wizards/source/tools/ModuleControls.xba')
-rw-r--r-- | wizards/source/tools/ModuleControls.xba | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/wizards/source/tools/ModuleControls.xba b/wizards/source/tools/ModuleControls.xba index 37a5e23204ab..a94f0a9977af 100644 --- a/wizards/source/tools/ModuleControls.xba +++ b/wizards/source/tools/ModuleControls.xba @@ -2,6 +2,16 @@ <!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> <script:module xmlns:script="http://openoffice.org/2000/script" script:name="ModuleControls" script:language="StarBasic">Option Explicit +Public DlgOverwrite as Object +Public Const SBOVERWRITEUNDEFINED as Integer = 0 +Public Const SBOVERWRITECANCEL as Integer = 2 +Public Const SBOVERWRITEQUERY as Integer = 7 +Public Const SBOVERWRITEALWAYS as Integer = 6 +Public Const SBOVERWRITENEVER as Integer = 8 +Public iGeneralOverwrite as Integer + + + ' Accepts the name of a control and returns the respective control model as object ' The Container can either be a whole document or a specific sheet of a Calc-Document ' 'CName' is the name of the Control @@ -297,4 +307,43 @@ Dim oWindowPointer as Object oWindowPointer.SetType(com.sun.star.awt.SystemPointer.WAIT) End If oWindowPeer.SetPointer(oWindowPointer) +End Sub + + +Sub ShowOverwriteAllDialog(FilePath as String, sTitle as String) +Dim QueryString as String +Dim LocRetValue as Integer + If InitResources("", "com") Then + DlgOverwrite = LoadDialog("Tools", "DlgOverwriteAll") + DlgOverwrite.Title = sTitle + QueryString = "Das Dokument '<PATH>' existiert bereits.<BR><BR>Möchten Sie Datei(en) überschreiben?" + QueryString = ReplaceString(QueryString, ConvertFromUrl(FilePath), "<PATH>") + QueryString = ReplaceString(QueryString, chr(13), "<BR>") + DlgOverwrite.Model.lblQueryforSave.Label = QueryString + LocRetValue = DlgOverwrite.execute() + If LocRetValue = 0 Then + iGeneralOverwrite = SBOVERWRITECANCEL + End If + DlgOverwrite.dispose() + Else + iGeneralOverwrite = SBOVERWRITECANCEL + End If +End Sub + + +Sub SetOVERWRITEToQuery() + iGeneralOverwrite = SBOVERWRITEQUERY + DlgOverwrite.EndExecute() +End Sub + + +Sub SetOVERWRITEToAlways() + iGeneralOverwrite = SBOVERWRITEALWAYS + DlgOverwrite.EndExecute() +End Sub + + +Sub SetOVERWRITEToNever() + iGeneralOverwrite = SBOVERWRITENEVER + DlgOverwrite.EndExecute() End Sub</script:module>
\ No newline at end of file |