summaryrefslogtreecommitdiff
path: root/wizards/source/sfdocuments
diff options
context:
space:
mode:
Diffstat (limited to 'wizards/source/sfdocuments')
-rw-r--r--wizards/source/sfdocuments/SF_Form.xba40
1 files changed, 40 insertions, 0 deletions
diff --git a/wizards/source/sfdocuments/SF_Form.xba b/wizards/source/sfdocuments/SF_Form.xba
index ca4be09e56df..a6c4a074d0b9 100644
--- a/wizards/source/sfdocuments/SF_Form.xba
+++ b/wizards/source/sfdocuments/SF_Form.xba
@@ -258,6 +258,46 @@ Catch:
End Function ' SFDocuments.SF_Form.Activate
REM -----------------------------------------------------------------------------
+Public Function CloseFormDocument() As Boolean
+''' Close the form document containing the actual form instance
+''' The form instance is disposed
+''' The method does nothong if the actual form is not located in a Base form document
+''' Args:
+''' Returns:
+''' True if closure is successful
+''' Example:
+''' myForm.CloseFormDocument()
+
+Dim bClose As Boolean ' Return value
+Dim oContainer As Object ' com.sun.star.awt.XWindow
+Const cstThisSub = "SFDocuments.Form.CloseFormDocument"
+Const cstSubArgs = ""
+
+ If ScriptForge.SF_Utils._ErrorHandling() Then On Local Error GoTo Catch
+ bClose = False
+
+Check:
+ If ScriptForge.SF_Utils._EnterFunction(cstThisSub, cstSubArgs) Then
+ If Not _IsStillAlive() Then GoTo Finally
+ End If
+Try:
+ Select Case _FormType
+ Case ISDOCFORM, ISCALCFORM, ISSUBFORM
+ Case ISBASEFORM
+ _MainForm.close()
+ Dispose()
+ bClose = True
+ End Select
+
+Finally:
+ CloseFormDocument = bClose
+ ScriptForge.SF_Utils._ExitFunction(cstThisSub)
+ Exit Function
+Catch:
+ GoTo Finally
+End Function ' SFDocuments.SF_Form.CloseFormDocument
+
+REM -----------------------------------------------------------------------------
Public Function Controls(Optional ByVal ControlName As Variant) As Variant
''' Return either
''' - the list of the controls contained in the Form