summaryrefslogtreecommitdiff
path: root/wizards/source/sfdialogs/SF_Dialog.xba
diff options
context:
space:
mode:
Diffstat (limited to 'wizards/source/sfdialogs/SF_Dialog.xba')
-rw-r--r--wizards/source/sfdialogs/SF_Dialog.xba71
1 files changed, 68 insertions, 3 deletions
diff --git a/wizards/source/sfdialogs/SF_Dialog.xba b/wizards/source/sfdialogs/SF_Dialog.xba
index b50e22aebeb3..20f1e81dc650 100644
--- a/wizards/source/sfdialogs/SF_Dialog.xba
+++ b/wizards/source/sfdialogs/SF_Dialog.xba
@@ -1142,6 +1142,70 @@ Catch:
End Function ' SFDialogs.SF_Dialog.CreateGroupBox
REM -----------------------------------------------------------------------------
+Public Function CreateHyperlink(Optional ByVal ControlName As Variant _
+ , Optional ByRef Place As Variant _
+ , Optional ByVal Border As Variant _
+ , Optional ByVal MultiLine As Variant _
+ , Optional ByVal Align As Variant _
+ , Optional ByVal VerticalAlign As Variant _
+ ) As Object
+''' Create a new control of type Hyperlink in the actual dialog.
+''' Specific args:
+''' Border: "NONE" (default) or "FLAT" or "3D"
+''' MultiLine: When True (default = False), the caption may be displayed on more than one line
+''' Align: horizontal alignment, "LEFT" (default) or "CENTER" or "RIGHT"
+''' VerticalAlign: vertical alignment, "TOP" (default) or "MIDDLE" or "BOTTOM"
+''' Returns:
+''' an instance of the SF_DialogControl class or Nothing
+''' Example:
+''' Set myHyperlink = dialog.CreateHyperlink("Hyperlink1", Array(20, 20, 60, 15), MultiLine := True)
+
+Dim oControl As Object ' Return value
+Dim iBorder As Integer ' Alias of border
+Dim iAlign As Integer ' Alias of Align
+Dim iVerticalAlign As Integer ' Alias of VerticalAlign
+Dim vPropNames As Variant ' Array of names of specific arguments
+Dim vPropValues As Variant ' Array of values of specific arguments
+Const cstThisSub = "SFDialogs.Dialog.CreateHyperlink"
+Const cstSubArgs = "ControlName, Place, [MultiLine=False], [Border=""NONE""|""FLAT""|""3D""]" _
+ & ", [Align=""LEFT""|""CENTER""|""RIGHT""], [VerticalAlign=""TOP""|""MIDDLE""|""BOTTOM""]"
+
+Check:
+ Set oControl = Nothing
+ If Not _CheckNewControl(cstThisSub, cstSubArgs, ControlName, Place) Then GoTo Finally
+
+ If IsMissing(Border) Or IsEmpty(Border) Then Border = "NONE"
+ If IsMissing(MultiLine) Or IsEmpty(MultiLine) Then MultiLine = False
+ If IsMissing(Align) Or IsEmpty(Align) Then Align = "LEFT"
+ If IsMissing(VerticalAlign) Or IsEmpty(VerticalAlign) Then VerticalAlign = "TOP"
+
+ If Not ScriptForge.SF_Utils._Validate(Border, "Border", V_STRING, Array("3D", "FLAT", "NONE")) Then GoTo Finally
+ If Not ScriptForge.SF_Utils._Validate(MultiLine, "MultiLine", ScriptForge.V_BOOLEAN) Then GoTo Finally
+ If Not ScriptForge.SF_Utils._Validate(Align, "Align", V_STRING, Array("LEFT", "CENTER", "RIGHT")) Then GoTo Finally
+ If Not ScriptForge.SF_Utils._Validate(VerticalAlign, "VerticalAlign", V_STRING, Array("TOP", "MIDDLE", "BOTTOM")) Then GoTo Finally
+
+Try:
+ ' Manage specific properties
+ iBorder = ScriptForge.SF_Array.IndexOf(Array("NONE", "3D", "FLAT"), Border)
+ iAlign = ScriptForge.SF_Array.IndexOf(Array("LEFT", "CENTER", "BOTTOM"), Align)
+ Select Case UCase(VerticalAlign)
+ Case "TOP" : iVerticalAlign = com.sun.star.style.VerticalAlignment.TOP
+ Case "MIDDLE" : iVerticalAlign = com.sun.star.style.VerticalAlignment.MIDDLE
+ Case "BOTTOM" : iVerticalAlign = com.sun.star.style.VerticalAlignment.BOTTOM
+ End Select
+ vPropNames = Array("Border", "MultiLine", "Align", "VerticalAlign")
+ vPropValues = Array(iBorder, CBool(MultiLine), iAlign, iVerticalAlign)
+
+ ' Create the control
+ Set oControl = _CreateNewControl("UnoControlFixedHyperlinkModel", ControlName, Place, vPropNames, vPropValues)
+
+Finally:
+ Set CreateHyperlink = oControl
+ ScriptForge.SF_Utils._ExitFunction(cstThisSub)
+ Exit Function
+End Function ' SFDialogs.SF_Dialog.CreateHyperlink
+
+REM -----------------------------------------------------------------------------
Public Function CreateImageControl(Optional ByVal ControlName As Variant _
, Optional ByRef Place As Variant _
, Optional ByVal Border As Variant _
@@ -1528,8 +1592,8 @@ Public Function CreateTableControl(Optional ByVal ControlName As Variant _
''' To fill the table with data, use the SetTableData() method
''' Specific args:
''' Border: "3D" (default) or "FLAT" or "NONE"
-''' RowHeaders: when True (default), the row Headers are shown
-''' ColumnHeaders: when True (default), the column Headers are shown
+''' RowHeaders: when True (default), the row headers are shown
+''' ColumnHeaders: when True (default), the column headers are shown
''' ScrollBars: H[orizontal] or V[ertical] or B[oth] or N[one] (default)
''' Note that scrollbars always appear dynamically when they are needed
''' GridLines: when True (default = False) horizontal and vertical lines are painted between the grid cells
@@ -1989,6 +2053,7 @@ Public Function Methods() As Variant
, "CreateFixedText" _
, "CreateFormattedField" _
, "CreateGroupBox" _
+ , "CreateHyperlink" _
, "CreateImageControl" _
, "CreateListBox" _
, "CreateNumericField" _
@@ -2878,4 +2943,4 @@ Private Function _Repr() As String
End Function ' SFDialogs.SF_Dialog._Repr
REM ============================================ END OF SFDIALOGS.SF_DIALOG
-</script:module>
+</script:module> \ No newline at end of file