From bc8c1d45ac91a1b3855eec8358260a8720d4c081 Mon Sep 17 00:00:00 2001 From: Jean-Pierre Ledure Date: Mon, 23 Jan 2023 15:35:47 +0100 Subject: ScriptForge (SF_Dialog) define constants as properties OKBUTTON and CANCELBUTTON are defined in the help as properties, both for Basic and Python user scripts. To make dialog.OKBUTTON valid in Basic, OKBUTTON should be defined either as (1) Public Const OKBUTTON = 1 or (2) Property Get OKBUTTON() Actually, it if a Private constant. <= wrong Choice is made to make it a full property (2). Python equivalent is OK, no change required. No impact on help documentation. Change-Id: Id4cf7dfbaff68fc8cc48a5c4779374ce1e7cc88b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146008 Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure --- wizards/source/sfdialogs/SF_Dialog.xba | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/wizards/source/sfdialogs/SF_Dialog.xba b/wizards/source/sfdialogs/SF_Dialog.xba index 507e5ac72c00..081584f56e81 100644 --- a/wizards/source/sfdialogs/SF_Dialog.xba +++ b/wizards/source/sfdialogs/SF_Dialog.xba @@ -99,8 +99,8 @@ Private _ControlCache As Variant ' Array of control objects sorted like E REM ============================================================ MODULE CONSTANTS ' Dialog usual buttons -Private Const OKBUTTON = 1 -Private Const CANCELBUTTON = 0 +Private Const cstOKBUTTON = 1 +Private Const cstCANCELBUTTON = 0 ' Page management Private Const PILOTCONTROL = 1 @@ -152,6 +152,11 @@ End Function ' SFDialogs.SF_Dialog Explicit Destructor REM ================================================================== PROPERTIES +REM ----------------------------------------------------------------------------- +Property Get CANCELBUTTON() As Variant + CANCELBUTTON = cstCANCELBUTTON +End Property ' SFDialogs.SF_Dialog.CANCELBUTTON (get) + REM ----------------------------------------------------------------------------- Property Get Caption() As Variant ''' The Caption property refers to the title of the dialog @@ -188,6 +193,11 @@ Property Get Name() As String Name = _PropertyGet("Name") End Property ' SFDialogs.SF_Dialog.Name +REM ----------------------------------------------------------------------------- +Property Get OKBUTTON() As Variant + OKBUTTON = cstOKBUTTON +End Property ' SFDialogs.SF_Dialog.OKBUTTON (get) + REM ----------------------------------------------------------------------------- Property Get OnFocusGained() As Variant ''' Get the script associated with the OnFocusGained event -- cgit