Event.xba 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
  3. <script:module xmlns:script="http://openoffice.org/2000/script" script:name="Event" script:language="StarBasic">
  4. REM =======================================================================================================================
  5. REM === The Access2Base library is a part of the LibreOffice project. ===
  6. REM === Full documentation is available on http://www.access2base.com ===
  7. REM =======================================================================================================================
  8. Option Compatible
  9. Option ClassModule
  10. Option Explicit
  11. REM -----------------------------------------------------------------------------------------------------------------------
  12. REM --- CLASS ROOT FIELDS ---
  13. REM -----------------------------------------------------------------------------------------------------------------------
  14. Private _Type As String &apos; Must be EVENT
  15. Private _EventSource As Object
  16. Private _EventType As String
  17. Private _EventName As String
  18. Private _SubComponentName As String
  19. Private _SubComponentType As Long
  20. Private _ContextShortcut As String
  21. Private _ButtonLeft As Boolean &apos; com.sun.star.awt.MouseButton.XXX
  22. Private _ButtonRight As Boolean
  23. Private _ButtonMiddle As Boolean
  24. Private _XPos As Variant &apos; Null or Long
  25. Private _YPos As Variant &apos; Null or Long
  26. Private _ClickCount As Long
  27. Private _KeyCode As Integer &apos; com.sun.star.awt.Key.XXX
  28. Private _KeyChar As String
  29. Private _KeyFunction As Integer &apos; com.sun.star.awt.KeyFunction.XXX
  30. Private _KeyAlt As Boolean
  31. Private _KeyCtrl As Boolean
  32. Private _KeyShift As Boolean
  33. Private _FocusChangeTemporary As Boolean &apos; False if user action in same window
  34. Private _RowChangeAction As Long &apos; com.sun.star.sdb.RowChangeAction.XXX
  35. Private _Recommendation As String &apos; &quot;IGNORE&quot; or &quot;&quot;
  36. REM -----------------------------------------------------------------------------------------------------------------------
  37. REM --- CONSTRUCTORS / DESTRUCTORS ---
  38. REM -----------------------------------------------------------------------------------------------------------------------
  39. Private Sub Class_Initialize()
  40. _Type = OBJEVENT
  41. _EventSource = Nothing
  42. _EventType = &quot;&quot;
  43. _EventName = &quot;&quot;
  44. _SubComponentName = &quot;&quot;
  45. _SubComponentType = -1
  46. _ContextShortcut = &quot;&quot;
  47. _ButtonLeft = False &apos; See com.sun.star.awt.MouseButton.XXX
  48. _ButtonRight = False
  49. _ButtonMiddle = False
  50. _XPos = Null
  51. _YPos = Null
  52. _ClickCount = 0
  53. _KeyCode = 0
  54. _KeyChar = &quot;&quot;
  55. _KeyFunction = com.sun.star.awt.KeyFunction.DONTKNOW
  56. _KeyAlt = False
  57. _KeyCtrl = False
  58. _KeyShift = False
  59. _FocusChangeTemporary = False
  60. _RowChangeAction = 0
  61. _Recommendation = &quot;&quot;
  62. End Sub &apos; Constructor
  63. REM -----------------------------------------------------------------------------------------------------------------------
  64. Private Sub Class_Terminate()
  65. On Local Error Resume Next
  66. Call Class_Initialize()
  67. End Sub &apos; Destructor
  68. REM -----------------------------------------------------------------------------------------------------------------------
  69. Public Sub Dispose()
  70. Call Class_Terminate()
  71. End Sub &apos; Explicit destructor
  72. REM -----------------------------------------------------------------------------------------------------------------------
  73. REM --- CLASS GET/LET/SET PROPERTIES ---
  74. REM -----------------------------------------------------------------------------------------------------------------------
  75. Property Get ButtonLeft() As Variant
  76. ButtonLeft = _PropertyGet(&quot;ButtonLeft&quot;)
  77. End Property &apos; ButtonLeft (get)
  78. REM -----------------------------------------------------------------------------------------------------------------------
  79. Property Get ButtonMiddle() As Variant
  80. ButtonMiddle = _PropertyGet(&quot;ButtonMiddle&quot;)
  81. End Property &apos; ButtonMiddle (get)
  82. REM -----------------------------------------------------------------------------------------------------------------------
  83. Property Get ButtonRight() As Variant
  84. ButtonRight = _PropertyGet(&quot;ButtonRight&quot;)
  85. End Property &apos; ButtonRight (get)
  86. REM -----------------------------------------------------------------------------------------------------------------------
  87. Property Get ClickCount() As Variant
  88. ClickCount = _PropertyGet(&quot;ClickCount&quot;)
  89. End Property &apos; ClickCount (get)
  90. REM -----------------------------------------------------------------------------------------------------------------------
  91. Property Get ContextShortcut() As Variant
  92. ContextShortcut = _PropertyGet(&quot;ContextShortcut&quot;)
  93. End Property &apos; ContextShortcut (get)
  94. REM -----------------------------------------------------------------------------------------------------------------------
  95. Property Get EventName() As Variant
  96. EventName = _PropertyGet(&quot;EventName&quot;)
  97. End Property &apos; EventName (get)
  98. REM -----------------------------------------------------------------------------------------------------------------------
  99. Property Get EventSource() As Variant
  100. EventSource = _PropertyGet(&quot;EventSource&quot;)
  101. End Property &apos; EventSource (get)
  102. REM -----------------------------------------------------------------------------------------------------------------------
  103. Property Get EventType() As Variant
  104. EventType = _PropertyGet(&quot;EventType&quot;)
  105. End Property &apos; EventType (get)
  106. REM -----------------------------------------------------------------------------------------------------------------------
  107. Property Get FocusChangeTemporary() As Variant
  108. FocusChangeTemporary = _PropertyGet(&quot;FocusChangeTemporary&quot;)
  109. End Property &apos; FocusChangeTemporary (get)
  110. REM -----------------------------------------------------------------------------------------------------------------------
  111. Property Get KeyAlt() As Variant
  112. KeyAlt = _PropertyGet(&quot;KeyAlt&quot;)
  113. End Property &apos; KeyAlt (get)
  114. REM -----------------------------------------------------------------------------------------------------------------------
  115. Property Get KeyChar() As Variant
  116. KeyChar = _PropertyGet(&quot;KeyChar&quot;)
  117. End Property &apos; KeyChar (get)
  118. REM -----------------------------------------------------------------------------------------------------------------------
  119. Property Get KeyCode() As Variant
  120. KeyCode = _PropertyGet(&quot;KeyCode&quot;)
  121. End Property &apos; KeyCode (get)
  122. REM -----------------------------------------------------------------------------------------------------------------------
  123. Property Get KeyCtrl() As Variant
  124. KeyCtrl = _PropertyGet(&quot;KeyCtrl&quot;)
  125. End Property &apos; KeyCtrl (get)
  126. REM -----------------------------------------------------------------------------------------------------------------------
  127. Property Get KeyFunction() As Variant
  128. KeyFunction = _PropertyGet(&quot;KeyFunction&quot;)
  129. End Property &apos; KeyFunction (get)
  130. REM -----------------------------------------------------------------------------------------------------------------------
  131. Property Get KeyShift() As Variant
  132. KeyShift = _PropertyGet(&quot;KeyShift&quot;)
  133. End Property &apos; KeyShift (get)
  134. REM -----------------------------------------------------------------------------------------------------------------------
  135. Property Get ObjectType() As String
  136. ObjectType = _PropertyGet(&quot;ObjectType&quot;)
  137. End Property &apos; ObjectType (get)
  138. REM -----------------------------------------------------------------------------------------------------------------------
  139. Public Function Properties(ByVal Optional pvIndex As Variant) As Variant
  140. &apos; Return
  141. &apos; a Collection object if pvIndex absent
  142. &apos; a Property object otherwise
  143. Dim vProperty As Variant, vPropertiesList() As Variant, sObject As String
  144. vPropertiesList = _PropertiesList()
  145. sObject = Utils._PCase(_Type)
  146. If IsMissing(pvIndex) Then
  147. vProperty = PropertiesGet._Properties(sObject, _This, vPropertiesList)
  148. Else
  149. vProperty = PropertiesGet._Properties(sObject, _This, vPropertiesList, pvIndex)
  150. vProperty._Value = _PropertyGet(vPropertiesList(pvIndex))
  151. End If
  152. Exit_Function:
  153. Set Properties = vProperty
  154. Exit Function
  155. End Function &apos; Properties
  156. REM -----------------------------------------------------------------------------------------------------------------------
  157. Property Get Recommendation() As Variant
  158. Recommendation = _PropertyGet(&quot;Recommendation&quot;)
  159. End Property &apos; Recommendation (get)
  160. REM -----------------------------------------------------------------------------------------------------------------------
  161. Property Get RowChangeAction() As Variant
  162. RowChangeAction = _PropertyGet(&quot;RowChangeAction&quot;)
  163. End Property &apos; RowChangeAction (get)
  164. REM -----------------------------------------------------------------------------------------------------------------------
  165. Public Function Source() As Variant
  166. &apos; Return the object having fired the event: Form, Control or SubForm
  167. &apos; Else return the root Database object
  168. Source = _PropertyGet(&quot;Source&quot;)
  169. End Function &apos; Source (get)
  170. REM -----------------------------------------------------------------------------------------------------------------------
  171. Property Get SubComponentName() As String
  172. SubComponentName = _PropertyGet(&quot;SubComponentName&quot;)
  173. End Property &apos; SubComponentName (get)
  174. REM -----------------------------------------------------------------------------------------------------------------------
  175. Property Get SubComponentType() As Long
  176. SubComponentType = _PropertyGet(&quot;SubComponentType&quot;)
  177. End Property &apos; SubComponentType (get)
  178. REM -----------------------------------------------------------------------------------------------------------------------
  179. Property Get XPos() As Variant
  180. XPos = _PropertyGet(&quot;XPos&quot;)
  181. End Property &apos; XPos (get)
  182. REM -----------------------------------------------------------------------------------------------------------------------
  183. Property Get YPos() As Variant
  184. YPos = _PropertyGet(&quot;YPos&quot;)
  185. End Property &apos; YPos (get)
  186. REM -----------------------------------------------------------------------------------------------------------------------
  187. REM --- CLASS METHODS ---
  188. REM -----------------------------------------------------------------------------------------------------------------------
  189. Public Function getProperty(Optional ByVal pvProperty As Variant) As Variant
  190. &apos; Return property value of psProperty property name
  191. Utils._SetCalledSub(&quot;Form.getProperty&quot;)
  192. If IsMissing(pvProperty) Then Call _TraceArguments()
  193. getProperty = _PropertyGet(pvProperty)
  194. Utils._ResetCalledSub(&quot;Form.getProperty&quot;)
  195. End Function &apos; getProperty
  196. REM -----------------------------------------------------------------------------------------------------------------------
  197. Public Function hasProperty(ByVal Optional pvProperty As Variant) As Boolean
  198. &apos; Return True if object has a valid property called pvProperty (case-insensitive comparison !)
  199. If IsMissing(pvProperty) Then hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList()) Else hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList(), pvProperty)
  200. Exit Function
  201. End Function &apos; hasProperty
  202. REM -----------------------------------------------------------------------------------------------------------------------
  203. REM --- PRIVATE FUNCTIONS ---
  204. REM -----------------------------------------------------------------------------------------------------------------------
  205. Public Sub _Initialize(poEvent As Object)
  206. Dim oObject As Object, i As Integer
  207. Dim sShortcut As String, sAddShortcut As String, sArray() As String
  208. Dim sImplementation As String, oSelection As Object
  209. Dim iCurrentDoc As Integer, oDoc As Object
  210. Dim vPersistent As Variant
  211. Const cstDatabaseForm = &quot;com.sun.star.comp.forms.ODatabaseForm&quot;
  212. If _ErrorHandler() Then On Local Error Goto Error_Function
  213. Set oObject = poEvent.Source
  214. _EventSource = oObject
  215. sArray = Split(Utils._getUNOTypeName(poEvent), &quot;.&quot;)
  216. _EventType = UCase(sArray(UBound(sArray)))
  217. If Utils._hasUNOProperty(poEvent, &quot;EventName&quot;) Then _EventName = poEvent.EventName
  218. Select Case _EventType
  219. Case &quot;DOCUMENTEVENT&quot;
  220. &apos;SubComponent processing
  221. Select Case UCase(_EventName)
  222. Case UCase(&quot;OnSubComponentClosed&quot;), UCase(&quot;OnSubComponentOpened&quot;)
  223. Set oSelection = poEvent.ViewController.getSelection()(0)
  224. _SubComponentName = oSelection.Name
  225. With com.sun.star.sdb.application.DatabaseObject
  226. Select Case oSelection.Type
  227. Case .TABLE : _SubComponentType = acTable
  228. Case .QUERY : _SubComponentType = acQuery
  229. Case .FORM : _SubComponentType = acForm
  230. Case .REPORT : _SubComponentType = acReport
  231. Case Else
  232. End Select
  233. End With
  234. Case Else
  235. End Select
  236. Case &quot;EVENTOBJECT&quot;
  237. Case &quot;ACTIONEVENT&quot;
  238. Case &quot;FOCUSEVENT&quot;
  239. _FocusChangeTemporary = poEvent.Temporary
  240. Case &quot;ITEMEVENT&quot;
  241. Case &quot;INPUTEVENT&quot;, &quot;KEYEVENT&quot;
  242. _KeyCode = poEvent.KeyCode
  243. _KeyChar = poEvent.KeyChar
  244. _KeyFunction = poEvent.KeyFunc
  245. _KeyAlt = Utils._BitShift(poEvent.Modifiers, com.sun.star.awt.KeyModifier.MOD2)
  246. _KeyCtrl = Utils._BitShift(poEvent.Modifiers, com.sun.star.awt.KeyModifier.MOD1)
  247. _KeyShift = Utils._BitShift(poEvent.Modifiers, com.sun.star.awt.KeyModifier.SHIFT)
  248. Case &quot;MOUSEEVENT&quot;
  249. _ButtonLeft = Utils._BitShift(poEvent.Buttons, com.sun.star.awt.MouseButton.LEFT)
  250. _ButtonRight = Utils._BitShift(poEvent.Buttons, com.sun.star.awt.MouseButton.RIGHT)
  251. _ButtonMiddle = Utils._BitShift(poEvent.Buttons, com.sun.star.awt.MouseButton.MIDDLE)
  252. _XPos = poEvent.X
  253. _YPos = poEvent.Y
  254. _ClickCount = poEvent.ClickCount
  255. Case &quot;ROWCHANGEEVENT&quot;
  256. _RowChangeAction = poEvent.Action
  257. Case &quot;TEXTEVENT&quot;
  258. Case &quot;ADJUSTMENTEVENT&quot;, &quot;DOCKINGEVENT&quot;, &quot;ENDDOCKINGEVENT&quot;, &quot;ENDPOPUPMODEEVENT&quot;, &quot;ENHANCEDMOUSEEVENT&quot; _
  259. , &quot;MENUEVENT&quot;, &quot;PAINTEVENT&quot;, &quot;SPINEVENT&quot;, &quot;VCLCONTAINEREVENT&quot;, &quot;WINDOWEVENT&quot;
  260. Goto Exit_Function
  261. Case Else
  262. Goto Exit_Function
  263. End Select
  264. &apos; Evaluate ContextShortcut
  265. sShortcut = &quot;&quot;
  266. sImplementation = Utils._ImplementationName(oObject)
  267. Select Case True
  268. Case sImplementation = &quot;stardiv.Toolkit.UnoDialogControl&quot; &apos; Dialog
  269. _ContextShortcut = &quot;Dialogs!&quot; &amp; _EventSource.Model.Name
  270. Goto Exit_Function
  271. Case Left(sImplementation, 16) = &quot;stardiv.Toolkit.&quot; &apos; Control in Dialog
  272. _ContextShortcut = &quot;Dialogs!&quot; &amp; _EventSource.Context.Model.Name _
  273. &amp; &quot;!&quot; &amp; _EventSource.Model.Name
  274. Goto Exit_Function
  275. Case Else
  276. End Select
  277. iCurrentDoc = _A2B_.CurrentDocIndex(, False)
  278. If iCurrentDoc &lt; 0 Then Goto Exit_Function
  279. Set oDoc = _A2B_.CurrentDocument(iCurrentDoc)
  280. &apos; To manage 2x triggers of &quot;Before record action&quot; form event
  281. If _EventType = &quot;ROWCHANGEEVENT&quot; And sImplementation &lt;&gt; &quot;com.sun.star.comp.forms.ODatabaseForm&quot; Then _Recommendation = &quot;IGNORE&quot;
  282. Do While sImplementation &lt;&gt; &quot;SwXTextDocument&quot;
  283. sAddShortcut = &quot;&quot;
  284. Select Case sImplementation
  285. Case &quot;com.sun.star.comp.forms.OFormsCollection&quot; &apos; Do nothing
  286. Case Else
  287. If Utils._hasUNOProperty(oObject, &quot;Model&quot;) Then
  288. If oObject.Model.Name &lt;&gt; &quot;MainForm&quot; And oObject.Model.Name &lt;&gt; &quot;Form&quot; Then sAddShortcut = Utils._Surround(oObject.Model.Name)
  289. ElseIf Utils._hasUNOProperty(oObject, &quot;Name&quot;) Then
  290. If oObject.Name &lt;&gt; &quot;MainForm&quot; And oObject.Name &lt;&gt; &quot;Form&quot; Then sAddShortcut = Utils._Surround(oObject.Name)
  291. End If
  292. If sAddShortcut &lt;&gt; &quot;&quot; Then
  293. If sImplementation = cstDatabaseForm And oDoc.DbConnect = DBCONNECTBASE Then sAddShortcut = sAddShortcut &amp; &quot;.Form&quot;
  294. sShortcut = sAddShortcut &amp; Iif(Len(sShortcut) &gt; 0, &quot;!&quot; &amp; sShortcut, &quot;&quot;)
  295. End If
  296. End Select
  297. Select Case True
  298. Case Utils._hasUNOProperty(oObject, &quot;Model&quot;)
  299. Set oObject = oObject.Model.Parent
  300. Case Utils._hasUNOProperty(oObject, &quot;Parent&quot;)
  301. Set oObject = oObject.Parent
  302. Case Else
  303. Goto Exit_Function
  304. End Select
  305. sImplementation = Utils._ImplementationName(oObject)
  306. Loop
  307. &apos; Add Forms! prefix
  308. Select Case oDoc.DbConnect
  309. Case DBCONNECTBASE
  310. vPersistent = Split(oObject.StringValue, &quot;/&quot;)
  311. sAddShortcut = Utils._Surround(_GetHierarchicalName(vPersistent(UBound(vPersistent) - 1)))
  312. sShortcut = &quot;Forms!&quot; &amp; sAddShortcut &amp; &quot;!&quot; &amp; sShortcut
  313. Case DBCONNECTFORM
  314. sShortcut = &quot;Forms!0!&quot; &amp; sShortcut
  315. End Select
  316. sArray = Split(sShortcut, &quot;!&quot;)
  317. &apos; If presence of &quot;Forms!myform!myform.Form&quot;, eliminate 2nd element
  318. &apos; Eliminate anyway blanco subcomponents (e.g. Forms!!myForm)
  319. If UBound(sArray) &gt;= 2 Then
  320. If UCase(sArray(1)) &amp; &quot;.FORM&quot; = UCase(sArray(2)) Then sArray(1) = &quot;&quot;
  321. sArray = Utils._TrimArray(sArray)
  322. End If
  323. &apos; If first element ends with .Form, remove suffix
  324. If UBound(sArray) &gt;= 1 Then
  325. If Len(sArray(1)) &gt; 5 And Right(sArray(1), 5) = &quot;.Form&quot; Then sArray(1) = left(sArray(1), Len(sArray(1)) - 5)
  326. sShortcut = Join(sArray, &quot;!&quot;)
  327. End If
  328. If Len(sShortcut) &gt;= 2 Then
  329. If Right(sShortcut, 1) = &quot;!&quot; Then
  330. _ContextShortcut = Left(sShortcut, Len(sShortcut) - 1)
  331. Else
  332. _ContextShortcut = sShortcut
  333. End If
  334. End If
  335. Exit_Function:
  336. Exit Sub
  337. Error_Function:
  338. TraceError(TRACEWARNING, Err, &quot;Event.Initialize&quot;, Erl)
  339. GoTo Exit_Function
  340. End Sub &apos; _Initialize V0.9.1
  341. REM -----------------------------------------------------------------------------------------------------------------------
  342. Private Function _PropertiesList() As Variant
  343. Dim sSubComponentName As String, sSubComponentType As String
  344. sSubComponentName = Iif(_SubComponentType &gt; -1, &quot;SubComponentName&quot;, &quot;&quot;)
  345. sSubComponentType = Iif(_SubComponentType &gt; -1, &quot;SubComponentType&quot;, &quot;&quot;)
  346. Dim sXPos As String, sYPos As String
  347. sXPos = Iif(IsNull(_XPos), &quot;&quot;, &quot;XPos&quot;)
  348. sYPos = Iif(IsNull(_YPos), &quot;&quot;, &quot;YPos&quot;)
  349. _PropertiesList = Utils._TrimArray(Array( _
  350. &quot;ButtonLeft&quot;, &quot;ButtonRight&quot;, &quot;ButtonMiddle&quot;, &quot;ClickCount&quot; _
  351. , &quot;ContextShortcut&quot;, &quot;EventName&quot;, &quot;EventType&quot;, &quot;FocusChangeTemporary&quot;, _
  352. , &quot;KeyAlt&quot;, &quot;KeyChar&quot;, &quot;KeyCode&quot;, &quot;KeyCtrl&quot;, &quot;KeyFunction&quot;, &quot;KeyShift&quot; _
  353. , &quot;ObjectType&quot;, &quot;Recommendation&quot;, &quot;RowChangeAction&quot;, &quot;Source&quot; _
  354. , sSubComponentName, sSubComponentType, sXPos, sYPos _
  355. ))
  356. End Function &apos; _PropertiesList
  357. REM -----------------------------------------------------------------------------------------------------------------------
  358. Private Function _PropertyGet(ByVal psProperty As String) As Variant
  359. &apos; Return property value of the psProperty property name
  360. If _ErrorHandler() Then On Local Error Goto Error_Function
  361. Utils._SetCalledSub(&quot;Event.get&quot; &amp; psProperty)
  362. _PropertyGet = EMPTY
  363. Select Case UCase(psProperty)
  364. Case UCase(&quot;ButtonLeft&quot;)
  365. _PropertyGet = _ButtonLeft
  366. Case UCase(&quot;ButtonMiddle&quot;)
  367. _PropertyGet = _ButtonMiddle
  368. Case UCase(&quot;ButtonRight&quot;)
  369. _PropertyGet = _ButtonRight
  370. Case UCase(&quot;ClickCount&quot;)
  371. _PropertyGet = _ClickCount
  372. Case UCase(&quot;ContextShortcut&quot;)
  373. _PropertyGet = _ContextShortcut
  374. Case UCase(&quot;FocusChangeTemporary&quot;)
  375. _PropertyGet = _FocusChangeTemporary
  376. Case UCase(&quot;EventName&quot;)
  377. _PropertyGet = _EventName
  378. Case UCase(&quot;EventSource&quot;)
  379. _PropertyGet = _EventSource
  380. Case UCase(&quot;EventType&quot;)
  381. _PropertyGet = _EventType
  382. Case UCase(&quot;KeyAlt&quot;)
  383. _PropertyGet = _KeyAlt
  384. Case UCase(&quot;KeyChar&quot;)
  385. _PropertyGet = _KeyChar
  386. Case UCase(&quot;KeyCode&quot;)
  387. _PropertyGet = _KeyCode
  388. Case UCase(&quot;KeyCtrl&quot;)
  389. _PropertyGet = _KeyCtrl
  390. Case UCase(&quot;KeyFunction&quot;)
  391. _PropertyGet = _KeyFunction
  392. Case UCase(&quot;KeyShift&quot;)
  393. _PropertyGet = _KeyShift
  394. Case UCase(&quot;ObjectType&quot;)
  395. _PropertyGet = _Type
  396. Case UCase(&quot;Recommendation&quot;)
  397. _PropertyGet = _Recommendation
  398. Case UCase(&quot;RowChangeAction&quot;)
  399. _PropertyGet = _RowChangeAction
  400. Case UCase(&quot;Source&quot;)
  401. If _ContextShortcut = &quot;&quot; Then
  402. _PropertyGet = _EventSource
  403. Else
  404. _PropertyGet = getObject(_ContextShortcut)
  405. End If
  406. Case UCase(&quot;SubComponentName&quot;)
  407. _PropertyGet = _SubComponentName
  408. Case UCase(&quot;SubComponentType&quot;)
  409. _PropertyGet = _SubComponentType
  410. Case UCase(&quot;XPos&quot;)
  411. If IsNull(_XPos) Then Goto Trace_Error
  412. _PropertyGet = _XPos
  413. Case UCase(&quot;YPos&quot;)
  414. If IsNull(_YPos) Then Goto Trace_Error
  415. _PropertyGet = _YPos
  416. Case Else
  417. Goto Trace_Error
  418. End Select
  419. Exit_Function:
  420. Utils._ResetCalledSub(&quot;Event.get&quot; &amp; psProperty)
  421. Exit Function
  422. Trace_Error:
  423. &apos; Errors are not displayed to avoid display infinite cycling
  424. TraceError(TRACEWARNING, ERRPROPERTY, Utils._CalledSub(), 0, False, psProperty)
  425. _PropertyGet = EMPTY
  426. Goto Exit_Function
  427. Error_Function:
  428. TraceError(TRACEABORT, Err, &quot;Event._PropertyGet&quot;, Erl)
  429. _PropertyGet = EMPTY
  430. GoTo Exit_Function
  431. End Function &apos; _PropertyGet V1.1.0
  432. </script:module>