summaryrefslogtreecommitdiff
path: root/wizards
diff options
context:
space:
mode:
authorJean-Pierre Ledure <jp@ledure.be>2020-11-28 17:43:59 +0100
committerJean-Pierre Ledure <jp@ledure.be>2020-11-29 12:05:09 +0100
commit0cd33fe7bbe420719cc9c77e4e49deb0743b83ba (patch)
tree7f1a4bdda82a1e488e136b8b1a0562455dd583d9 /wizards
parentbbcea95619968f95782cd1c90638fd9e553de4f6 (diff)
ScriptForge - (SF_DialogControl) set OnEvent properties
Applied on DialogControl class: Assign the triggered script as a string to the OnXxx properties or as a zero-length string to remove any trigger Check of control type is included Change-Id: I199fbfb565740f7ca4576c39bebf7dc9e4052289 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106807 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Diffstat (limited to 'wizards')
-rw-r--r--wizards/source/sfdialogs/SF_DialogControl.xba27
1 files changed, 27 insertions, 0 deletions
diff --git a/wizards/source/sfdialogs/SF_DialogControl.xba b/wizards/source/sfdialogs/SF_DialogControl.xba
index 2dce649a1db3..7200f1b25876 100644
--- a/wizards/source/sfdialogs/SF_DialogControl.xba
+++ b/wizards/source/sfdialogs/SF_DialogControl.xba
@@ -1098,6 +1098,7 @@ Dim vSelection As Variant &apos; Alias of Model.SelectedItems
Dim vList As Variant &apos; Alias of Model.StringItemList
Dim lIndex As Long &apos; Index in StringItemList
Dim sItem As String &apos; A single item
+Dim vCtlTypes As Variant &apos; Array of allowed control types
Dim i As Long
Dim cstThisSub As String
Const cstSubArgs = &quot;Value&quot;
@@ -1185,6 +1186,32 @@ Const cstSubArgs = &quot;Value&quot;
End If
Case Else : GoTo CatchType
End Select
+ Case UCase(&quot;OnActionPerformed&quot;), UCase(&quot;OnAdjustmentValueChanged&quot;), UCase(&quot;OnFocusGained&quot;), UCase(&quot;OnFocusLost&quot;) _
+ , UCase(&quot;OnItemStateChanged&quot;), UCase(&quot;OnKeyPressed&quot;), UCase(&quot;OnKeyReleased&quot;) _
+ , UCase(&quot;OnMouseDragged&quot;), UCase(&quot;OnMouseEntered&quot;), UCase(&quot;OnMouseExited&quot;), UCase(&quot;OnMouseMoved&quot;) _
+ , UCase(&quot;OnMousePressed&quot;), UCase(&quot;OnMouseReleased&quot;), UCase(&quot;OnTextChanged&quot;)
+ If Not ScriptForge.SF_Utils._Validate(pvValue, psProperty, V_STRING) Then GoTo Finally
+ &apos; Most properties are common to all control types, but there are exceptions
+ Select Case UCase(psProperty)
+ Case UCase(&quot;OnActionPerformed&quot;), UCase(&quot;OnItemStateChanged&quot;)
+ vCtlTypes = Array(CTLBUTTON, CTLCHECKBOX, CTLCOMBOBOX, CTLLISTBOX, CTLRADIOBUTTON)
+ Case UCase(&quot;OnAdjustmentValueChanged&quot;)
+ vCtlTypes = Array(CTLSCROLLBAR)
+ Case UCase(&quot;OnTextChanged&quot;)
+ vCtlTypes = Array(CTLCOMBOBOX, CTLCURRENCYFIELD, CTLDATEFIELD, CTLFILECONTROL, CTLFORMATTEDFIELD _
+ , CTLNUMERICFIELD, CTLPATTERNFIELD, CTLTEXTFIELD, CTLTIMEFIELD)
+ Case Else
+ vCtlTypes = Array()
+ End Select
+ If UBound(vCtlTypes) &gt;= 0 Then
+ If Not ScriptForge.SF_Array.Contains(vCtlTypes, _ControlType) Then GoTo CatchType
+ End If
+ SFDialogs.SF_Register._SetEventScript( _
+ _ControlModel _
+ , _GetEventName(psProperty) _
+ , _GetListener(psProperty) _
+ , pvValue _
+ )
Case UCase(&quot;Page&quot;)
If Not ScriptForge.SF_Utils._Validate(pvValue, &quot;Page&quot;, ScriptForge.V_NUMERIC) Then GoTo Finally
If oSession.HasUnoProperty(_ControlModel, &quot;Step&quot;) Then _ControlModel.Step = CLng(pvValue)