offapi/com/sun/star/ui/dialogs/DialogClosedEvent.idl | 1 offapi/com/sun/star/ui/dialogs/FilePickerEvent.idl | 1 wizards/source/scriptforge/python/scriptforge.py | 5 + wizards/source/sfdialogs/SF_Dialog.xba | 71 ++++++++++++++++++- wizards/source/sfdialogs/SF_DialogControl.xba | 2 5 files changed, 74 insertions(+), 6 deletions(-)
New commits: commit f692b5c5e4e9c57fb69d0054c654486a737d19bd Author: Jean-Pierre Ledure <[email protected]> AuthorDate: Thu May 18 13:01:52 2023 +0200 Commit: Jean-Pierre Ledure <[email protected]> CommitDate: Sat May 20 12:56:41 2023 +0200 ScriptForge New method dialog.CreateHyperlink() Method (Dialog service) CreateHyperlink(controlname, place, border, multiline, align, verticalalign) completes the set of available methods for dynamic DialogControl creation. Cfr. https://gerrit.libreoffice.org/c/core/+/151896 Change-Id: I162075ea39efdd2e1189fe8b16ac05316e6a13ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151954 Tested-by: Jean-Pierre Ledure <[email protected]> Reviewed-by: Jean-Pierre Ledure <[email protected]> diff --git a/wizards/source/scriptforge/python/scriptforge.py b/wizards/source/scriptforge/python/scriptforge.py index adfb4d69ef97..1b094c4711be 100644 --- a/wizards/source/scriptforge/python/scriptforge.py +++ b/wizards/source/scriptforge/python/scriptforge.py @@ -1912,6 +1912,11 @@ class SFDialogs: def CreateGroupBox(self, controlname, place): return self.ExecMethod(self.vbMethod, 'CreateGroupBox', controlname, place) + def CreateHyperlink(self, controlname, place, border = 'NONE', multiline = False, align = 'LEFT', + verticalalign = 'TOP'): + return self.ExecMethod(self.vbMethod, 'CreateHyperlink', controlname, place, border, multiline, align, + verticalalign) + def CreateImageControl(self, controlname, place, border = '3D', scale = 'FITTOSIZE'): return self.ExecMethod(self.vbMethod, 'CreateImageControl', controlname, place, border, scale) 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 @@ -1141,6 +1141,70 @@ Catch: GoTo Finally 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 _ @@ -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 diff --git a/wizards/source/sfdialogs/SF_DialogControl.xba b/wizards/source/sfdialogs/SF_DialogControl.xba index 133d942a8c32..2cef9ad5e7ef 100644 --- a/wizards/source/sfdialogs/SF_DialogControl.xba +++ b/wizards/source/sfdialogs/SF_DialogControl.xba @@ -2512,4 +2512,4 @@ Private Function _Repr() As String End Function ' SFDialogs.SF_DialogControl._Repr REM ============================================ END OF SFDIALOGS.SF_DIALOGCONTROL -</script:module> +</script:module> \ No newline at end of file commit 82816547ccda994acfa6ec63a98f561f615efcfa Author: Julien Nabet <[email protected]> AuthorDate: Sat May 20 12:44:34 2023 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Sat May 20 12:56:37 2023 +0200 idl: they're not params but attributes Fix these warnings: /home/tdf/jenkins/workspace/gerrit_windows@2/offapi/com/sun/star/ui/dialogs/DialogClosedEvent.idl:33: warning: com::sun::star::ui::dialogs::DialogClosedEvent::DialogResult has @param documentation sections but no arguments /home/tdf/jenkins/workspace/gerrit_windows@2/offapi/com/sun/star/ui/dialogs/FilePickerEvent.idl:29: warning: com::sun::star::ui::dialogs::FilePickerEvent::ElementId has @param documentation sections but no arguments Change-Id: Ic2ae5f70f3f6aa744bd61044f80e9ab525407ecc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152020 Reviewed-by: Noel Grandin <[email protected]> Tested-by: Noel Grandin <[email protected]> diff --git a/offapi/com/sun/star/ui/dialogs/DialogClosedEvent.idl b/offapi/com/sun/star/ui/dialogs/DialogClosedEvent.idl index 52d724b82d03..49162ccc47cd 100644 --- a/offapi/com/sun/star/ui/dialogs/DialogClosedEvent.idl +++ b/offapi/com/sun/star/ui/dialogs/DialogClosedEvent.idl @@ -30,7 +30,6 @@ module com { module sun { module star { module ui { module dialogs { struct DialogClosedEvent: com::sun::star::lang::EventObject { /** - @param DialogResult Identifies the result of a dialog. @see ExecutableDialogResults diff --git a/offapi/com/sun/star/ui/dialogs/FilePickerEvent.idl b/offapi/com/sun/star/ui/dialogs/FilePickerEvent.idl index 4477010d53c9..53f95617236c 100644 --- a/offapi/com/sun/star/ui/dialogs/FilePickerEvent.idl +++ b/offapi/com/sun/star/ui/dialogs/FilePickerEvent.idl @@ -26,7 +26,6 @@ module com { module sun { module star { module ui { module dialogs { published struct FilePickerEvent: com::sun::star::lang::EventObject { /** - @param ElementId Identifies the affected element @see com::sun::star::ui::dialogs::CommonFilePickerElementIds
