Version 6.1.4.1, tag libreoffice-6.1.4.1
[LibreOffice.git] / wizards / source / access2base / Control.xba
blob41a9fa43a26bc2618d964fe75950f374ec0d5acb
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="Control" script:language="StarBasic">REM =======================================================================================================================
4 REM === The Access2Base library is a part of the LibreOffice project. ===
5 REM === Full documentation is available on http://www.access2base.com ===
6 REM =======================================================================================================================
8 Option Compatible
9 Option ClassModule
11 Option Explicit
13 REM -----------------------------------------------------------------------------------------------------------------------
14 REM --- CLASS ROOT FIELDS ---
15 REM -----------------------------------------------------------------------------------------------------------------------
17 Private _Type As String &apos; Must be CONTROL
18 Private _ImplementationName As String
19 Private _ClassId As Integer
20 Private _ParentType As String &apos; One of CTLPARENTISxxxx constants
21 Private _Shortcut As String
22 Private _Name As String
23 Private _FormComponent As Object &apos; com.sun.star.text.TextDocument
24 Private _MainForm As String &apos; To be propagated to all subcontrols
25 Private _DocEntry As Integer &apos; Doc- and DbContainer entries in Root structure
26 Private _DbEntry As Integer
27 Private _ControlType As Integer
28 Private _ThisProperties As Variant &apos; Buffer for properties list
29 Private _SubType As String
30 Private ControlModel As Object &apos; com.sun.star.comp.forms.XXXModel
31 Private ControlView As Object &apos; com.sun.star.comp.forms.XXXControl (NULL if form open in edit mode)
32 Private BoundField As Object &apos; com.sun.star.sdb.ODataColumn
33 Private LabelControl As Object &apos; com.sun.star.form.component.FixedText or com.sun.star.form.component.GroupBox
35 REM -----------------------------------------------------------------------------------------------------------------------
36 REM --- CONSTRUCTORS / DESTRUCTORS ---
37 REM -----------------------------------------------------------------------------------------------------------------------
38 Private Sub Class_Initialize()
39 _Type = OBJCONTROL
40 _ClassId = -1
41 _ParentType = &quot;&quot;
42 _Shortcut = &quot;&quot;
43 _Name = &quot;&quot;
44 Set _FormComponent = Nothing
45 _MainForm = &quot;&quot;
46 _DocEntry = -1
47 _DbEntry = -1
48 _ThisProperties = Array()
49 _SubType = &quot;&quot;
50 Set ControlModel = Nothing
51 Set ControlView = Nothing
52 Set BoundField = Nothing
53 Set LabelControl = Nothing
55 End Sub &apos; Constructor
57 REM -----------------------------------------------------------------------------------------------------------------------
58 Private Sub Class_Terminate()
59 On Local Error Resume Next
60 Call Class_Initialize()
61 End Sub &apos; Destructor
63 REM -----------------------------------------------------------------------------------------------------------------------
64 Public Sub Dispose()
65 Call Class_Terminate()
66 End Sub &apos; Explicit destructor
68 REM -----------------------------------------------------------------------------------------------------------------------
69 REM --- CLASS GET/LET/SET PROPERTIES ---
70 REM -----------------------------------------------------------------------------------------------------------------------
72 Property Get BackColor() As Variant
73 BackColor = _PropertyGet(&quot;BackColor&quot;)
74 End Property &apos; BackColor (get)
76 Property Let BackColor(ByVal pvValue As Variant)
77 Call _PropertySet(&quot;BackColor&quot;, pvValue)
78 End Property &apos; BackColor (set)
80 REM -----------------------------------------------------------------------------------------------------------------------
81 Property Get BorderColor() As Variant
82 BorderColor = _PropertyGet(&quot;BorderColor&quot;)
83 End Property &apos; BorderColor (get)
85 Property Let BorderColor(ByVal pvValue As Variant)
86 Call _PropertySet(&quot;BorderColor&quot;, pvValue)
87 End Property &apos; BorderColor (set)
89 REM -----------------------------------------------------------------------------------------------------------------------
90 Property Get BorderStyle() As Variant
91 BorderStyle = _PropertyGet(&quot;BorderStyle&quot;)
92 End Property &apos; BorderStyle (get)
94 Property Let BorderStyle(ByVal pvValue As Variant)
95 Call _PropertySet(&quot;BorderStyle&quot;, pvValue)
96 End Property &apos; BorderStyle (set)
98 REM -----------------------------------------------------------------------------------------------------------------------
99 Property Get Cancel() As Variant
100 Cancel = _PropertyGet(&quot;Cancel&quot;)
101 End Property &apos; Cancel (get)
103 Property Let Cancel(ByVal pvValue As Variant)
104 Call _PropertySet(&quot;Cancel&quot;, pvValue)
105 End Property &apos; Cancel (set)
107 REM -----------------------------------------------------------------------------------------------------------------------
108 Property Get Caption() As Variant
109 Caption = _PropertyGet(&quot;Caption&quot;)
110 End Property &apos; Caption (get)
112 Property Let Caption(ByVal pvValue As Variant)
113 Call _PropertySet(&quot;Caption&quot;, pvValue)
114 End Property &apos; Caption (set)
116 REM -----------------------------------------------------------------------------------------------------------------------
117 Property Get ControlSource() As Variant
118 ControlSource = _PropertyGet(&quot;ControlSource&quot;)
119 End Property &apos; ControlSource (get)
121 REM -----------------------------------------------------------------------------------------------------------------------
122 Property Get ControlTipText() As Variant
123 ControlTipText = _PropertyGet(&quot;ControlTipText&quot;)
124 End Property &apos; ControlTipText (get)
126 Property Let ControlTipText(ByVal pvValue As Variant)
127 Call _PropertySet(&quot;ControlTipText&quot;, pvValue)
128 End Property &apos; ControlTipText (set)
130 REM -----------------------------------------------------------------------------------------------------------------------
131 Property Get ControlType() As Variant
132 ControlType = _PropertyGet(&quot;ControlType&quot;)
133 End Property &apos; ControlType (get)
135 REM -----------------------------------------------------------------------------------------------------------------------
136 Property Get Default() As Variant
137 Default = _PropertyGet(&quot;Default&quot;)
138 End Property &apos; Default (get)
140 Property Let Default(ByVal pvValue As Variant)
141 Call _PropertySet(&quot;Default&quot;, pvValue)
142 End Property &apos; Default (set)
144 REM -----------------------------------------------------------------------------------------------------------------------
145 Property Get DefaultValue() As Variant
146 DefaultValue = _PropertyGet(&quot;DefaultValue&quot;)
147 End Property &apos; DefaultValue (get)
149 Property Let DefaultValue(ByVal pvValue As Variant)
150 Call _PropertySet(&quot;DefaultValue&quot;, pvValue)
151 End Property &apos; DefaultValue (set)
153 REM -----------------------------------------------------------------------------------------------------------------------
154 Property Get Enabled() As Variant
155 Enabled = _PropertyGet(&quot;Enabled&quot;)
156 End Property &apos; Enabled (get)
158 Property Let Enabled(ByVal pvValue As Variant)
159 Call _PropertySet(&quot;Enabled&quot;, pvValue)
160 End Property &apos; Enabled (set)
162 REM -----------------------------------------------------------------------------------------------------------------------
163 Property Get FontBold() As Variant
164 FontBold = _PropertyGet(&quot;FontBold&quot;)
165 End Property &apos; FontBold (get)
167 Property Let FontBold(ByVal pvValue As Variant)
168 Call _PropertySet(&quot;FontBold&quot;, pvValue)
169 End Property &apos; FontBold (set)
171 REM -----------------------------------------------------------------------------------------------------------------------
172 Property Get FontItalic() As Variant
173 FontItalic = _PropertyGet(&quot;FontItalic&quot;)
174 End Property &apos; FontItalic (get)
176 Property Let FontItalic(ByVal pvValue As Variant)
177 Call _PropertySet(&quot;FontItalic&quot;, pvValue)
178 End Property &apos; FontItalic (set)
180 REM -----------------------------------------------------------------------------------------------------------------------
181 Property Get FontName() As Variant
182 FontName = _PropertyGet(&quot;FontName&quot;)
183 End Property &apos; FontName (get)
185 Property Let FontName(ByVal pvValue As Variant)
186 Call _PropertySet(&quot;FontName&quot;, pvValue)
187 End Property &apos; FontName (set)
189 REM -----------------------------------------------------------------------------------------------------------------------
190 Property Get FontSize() As Variant
191 FontSize = _PropertyGet(&quot;FontSize&quot;)
192 End Property &apos; FontSize (get)
194 Property Let FontSize(ByVal pvValue As Variant)
195 Call _PropertySet(&quot;FontSize&quot;, pvValue)
196 End Property &apos; FontSize (set)
198 REM -----------------------------------------------------------------------------------------------------------------------
199 Property Get FontUnderline() As Variant
200 FontUnderline = _PropertyGet(&quot;FontUnderline&quot;)
201 End Property &apos; FontUnderline (get)
203 Property Let FontUnderline(ByVal pvValue As Variant)
204 Call _PropertySet(&quot;FontUnderline&quot;, pvValue)
205 End Property &apos; FontUnderline (set)
207 REM -----------------------------------------------------------------------------------------------------------------------
208 Property Get FontWeight() As Variant
209 FontWeight = _PropertyGet(&quot;FontWeight&quot;)
210 End Property &apos; FontWeight (get)
212 Property Let FontWeight(ByVal pvValue As Variant)
213 Call _PropertySet(&quot;FontWeight&quot;, pvValue)
214 End Property &apos; FontWeight (set)
216 REM -----------------------------------------------------------------------------------------------------------------------
217 Property Get ForeColor() As Variant
218 ForeColor = _PropertyGet(&quot;ForeColor&quot;)
219 End Property &apos; ForeColor (get)
221 Property Let ForeColor(ByVal pvValue As Variant)
222 Call _PropertySet(&quot;ForeColor&quot;, pvValue)
223 End Property &apos; ForeColor (set)
225 REM -----------------------------------------------------------------------------------------------------------------------
226 Property Get Form() As Variant
227 Form = _PropertyGet(&quot;Form&quot;)
228 End Property &apos; Form (get)
230 REM -----------------------------------------------------------------------------------------------------------------------
231 Property Get Format() As Variant
232 Format = _PropertyGet(&quot;Format&quot;)
233 End Property &apos; Format (get)
235 Property Let Format(ByVal pvValue As Variant)
236 Call _PropertySet(&quot;Format&quot;, pvValue)
237 End Property &apos; Format (set)
239 REM -----------------------------------------------------------------------------------------------------------------------
240 Property Get ItemData(ByVal Optional pvIndex As Variant) As Variant
241 If IsMissing(pvIndex) Then ItemData = _PropertyGet(&quot;ItemData&quot;) Else ItemData = _PropertyGet(&quot;ItemData&quot;, pvIndex)
242 End Property &apos; ItemData (get)
244 REM -----------------------------------------------------------------------------------------------------------------------
245 Property Get ListCount() As Variant
246 ListCount = _PropertyGet(&quot;ListCount&quot;)
247 End Property &apos; ListCount (get)
249 REM -----------------------------------------------------------------------------------------------------------------------
250 Property Get ListIndex() As Variant
251 ListIndex = _PropertyGet(&quot;ListIndex&quot;)
252 End Property &apos; ListIndex (get)
254 Property Let ListIndex(ByVal pvValue As Variant)
255 Call _PropertySet(&quot;ListIndex&quot;, pvValue)
256 End Property &apos; ListIndex (set)
258 REM -----------------------------------------------------------------------------------------------------------------------
259 Property Get Locked() As Variant
260 Locked = _PropertyGet(&quot;Locked&quot;)
261 End Property &apos; Locked (get)
263 Property Let Locked(ByVal pvValue As Variant)
264 Call _PropertySet(&quot;Locked&quot;, pvValue)
265 End Property &apos; Locked (set)
267 REM -----------------------------------------------------------------------------------------------------------------------
268 Property Get MultiSelect() As Variant
269 MultiSelect = _PropertyGet(&quot;MultiSelect&quot;)
270 End Property &apos; MultiSelect (get)
272 Property Let MultiSelect(ByVal pvValue As Variant)
273 Call _PropertySet(&quot;MultiSelect&quot;, pvValue)
274 End Property &apos; MultiSelect (set)
276 REM -----------------------------------------------------------------------------------------------------------------------
277 Property Get Name() As String
278 Name = _PropertyGet(&quot;Name&quot;)
279 End Property &apos; Name (get)
281 Public Function pName() As String &apos; For compatibility with &lt; V0.9.0
282 pName = _PropertyGet(&quot;Name&quot;)
283 End Function &apos; pName (get)
285 REM -----------------------------------------------------------------------------------------------------------------------
286 Property Get ObjectType() As String
287 ObjectType = _PropertyGet(&quot;ObjectType&quot;)
288 End Property &apos; ObjectType (get)
290 REM -----------------------------------------------------------------------------------------------------------------------
291 Property Get OnActionPerformed() As Variant
292 OnActionPerformed = _PropertyGet(&quot;OnActionPerformed&quot;)
293 End Property &apos; OnActionPerformed (get)
295 Property Let OnActionPerformed(ByVal pvValue As Variant)
296 Call _PropertySet(&quot;OnActionPerformed&quot;, pvValue)
297 End Property &apos; OnActionPerformed (set)
299 REM -----------------------------------------------------------------------------------------------------------------------
300 Property Get OnAdjustmentValueChanged() As Variant
301 OnAdjustmentValueChanged = _PropertyGet(&quot;OnAdjustmentValueChanged&quot;)
302 End Property &apos; OnAdjustmentValueChanged (get)
304 Property Let OnAdjustmentValueChanged(ByVal pvValue As Variant)
305 Call _PropertySet(&quot;OnAdjustmentValueChanged&quot;, pvValue)
306 End Property &apos; OnAdjustmentValueChanged (set)
308 REM -----------------------------------------------------------------------------------------------------------------------
309 Property Get OnApproveAction() As Variant
310 OnApproveAction = _PropertyGet(&quot;OnApproveAction&quot;)
311 End Property &apos; OnApproveAction (get)
313 Property Let OnApproveAction(ByVal pvValue As Variant)
314 Call _PropertySet(&quot;OnApproveAction&quot;, pvValue)
315 End Property &apos; OnApproveAction (set)
317 REM -----------------------------------------------------------------------------------------------------------------------
318 Property Get OnApproveReset() As Variant
319 OnApproveReset = _PropertyGet(&quot;OnApproveReset&quot;)
320 End Property &apos; OnApproveReset (get)
322 Property Let OnApproveReset(ByVal pvValue As Variant)
323 Call _PropertySet(&quot;OnApproveReset&quot;, pvValue)
324 End Property &apos; OnApproveReset (set)
326 REM -----------------------------------------------------------------------------------------------------------------------
327 Property Get OnApproveUpdate() As Variant
328 OnApproveUpdate = _PropertyGet(&quot;OnApproveUpdate&quot;)
329 End Property &apos; OnApproveUpdate (get)
331 Property Let OnApproveUpdate(ByVal pvValue As Variant)
332 Call _PropertySet(&quot;OnApproveUpdate&quot;, pvValue)
333 End Property &apos; OnApproveUpdate (set)
335 REM -----------------------------------------------------------------------------------------------------------------------
336 Property Get OnChanged() As Variant
337 OnChanged = _PropertyGet(&quot;OnChanged&quot;)
338 End Property &apos; OnChanged (get)
340 Property Let OnChanged(ByVal pvValue As Variant)
341 Call _PropertySet(&quot;OnChanged&quot;, pvValue)
342 End Property &apos; OnChanged (set)
344 REM -----------------------------------------------------------------------------------------------------------------------
345 Property Get OnErrorOccurred() As Variant
346 OnErrorOccurred = _PropertyGet(&quot;OnErrorOccurred&quot;)
347 End Property &apos; OnErrorOccurred (get)
349 Property Let OnErrorOccurred(ByVal pvValue As Variant)
350 Call _PropertySet(&quot;OnErrorOccurred&quot;, pvValue)
351 End Property &apos; OnErrorOccurred (set)
353 REM -----------------------------------------------------------------------------------------------------------------------
354 Property Get OnFocusGained() As Variant
355 OnFocusGained = _PropertyGet(&quot;OnFocusGained&quot;)
356 End Property &apos; OnFocusGained (get)
358 Property Let OnFocusGained(ByVal pvValue As Variant)
359 Call _PropertySet(&quot;OnFocusGained&quot;, pvValue)
360 End Property &apos; OnFocusGained (set)
362 REM -----------------------------------------------------------------------------------------------------------------------
363 Property Get OnFocusLost() As Variant
364 OnFocusLost = _PropertyGet(&quot;OnFocusLost&quot;)
365 End Property &apos; OnFocusLost (get)
367 Property Let OnFocusLost(ByVal pvValue As Variant)
368 Call _PropertySet(&quot;OnFocusLost&quot;, pvValue)
369 End Property &apos; OnFocusLost (set)
371 REM -----------------------------------------------------------------------------------------------------------------------
372 Property Get OnItemStateChanged() As Variant
373 OnItemStateChanged = _PropertyGet(&quot;OnItemStateChanged&quot;)
374 End Property &apos; OnItemStateChanged (get)
376 Property Let OnItemStateChanged(ByVal pvValue As Variant)
377 Call _PropertySet(&quot;OnItemStateChanged&quot;, pvValue)
378 End Property &apos; OnItemStateChanged (set)
380 REM -----------------------------------------------------------------------------------------------------------------------
381 Property Get OnKeyPressed() As Variant
382 OnKeyPressed = _PropertyGet(&quot;OnKeyPressed&quot;)
383 End Property &apos; OnKeyPressed (get)
385 Property Let OnKeyPressed(ByVal pvValue As Variant)
386 Call _PropertySet(&quot;OnKeyPressed&quot;, pvValue)
387 End Property &apos; OnKeyPressed (set)
389 REM -----------------------------------------------------------------------------------------------------------------------
390 Property Get OnKeyReleased() As Variant
391 OnKeyReleased = _PropertyGet(&quot;OnKeyReleased&quot;)
392 End Property &apos; OnKeyReleased (get)
394 Property Let OnKeyReleased(ByVal pvValue As Variant)
395 Call _PropertySet(&quot;OnKeyReleased&quot;, pvValue)
396 End Property &apos; OnKeyReleased (set)
398 REM -----------------------------------------------------------------------------------------------------------------------
399 Property Get OnMouseDragged() As Variant
400 OnMouseDragged = _PropertyGet(&quot;OnMouseDragged&quot;)
401 End Property &apos; OnMouseDragged (get)
403 Property Let OnMouseDragged(ByVal pvValue As Variant)
404 Call _PropertySet(&quot;OnMouseDragged&quot;, pvValue)
405 End Property &apos; OnMouseDragged (set)
407 REM -----------------------------------------------------------------------------------------------------------------------
408 Property Get OnMouseEntered() As Variant
409 OnMouseEntered = _PropertyGet(&quot;OnMouseEntered&quot;)
410 End Property &apos; OnMouseEntered (get)
412 Property Let OnMouseEntered(ByVal pvValue As Variant)
413 Call _PropertySet(&quot;OnMouseEntered&quot;, pvValue)
414 End Property &apos; OnMouseEntered (set)
416 REM -----------------------------------------------------------------------------------------------------------------------
417 Property Get OnMouseExited() As Variant
418 OnMouseExited = _PropertyGet(&quot;OnMouseExited&quot;)
419 End Property &apos; OnMouseExited (get)
421 Property Let OnMouseExited(ByVal pvValue As Variant)
422 Call _PropertySet(&quot;OnMouseExited&quot;, pvValue)
423 End Property &apos; OnMouseExited (set)
425 REM -----------------------------------------------------------------------------------------------------------------------
426 Property Get OnMouseMoved() As Variant
427 OnMouseMoved = _PropertyGet(&quot;OnMouseMoved&quot;)
428 End Property &apos; OnMouseMoved (get)
430 Property Let OnMouseMoved(ByVal pvValue As Variant)
431 Call _PropertySet(&quot;OnMouseMoved&quot;, pvValue)
432 End Property &apos; OnMouseMoved (set)
434 REM -----------------------------------------------------------------------------------------------------------------------
435 Property Get OnMousePressed() As Variant
436 OnMousePressed = _PropertyGet(&quot;OnMousePressed&quot;)
437 End Property &apos; OnMousePressed (get)
439 Property Let OnMousePressed(ByVal pvValue As Variant)
440 Call _PropertySet(&quot;OnMousePressed&quot;, pvValue)
441 End Property &apos; OnMousePressed (set)
443 REM -----------------------------------------------------------------------------------------------------------------------
444 Property Get OnMouseReleased() As Variant
445 OnMouseReleased = _PropertyGet(&quot;OnMouseReleased&quot;)
446 End Property &apos; OnMouseReleased (get)
448 Property Let OnMouseReleased(ByVal pvValue As Variant)
449 Call _PropertySet(&quot;OnMouseReleased&quot;, pvValue)
450 End Property &apos; OnMouseReleased (set)
452 REM -----------------------------------------------------------------------------------------------------------------------
453 Property Get OnResetted() As Variant
454 OnResetted = _PropertyGet(&quot;OnResetted&quot;)
455 End Property &apos; OnResetted (get)
457 Property Let OnResetted(ByVal pvValue As Variant)
458 Call _PropertySet(&quot;OnResetted&quot;, pvValue)
459 End Property &apos; OnResetted (set)
461 REM -----------------------------------------------------------------------------------------------------------------------
462 Property Get OnTextChanged() As Variant
463 OnTextChanged = _PropertyGet(&quot;OnTextChanged&quot;)
464 End Property &apos; OnTextChanged (get)
466 Property Let OnTextChanged(ByVal pvValue As Variant)
467 Call _PropertySet(&quot;OnTextChanged&quot;, pvValue)
468 End Property &apos; OnTextChanged (set)
470 REM -----------------------------------------------------------------------------------------------------------------------
471 Property Get OnUpdated() As Variant
472 OnUpdated = _PropertyGet(&quot;OnUpdated&quot;)
473 End Property &apos; OnUpdated (get)
475 Property Let OnUpdated(ByVal pvValue As Variant)
476 Call _PropertySet(&quot;OnUpdated&quot;, pvValue)
477 End Property &apos; OnUpdated (set)
479 REM -----------------------------------------------------------------------------------------------------------------------
480 Property Get OptionValue() As Variant
481 OptionValue = _PropertyGet(&quot;OptionValue&quot;)
482 End Property &apos; OptionValue (get)
484 Property Let OptionValue(ByVal pvValue As Variant)
485 Call _PropertySet(&quot;OptionValue&quot;, pvValue)
486 End Property &apos; OptionValue (set)
488 REM -----------------------------------------------------------------------------------------------------------------------
489 Property Get Page() As Variant
490 Page = _PropertyGet(&quot;Page&quot;)
491 End Property &apos; Page (get)
493 Property Let Page(ByVal pvValue As Variant)
494 Call _PropertySet(&quot;Page&quot;, pvValue)
495 End Property &apos; Page (set)
497 REM -----------------------------------------------------------------------------------------------------------------------
498 Public Function Parent() As Object
499 Parent = _PropertyGet(&quot;Parent&quot;)
500 End Function &apos; Parent (get) V0.9.1
502 REM -----------------------------------------------------------------------------------------------------------------------
503 Property Get Picture() As Variant
504 Picture = _PropertyGet(&quot;Picture&quot;)
505 End Property &apos; Picture (get)
507 Property Let Picture(ByVal pvValue As Variant)
508 Call _PropertySet(&quot;Picture&quot;, pvValue)
509 End Property &apos; Picture (set) V1.5.0
511 REM -----------------------------------------------------------------------------------------------------------------------
512 Public Function Properties(ByVal Optional pvIndex As Variant) As Variant
513 &apos; Return
514 &apos; a Collection object if pvIndex absent
515 &apos; a Property object otherwise
517 Utils._SetCalledSub(&quot;Control.Properties&quot;)
518 Dim vProperty As Variant, vPropertiesList() As Variant, sObject As String
519 vPropertiesList = _PropertiesList()
520 sObject = Utils._PCase(_Type)
521 If IsMissing(pvIndex) Then
522 vProperty = PropertiesGet._Properties(sObject, _Shortcut, vPropertiesList)
523 Else
524 vProperty = PropertiesGet._Properties(sObject, _Shortcut, vPropertiesList, pvIndex)
525 vProperty._Value = _PropertyGet(vPropertiesList(pvIndex))
526 End If
528 Exit_Function:
529 Set Properties = vProperty
530 Utils._ResetCalledSub(&quot;Control.Properties&quot;)
531 Exit Function
532 End Function &apos; Properties
534 REM -----------------------------------------------------------------------------------------------------------------------
535 Property Get Required() As Variant
536 Required = _PropertyGet(&quot;Required&quot;)
537 End Property &apos; Required (get)
539 Property Let Required(ByVal pvValue As Variant)
540 Call _PropertySet(&quot;Required&quot;, pvValue)
541 End Property &apos; Required (set)
543 REM -----------------------------------------------------------------------------------------------------------------------
544 Property Get RowSource() As Variant
545 RowSource = _PropertyGet(&quot;RowSource&quot;)
546 End Property &apos; RowSource (get)
548 Property Let RowSource(ByVal pvValue As Variant)
549 Call _PropertySet(&quot;RowSource&quot;, pvValue)
550 End Property &apos; RowSource (set)
552 REM -----------------------------------------------------------------------------------------------------------------------
553 Property Get RowSourceType() As Variant
554 RowSourceType = _PropertyGet(&quot;RowSourceType&quot;)
555 End Property &apos; RowSourceType (get)
557 Property Let RowSourceType(ByVal pvValue As Variant)
558 Call _PropertySet(&quot;RowSourceType&quot;, pvValue)
559 End Property &apos; RowSourceType (set)
561 REM -----------------------------------------------------------------------------------------------------------------------
562 Property Get Selected(ByVal Optional pvIndex As Variant) As Variant
563 If IsMissing(pvIndex) Then Selected = _PropertyGet(&quot;Selected&quot;) Else Selected = _PropertyGet(&quot;Selected&quot;, pvIndex)
564 End Property &apos; Selected (get)
566 Property Let Selected(ByVal pvValue As Variant) &apos; , ByVal Optional pvIndex As Variant)
567 &apos; If IsMissing(pvIndex) Then Call _PropertySet(&quot;Selected&quot;, pvValue) Else Call _PropertySet(&quot;Selected&quot;, pvValue, pvIndex)
568 Call _PropertySet(&quot;Selected&quot;, pvValue)
569 End Property &apos; Selected (set)
571 Public Function SelectedI(ByVal pvValue As variant, ByVal pvIndex As Variant)
572 Call _PropertySet(&quot;Selected&quot;, pvValue, pvIndex)
573 End Function
575 REM -----------------------------------------------------------------------------------------------------------------------
576 Property Get SelLength() As Variant
577 SelLength = _PropertyGet(&quot;SelLength&quot;)
578 End Property &apos; SelLength (get)
580 Property Let SelLength(ByVal pvValue As Variant)
581 Call _PropertySet(&quot;SelLength&quot;, pvValue)
582 End Property &apos; SelLength (set)
584 REM -----------------------------------------------------------------------------------------------------------------------
585 Property Get SelStart() As Variant
586 SelStart = _PropertyGet(&quot;SelStart&quot;)
587 End Property &apos; SelStart (get)
589 Property Let SelStart(ByVal pvValue As Variant)
590 Call _PropertySet(&quot;SelStart&quot;, pvValue)
591 End Property &apos; SelStart (set)
593 REM -----------------------------------------------------------------------------------------------------------------------
594 Property Get SelText() As Variant
595 SelText = _PropertyGet(&quot;SelText&quot;)
596 End Property &apos; SelText (get)
598 Property Let SelText(ByVal pvValue As Variant)
599 Call _PropertySet(&quot;SelText&quot;, pvValue)
600 End Property &apos; SelText (set)
602 REM -----------------------------------------------------------------------------------------------------------------------
603 Property Get SpecialEffect() As Variant
604 SpecialEffect = _PropertyGet(&quot;SpecialEffect&quot;)
605 End Property &apos; SpecialEffect (get)
607 Property Let SpecialEffect(ByVal pvValue As Variant)
608 Call _PropertySet(&quot;SpecialEffect&quot;, pvValue)
609 End Property &apos; SpecialEffect (set)
611 REM -----------------------------------------------------------------------------------------------------------------------
612 Property Get SubType() As Variant
613 SubType = _PropertyGet(&quot;SubType&quot;)
614 End Property &apos; SubType (get)
616 REM -----------------------------------------------------------------------------------------------------------------------
617 Property Get TabIndex() As Variant
618 TabIndex = _PropertyGet(&quot;TabIndex&quot;)
619 End Property &apos; TabIndex (get)
621 Property Let TabIndex(ByVal pvValue As Variant)
622 Call _PropertySet(&quot;TabIndex&quot;, pvValue)
623 End Property &apos; TabIndex (set)
625 REM -----------------------------------------------------------------------------------------------------------------------
626 Property Get TabStop() As Variant
627 TabStop = _PropertyGet(&quot;TabStop&quot;)
628 End Property &apos; TabStop (get)
630 Property Let TabStop(ByVal pvValue As Variant)
631 Call _PropertySet(&quot;TabStop&quot;, pvValue)
632 End Property &apos; TabStop (set)
634 REM -----------------------------------------------------------------------------------------------------------------------
635 Property Get Tag() As Variant
636 Tag = _PropertyGet(&quot;Tag&quot;)
637 End Property &apos; Tag (get)
639 Property Let Tag(ByVal pvValue As Variant)
640 Call _PropertySet(&quot;Tag&quot;, pvValue)
641 End Property &apos; Tag (set)
643 REM -----------------------------------------------------------------------------------------------------------------------
644 Property Get Text() As Variant
645 Text = _PropertyGet(&quot;Text&quot;)
646 End Property &apos; Text (get)
648 Public Function pText() As variant
649 pText = _PropertyGet(&quot;Text&quot;)
650 End Function &apos; pText (get)
652 REM -----------------------------------------------------------------------------------------------------------------------
653 Property Get TextAlign() As Variant
654 TextAlign = _PropertyGet(&quot;TextAlign&quot;)
655 End Property &apos; TextAlign (get)
657 Property Let TextAlign(ByVal pvValue As Variant)
658 Call _PropertySet(&quot;TextAlign&quot;, pvValue)
659 End Property &apos; TextAlign (set)
661 REM -----------------------------------------------------------------------------------------------------------------------
662 Property Get TripleState() As Variant
663 TripleState = _PropertyGet(&quot;TripleState&quot;)
664 End Property &apos; TripleState (get)
666 Property Let TripleState(ByVal pvValue As Variant)
667 Call _PropertySet(&quot;TripleState&quot;, pvValue)
668 End Property &apos; TripleState (set)
670 REM -----------------------------------------------------------------------------------------------------------------------
671 Property Get Value() As Variant
672 Value = _PropertyGet(&quot;Value&quot;)
673 End Property &apos; Value (get)
675 Property Let Value(ByVal pvValue As Variant)
676 Call _PropertySet(&quot;Value&quot;, pvValue)
677 End Property &apos; Value (set)
679 REM -----------------------------------------------------------------------------------------------------------------------
680 Property Get Visible() As Variant
681 Visible = _PropertyGet(&quot;Visible&quot;)
682 End Property &apos; Visible (get)
684 Property Let Visible(ByVal pvValue As Variant)
685 Call _PropertySet(&quot;Visible&quot;, pvValue)
686 End Property &apos; Visible (set)
688 REM -----------------------------------------------------------------------------------------------------------------------
689 REM --- CLASS METHODS ---
690 REM -----------------------------------------------------------------------------------------------------------------------
692 Public Function AddItem(ByVal Optional pvItem As Variant, ByVal Optional pvIndex) As Boolean
693 &apos; Add an item in a Listbox
695 Utils._SetCalledSub(&quot;Control.AddItem&quot;)
696 AddItem = False
697 If _ErrorHandler() Then On Local Error Goto Error_Function
699 If IsMissing(pvItem) Then Call _TraceArguments()
700 If IsMissing(pvIndex) Then pvIndex = -1
702 Dim iArgNr As Integer
703 Select Case UCase(_A2B_.CalledSub)
704 Case UCase(&quot;AddItem&quot;) : iArgNr = 1
705 Case UCase(&quot;Control.AddItem&quot;) : iArgNr = 0
706 End Select
708 If Not Utils._CheckArgument(pvItem, iArgNr + 1, vbString) Then Goto Exit_Function
709 If Not Utils._CheckArgument(pvIndex, iArgNr + 2, Utils._AddNumeric()) Then Goto Exit_Function
710 If _SubType &lt;&gt; CTLLISTBOX Then Goto Error_Control
711 If _ParentType &lt;&gt; CTLPARENTISDIALOG Then
712 If ControlModel.ListSourceType &lt;&gt; com.sun.star.form.ListSourceType.VALUELIST Then Goto Error_Control
713 End If
715 Dim vRowSource() As Variant, iCount As Integer, i As Integer
716 If IsArray(ControlModel.StringItemList) Then vRowSource = ControlModel.StringItemList Else vRowSource = Array(ControlModel.StringItemList)
717 iCount = UBound(vRowSource)
718 If pvIndex &lt; -1 Or pvIndex &gt; iCount + 1 Then Goto Error_Index
719 ReDim Preserve vRowSource(0 To iCount + 1)
720 If pvIndex = -1 Then pvIndex = iCount + 1
721 For i = iCount + 1 To pvIndex + 1 Step -1
722 vRowSource(i) = vRowSource(i - 1)
723 Next i
724 vRowSource(pvIndex) = pvItem
726 If _ParentType &lt;&gt; CTLPARENTISDIALOG Then
727 ControlModel.ListSource = vRowSource()
728 End If
729 ControlModel.StringItemList = vRowSource()
730 AddItem = True
732 Exit_Function:
733 Utils._ResetCalledSub(&quot;Control.AddItem&quot;)
734 Exit Function
735 Error_Function:
736 TraceError(TRACEABORT, Err, &quot;Control.AddItem&quot;, Erl)
737 AddItem = False
738 GoTo Exit_Function
739 Error_Control:
740 TraceError(TRACEFATAL, ERRMETHOD, Utils._CalledSub(), 0, , &quot;Control.AddItem&quot;)
741 AddItem = False
742 Goto Exit_Function
743 Error_Index:
744 TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), False, ,Array(iArgNr + 2,pvIndex))
745 AddItem = False
746 Goto Exit_Function
747 End Function &apos; AddItem V0.9.1
749 REM -----------------------------------------------------------------------------------------------------------------------
750 Public Function Controls(Optional ByVal pvIndex As Variant) As Variant
751 &apos; Return a Control object with name or index = pvIndex
753 Const cstThisSub = &quot;Control.Controls&quot;
754 If _ErrorHandler() Then On Local Error Goto Error_Function
755 Utils._SetCalledSub(cstThisSub)
757 Dim ocControl As Variant, sParentShortcut As String, iControlCount As Integer
758 Dim oCounter As Variant, sControls() As Variant, i As Integer, bFound As Boolean, sIndex As String
759 Dim j As Integer, oView As Object
761 If _SubType &lt;&gt; CTLGRIDCONTROL Then Goto Trace_Error_Context
762 Set ocControl = Nothing
763 iControlCount = ControlModel.getCount()
765 If IsMissing(pvIndex) Then &apos; No argument, return Collection pseudo-object
766 Set oCounter = New Collect
767 oCounter._CollType = COLLCONTROLS
768 oCounter._ParentType = OBJCONTROL
769 oCounter._ParentName = _Shortcut
770 oCounter._Count = iControlCount
771 Set Controls = oCounter
772 Goto Exit_Function
773 End If
775 If Not Utils._CheckArgument(pvIndex, 1, Utils._AddNumeric(vbString)) Then Goto Exit_Function
777 &apos; Start building the ocControl object
778 &apos; Determine exact name
779 Set ocControl = New Control
780 ocControl._ParentType = CTLPARENTISGRID
781 sParentShortcut = _Shortcut
782 sControls() = ControlModel.getElementNames()
784 Select Case VarType(pvIndex)
785 Case vbInteger, vbLong, vbSingle, vbDouble, vbCurrency, vbBigint, vbDecimal
786 If pvIndex &lt; 0 Or pvIndex &gt; iControlCount - 1 Then Goto Trace_Error_Index
787 ocControl._Name = sControls(pvIndex)
788 Case vbString &apos; Check control name validity (non case sensitive)
789 bFound = False
790 sIndex = UCase(Utils._Trim(pvIndex))
791 For i = 0 To iControlCount - 1
792 If UCase(sControls(i)) = sIndex Then
793 bFound = True
794 Exit For
795 End If
796 Next i
797 If bFound Then ocControl._Name = sControls(i) Else Goto Trace_NotFound
798 End Select
800 With ocControl
801 ._Shortcut = sParentShortcut &amp; &quot;!&quot; &amp; Utils._Surround(._Name)
802 Set .ControlModel = ControlModel.getByName(._Name)
803 ._ImplementationName = .ControlModel.ColumnServiceName &apos; getImplementationName aborts for subcontrols !?
804 ._FormComponent = ParentComponent
805 ._MainForm = _MainForm
806 If Utils._hasUNOProperty(.ControlModel, &quot;ClassId&quot;) Then ._ClassId = .ControlModel.ClassId
807 &apos; Complex bypass to find View of grid subcontrols !
808 If Not IsNull(ControlView) Then &apos; Anticipate absence of ControlView in grid controls when edit mode
809 For i = 0 to ControlView.getCount() - 1
810 Set oView = ControlView.GetByIndex(i)
811 If Not IsNull(oView) Then
812 If oView.getModel.Name = ._Name Then
813 Set .ControlView = oView
814 Exit For
815 End If
816 End If
817 Next i
818 End If
820 ._Initialize()
821 ._DocEntry = _DocEntry
822 ._DbEntry = _DbEntry
823 End With
824 Set Controls = ocControl
826 Exit_Function:
827 Utils._ResetCalledSub(cstThisSub)
828 Exit Function
829 Trace_Error_Index:
830 TraceError(TRACEFATAL, ERRCOLLECTION, Utils._CalledSub(), 0, 1)
831 Set Controls = Nothing
832 Goto Exit_Function
833 Trace_NotFound:
834 TraceError(TRACEFATAL, ERRCONTROLNOTFOUND, Utils._CalledSub(), 0, , Array(pvIndex, _Name))
835 Set Controls = Nothing
836 Goto Exit_Function
837 Trace_Error_Context:
838 TraceError(TRACEFATAL, ERRMETHOD, Utils._CalledSub(), 0, , &quot;Grid.Controls&quot;)
839 Set Controls = Nothing
840 Goto Exit_Function
841 Error_Function:
842 TraceError(TRACEABORT, Err, cstThisSub, Erl)
843 Set Controls = Nothing
844 GoTo Exit_Function
845 End Function &apos; Controls
847 REM -----------------------------------------------------------------------------------------------------------------------
848 Public Function getProperty(Optional ByVal pvProperty As Variant, ByVal Optional pvIndex As Variant) As Variant
849 &apos; Return property value of psProperty property name
851 Utils._SetCalledSub(&quot;Control.getProperty&quot;)
852 If IsMissing(pvProperty) Then Call _TraceArguments()
853 If IsMissing(pvIndex) Then
854 getProperty = _PropertyGet(pvProperty)
855 Else
856 getProperty = _PropertyGet(pvProperty, pvIndex)
857 End If
858 Utils._ResetCalledSub(&quot;Control.getProperty&quot;)
860 End Function &apos; getProperty
862 REM -----------------------------------------------------------------------------------------------------------------------
863 Public Function hasProperty(ByVal Optional pvProperty As Variant) As Boolean
864 &apos; Return True if object has a valid property called pvProperty (case-insensitive comparison !)
866 If IsMissing(pvProperty) Then hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList()) Else hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList(), pvProperty)
867 Exit Function
869 End Function &apos; hasProperty
871 REM -----------------------------------------------------------------------------------------------------------------------
872 Public Function RemoveItem(ByVal Optional pvIndex) As Boolean
873 &apos; Remove an item from a Listbox
874 &apos; Index may be a string value or an index-position
876 Utils._SetCalledSub(&quot;Control.RemoveItem&quot;)
877 If _ErrorHandler() Then On Local Error Goto Error_Function
879 If IsMissing(pvIndex) Then Call _TraceArguments()
880 Dim iArgNr As Integer
881 Select Case UCase(_A2B_.CalledSub)
882 Case UCase(&quot;RemoveItem&quot;) : iArgNr = 1
883 Case UCase(&quot;Control.RemoveItem&quot;) : iArgNr = 0
884 End Select
885 If Not Utils._CheckArgument(pvIndex, iArgNr + 1, Utils._AddNumeric(vbString)) Then Goto Exit_Function
886 If _SubType &lt;&gt; CTLLISTBOX Then Goto Error_Control
887 If _ParentType &lt;&gt; CTLPARENTISDIALOG Then
888 If ControlModel.ListSourceType &lt;&gt; com.sun.star.form.ListSourceType.VALUELIST Then Goto Error_Control
889 End If
891 Dim vRowSource() As Variant, iCount As Integer, i As Integer, j As integer, bFound As Boolean
892 If IsArray(ControlModel.StringItemList) Then vRowSource = ControlModel.StringItemList Else vRowSource = Array(ControlModel.StringItemList)
893 iCount = UBound(vRowSource)
895 Select Case VarType(pvIndex)
896 Case vbString
897 bFound = False
898 For i = 0 To iCount
899 If vRowSource(i) = pvIndex Then
900 For j = i To iCount - 1
901 vRowSource(j) = vRowSource(j + 1)
902 Next j
903 bFound = True
904 Exit For &apos; Remove only 1st occurrence of string
905 End If
906 Next i
907 Case Else
908 If pvIndex &lt; 0 Or pvIndex &gt; iCount Then Goto Error_Index
909 For i = pvIndex To iCount - 1
910 vRowSource(i) = vRowSource(i + 1)
911 Next i
912 bFound = True
913 End Select
915 If bFound Then
916 If iCount &gt; 0 Then &apos; https://forum.openoffice.org/en/forum/viewtopic.php?f=47&amp;t=75008
917 ReDim Preserve vRowSource(0 To iCount - 1)
918 Else
919 vRowSource = Array()
920 End If
921 If _ParentType &lt;&gt; CTLPARENTISDIALOG Then
922 ControlModel.ListSource = vRowSource()
923 End If
924 ControlModel.StringItemList = vRowSource()
925 RemoveItem = True
926 Else
927 RemoveItem = False
928 End If
930 Exit_Function:
931 Utils._ResetCalledSub(&quot;Control.RemoveItem&quot;)
932 Exit Function
933 Error_Function:
934 TraceError(TRACEABORT, Err, &quot;Control.RemoveItem&quot;, Erl)
935 RemoveItem = False
936 GoTo Exit_Function
937 Error_Control:
938 TraceError(TRACEFATAL, ERRMETHOD, Utils._CalledSub(), 0, 1, &quot;Control.RemoveItem&quot;)
939 RemoveItem = False
940 Goto Exit_Function
941 Error_Index:
942 TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), False, ,Array(2, pvIndex))
943 RemoveItem = False
944 Goto Exit_Function
945 End Function &apos; RemoveItem V0.9.1
947 REM -----------------------------------------------------------------------------------------------------------------------
948 Public Function Requery() As Boolean
949 &apos; Refresh data displayed in a form, subform, combobox or listbox
950 Utils._SetCalledSub(&quot;Control.Requery&quot;)
951 If _ErrorHandler() Then On Local Error Goto Error_Function
952 Requery = False
954 Select Case _SubType
955 Case CTLCOMBOBOX, CTLLISTBOX
956 If Utils._InList(ControlModel.ListSourceType, Array( _
957 com.sun.star.form.ListSourceType.QUERY _
958 , com.sun.star.form.ListSourceType.TABLE _
959 , com.sun.star.form.ListSourceType.TABLEFIELDS _
960 , com.sun.star.form.ListSourceType.SQL _
961 , com.sun.star.form.ListSourceType.SQLPASSTHROUGH _
962 )) Then
963 ControlModel.refresh()
964 End If
965 Case Else
966 Goto Error_Control
967 End Select
968 Requery = True
970 Exit_Function:
971 Utils._ResetCalledSub(&quot;Control.Requery&quot;)
972 Exit Function
973 Error_Control:
974 TraceError(TRACEFATAL, ERRMETHOD, Utils._CalledSub(), 0, 1, &quot;Control.Requery&quot;)
975 Requery = False
976 Goto Exit_Function
977 Error_Function:
978 TraceError(TRACEABORT, Err, &quot;Control.Requery&quot;, Erl)
979 GoTo Exit_Function
980 End Function &apos; Requery
982 REM -----------------------------------------------------------------------------------------------------------------------
983 Public Function setFocus() As Boolean
984 &apos; Execute setFocus method
985 Utils._SetCalledSub(&quot;Control.setFocus&quot;)
986 If _ErrorHandler() Then On Local Error Goto Error_Function
987 setFocus = False
989 Dim i As Integer, j As Integer, iColPosition As Integer
990 Dim ocControl As Object, ocGrid As Variant, oGridModel As Object
992 If IsNull(ControlView) Then GoTo Exit_Function
993 If _ParentType = CTLPARENTISGRID Then &apos;setFocus method does not work on controlviews in grid ?!?
994 &apos; Find column position of control
995 iColPosition = -1
996 ocGrid = getObject(_getUpperShortcut(_Shortcut, _Name)) &apos; return containing grid
997 Set oGridModel = ocGrid.ControlModel
998 j = -1
999 For i = 0 To oGridModel.Count - 1
1000 Set ocControl = oGridModel.GetByIndex(i)
1001 If Not ocControl.Hidden Then j = j + 1 &apos; Skip if hidden
1002 If oGridModel.GetByIndex(i).Name = _Name Then
1003 iColPosition = j
1004 Exit For
1005 End If
1006 Next i
1007 If iColPosition &gt;= 0 Then
1008 ocGrid.ControlView.setFocus() &apos;Set first focus on grid itself
1009 ocGrid.ControlView.setCurrentColumnPosition(iColPosition) &apos;Deprecated but no alternative found
1010 Else
1011 Goto Error_Grid
1012 End If
1013 Else
1014 ControlView.setFocus()
1015 End If
1016 setFocus = True
1018 Exit_Function:
1019 Utils._ResetCalledSub(&quot;Control.setFocus&quot;)
1020 Exit Function
1021 Error_Function:
1022 TraceError(TRACEABORT, Err, &quot;Control.setFocus&quot;, Erl)
1023 Goto Exit_Function
1024 Error_Grid:
1025 TraceError(TRACEFATAL, ERRFOCUSINGRID, Utils._CalledSub(), 0, 1, Array(_Name, ocGrid._Name))
1026 Goto Exit_Function
1027 End Function &apos; setFocus V0.9.0
1029 REM -----------------------------------------------------------------------------------------------------------------------
1030 Public Function setProperty(ByVal Optional psProperty As String, ByVal Optional pvValue As Variant, ByVal Optional pvIndex As Variant) As Boolean
1031 &apos; Return True if property setting OK
1032 Utils._SetCalledSub(&quot;Control.setProperty&quot;)
1033 If IsMissing(pvIndex) Then
1034 setProperty = _PropertySet(psProperty, pvValue)
1035 Else
1036 setProperty = _PropertySet(psProperty, pvValue, pvIndex)
1037 End If
1038 Utils._ResetCalledSub(&quot;Control.setProperty&quot;)
1039 End Function &apos; setProperty
1041 REM -----------------------------------------------------------------------------------------------------------------------
1042 REM --- PRIVATE FUNCTIONS ---
1043 REM -----------------------------------------------------------------------------------------------------------------------
1044 Private Function _Formats(ByVal psControlType As String) As Variant
1045 &apos; Return allowed format entries for Date and Time control types
1047 Dim vFormats() As Variant
1048 Select Case psControlType
1049 Case CTLDATEFIELD
1050 vFormats = Array( _
1051 &quot;Standard (short)&quot; _
1052 , &quot;Standard (short YY)&quot; _
1053 , &quot;Standard (short YYYY)&quot; _
1054 , &quot;Standard (long)&quot; _
1055 , &quot;DD/MM/YY&quot; _
1056 , &quot;MM/DD/YY&quot; _
1057 , &quot;YY/MM/DD&quot; _
1058 , &quot;DD/MM/YYYY&quot; _
1059 , &quot;MM/DD/YYYY&quot; _
1060 , &quot;YYYY/MM/DD&quot; _
1061 , &quot;YY-MM-DD&quot; _
1062 , &quot;YYYY-MM-DD&quot; _
1064 Case CTLTIMEFIELD
1065 vFormats = Array( _
1066 &quot;24h short&quot; _
1067 , &quot;24h long&quot; _
1068 , &quot;12h short&quot; _
1069 , &quot;12h long&quot; _
1071 Case Else
1072 vFormats = Array()
1073 End Select
1075 _Formats = vFormats
1077 End Function &apos; _Formats V0.9.1
1079 REM -----------------------------------------------------------------------------------------------------------------------
1080 Private Function _GetListener(ByVal psProperty As String) As String
1081 &apos; Return the X...Listener corresponding with the property in argument
1083 Select Case UCase(psProperty)
1084 Case UCase(&quot;OnActionPerformed&quot;)
1085 _GetListener = &quot;XActionListener&quot;
1086 Case UCase(&quot;OnAdjustmentValueChanged&quot;)
1087 _GetListener = &quot;XAdjustmentListener&quot;
1088 Case UCase(&quot;OnApproveAction&quot;)
1089 _GetListener = &quot;XApproveActionListener&quot;
1090 Case UCase(&quot;OnApproveReset&quot;), UCase(&quot;OnResetted&quot;)
1091 _GetListener = &quot;XResetListener&quot;
1092 Case UCase(&quot;OnApproveUpdate&quot;), UCase(&quot;OnUpdated&quot;)
1093 _GetListener = &quot;XUpdateListener&quot;
1094 Case UCase(&quot;OnChanged&quot;)
1095 _GetListener = &quot;XChangeListener&quot;
1096 Case UCase(&quot;OnErrorOccurred&quot;)
1097 _GetListener = &quot;XErrorListener&quot;
1098 Case UCase(&quot;OnFocusGained&quot;), UCase(&quot;OnFocusLost&quot;)
1099 _GetListener = &quot;XFocusListener&quot;
1100 Case UCase(&quot;OnItemStateChanged&quot;)
1101 _GetListener = &quot;XItemListener&quot;
1102 Case UCase(&quot;OnKeyPressed&quot;), UCase(&quot;OnKeyReleased&quot;)
1103 _GetListener = &quot;XKeyListener&quot;
1104 Case UCase(&quot;OnMouseDragged&quot;), UCase(&quot;OnMouseMoved&quot;)
1105 _GetListener = &quot;XMouseMotionListener&quot;
1106 Case UCase(&quot;OnMouseEntered&quot;), UCase(&quot;OnMouseExited&quot;), UCase(&quot;OnMousePressed&quot;), UCase(&quot;OnMouseReleased&quot;)
1107 _GetListener = &quot;XMouseListener&quot;
1108 Case UCase(&quot;OnTextChanged&quot;)
1109 _GetListener = &quot;XTextListener&quot;
1110 End Select
1112 End Function &apos; _GetListener V1.7.0
1114 REM -----------------------------------------------------------------------------------------------------------------------
1115 Public Sub _Initialize()
1116 &apos; Initialize new Control
1117 &apos; ControlModel, ParentType, Name, Shortcut, ControlView, ImplementationName, ClassId (if parent &lt;&gt; dialog)
1118 &apos; are presumed preexisting
1120 &apos; Identify SubType and ControlView
1121 Dim sControlTypes() As Variant, i As Integer, vSplit() As Variant, sTrailer As String
1122 sControlTypes = array( CTLCONTROL _
1123 , CTLCOMMANDBUTTON _
1124 , CTLRADIOBUTTON _
1125 , CTLIMAGEBUTTON _
1126 , CTLCHECKBOX _
1127 , CTLLISTBOX _
1128 , CTLCOMBOBOX _
1129 , CTLGROUPBOX _
1130 , CTLTEXTFIELD _
1131 , CTLFIXEDTEXT _
1132 , CTLGRIDCONTROL _
1133 , CTLFILECONTROL _
1134 , CTLHIDDENCONTROL _
1135 , CTLIMAGECONTROL _
1136 , CTLDATEFIELD _
1137 , CTLTIMEFIELD _
1138 , CTLNUMERICFIELD _
1139 , CTLCURRENCYFIELD _
1140 , CTLPATTERNFIELD _
1141 , CTLSCROLLBAR _
1142 , CTLSPINBUTTON _
1143 , CTLNAVIGATIONBAR _
1144 , CTLPROGRESSBAR _
1145 , CTLFIXEDLINE _
1148 Select Case _ParentType
1149 Case CTLPARENTISDIALOG
1150 vSplit = Split(ControlModel.getServiceName(), &quot;.&quot;)
1151 sTrailer = UCase(vSplit(UBound(vSplit)))
1152 &apos; Manage homonyms
1153 Select Case sTrailer
1154 Case &quot;BUTTON&quot; : sTrailer = CTLCOMMANDBUTTON
1155 Case &quot;EDIT&quot; : sTrailer = CTLTEXTFIELD
1156 Case Else
1157 End Select
1158 If sTrailer &lt;&gt; CTLFORMATTEDFIELD Then
1159 For i = 0 To UBound(sControlTypes)
1160 If sControlTypes(i) = sTrailer Then
1161 _ClassId = i + 1
1162 _SubType = sTrailer
1163 _ControlType = _ClassId
1164 Exit For
1165 End If
1166 Next i
1167 Else
1168 _ClassId = acFormattedField
1169 _SubType = CTLFORMATTEDFIELD
1170 _ControlType = _ClassId
1171 End If
1172 Case Else
1173 &apos;Is ClassId one of the properties ?
1174 If _ClassId &gt; 0 Then &apos; All control types have a ClassId except subforms
1175 _SubType = sControlTypes(_ClassId - 1)
1176 _ControlType = _ClassId
1177 If _SubType = CTLTEXTFIELD Then &apos; Formatted fields belong to the TextField family
1178 If _ImplementationName = &quot;com.sun.star.comp.forms.OFormattedFieldWrapper&quot; _
1179 Or _ImplementationName = &quot;com.sun.star.comp.forms.OFormattedFieldWrapper_ForcedFormatted&quot; _
1180 Or _ImplementationName = &quot;com.sun.star.form.component.FormattedField&quot; Then &apos; When in datagrid
1181 _SubType = CTLFORMATTEDFIELD
1182 _ControlType = acFormattedField
1183 End If
1184 End If
1185 Else &apos; Initialize subform Control
1186 If ControlModel.ImplementationName = &quot;com.sun.star.comp.forms.ODatabaseForm&quot; Then
1187 _SubType = CTLSUBFORM
1188 _ControlType = acSubform
1189 End If
1190 End If
1191 End Select
1193 End Sub &apos; _Initialize
1195 REM -----------------------------------------------------------------------------------------------------------------------
1196 Public Function _ListboxBound() As Boolean
1197 &apos; Return True if listbox has a bound column
1199 Dim bListboxBound As Boolean, j As Integer
1200 Dim vValue() As variant, vString As Variant
1202 bListboxBound = False
1204 If Not IsNull(ControlModel.ValueItemList) _
1205 And ControlModel.DataField &lt;&gt; &quot;&quot; _
1206 And Not IsNull(ControlModel.BoundField) _
1207 And Utils._InList(ControlModel.ListSourceType, Array( _
1208 com.sun.star.form.ListSourceType.TABLE _
1209 , com.sun.star.form.ListSourceType.QUERY _
1210 , com.sun.star.form.ListSourceType.SQL _
1211 , com.sun.star.form.ListSourceType.SQLPASSTHROUGH _
1212 )) Then &apos; MultiSelect behaviour changed in OpenOffice &gt;= 3.3
1213 If IsArray(ControlModel.ValueItemList) Then
1214 vValue = ControlModel.ValueItemList
1215 vString = ControlModel.StringItemList
1216 For j = 0 To UBound(vValue)
1217 If VarType(vValue(j)) &lt;&gt; VarType(vString(j)) Then
1218 bListboxBound = True
1219 ElseIf vValue(j) &lt;&gt; vString(j) Then
1220 bListboxBound = True
1221 End If
1222 If bListboxBound Then Exit For
1223 Next j
1224 End If
1225 End If
1227 _ListboxBound = bListboxBound
1229 End Function &apos; _ListboxBound V0.9.0
1231 REM -----------------------------------------------------------------------------------------------------------------------
1232 Private Function _PropertiesList() As Variant
1233 &apos; Based on ControlProperties.ods analysis
1235 Dim vFullPropertiesList() As Variant
1237 &apos;List established only once
1238 If UBound(_ThisProperties) &gt; -1 Then
1239 _PropertiesList = _ThisProperties
1240 Exit Function
1241 End If
1243 vFullPropertiesList = Array( _
1244 &quot;BackColor&quot; _
1245 , &quot;BorderColor&quot; _
1246 , &quot;BorderStyle&quot; _
1247 , &quot;Cancel&quot; _
1248 , &quot;Caption&quot; _
1249 , &quot;ControlSource&quot; _
1250 , &quot;ControlTipText&quot; _
1251 , &quot;ControlType&quot; _
1252 , &quot;Default&quot; _
1253 , &quot;DefaultValue&quot; _
1254 , &quot;Enabled&quot; _
1255 , &quot;FontBold&quot; _
1256 , &quot;FontItalic&quot; _
1257 , &quot;FontName&quot; _
1258 , &quot;FontSize&quot; _
1259 , &quot;FontUnderline&quot; _
1260 , &quot;FontWeight&quot; _
1261 , &quot;ForeColor&quot; _
1262 , &quot;Form&quot; _
1263 , &quot;Format&quot; _
1264 , &quot;ItemData&quot; _
1265 , &quot;LinkChildFields&quot; _
1266 , &quot;LinkMasterFields&quot; _
1267 , &quot;ListCount&quot; _
1268 , &quot;ListIndex&quot; _
1269 , &quot;Locked&quot; _
1270 , &quot;MultiSelect&quot; _
1271 , &quot;Name&quot; _
1272 , &quot;ObjectType&quot; _
1273 , &quot;OnActionPerformed&quot; _
1274 , &quot;OnAdjustmentValueChanged&quot; _
1275 , &quot;OnApproveAction&quot; _
1276 , &quot;OnApproveReset&quot; _
1277 , &quot;OnApproveUpdate&quot; _
1278 , &quot;OnChanged&quot; _
1279 , &quot;OnErrorOccurred&quot; _
1280 , &quot;OnFocusGained&quot; _
1281 , &quot;OnFocusLost&quot; _
1282 , &quot;OnItemStateChanged&quot; _
1283 , &quot;OnKeyPressed&quot; _
1284 , &quot;OnKeyReleased&quot; _
1285 , &quot;OnMouseDragged&quot; _
1286 , &quot;OnMouseEntered&quot; _
1287 , &quot;OnMouseExited&quot; _
1288 , &quot;OnMouseMoved&quot; _
1289 , &quot;OnMousePressed&quot; _
1290 , &quot;OnMouseReleased&quot; _
1291 , &quot;OnResetted&quot; _
1292 , &quot;OnTextChanged&quot; _
1293 , &quot;OnUpdated&quot; _
1294 , &quot;OptionValue&quot; _
1295 , &quot;Page&quot; _
1296 , &quot;Parent&quot; _
1297 , &quot;Picture&quot; _
1298 , &quot;Required&quot; _
1299 , &quot;RowSource&quot; _
1300 , &quot;RowSourceType&quot; _
1301 , &quot;Selected&quot; _
1302 , &quot;SelLength&quot; _
1303 , &quot;SelStart&quot; _
1304 , &quot;Seltext&quot; _
1305 , &quot;SpecialEffect&quot; _
1306 , &quot;SubType&quot; _
1307 , &quot;TabIndex&quot; _
1308 , &quot;TabStop&quot; _
1309 , &quot;Tag&quot; _
1310 , &quot;Text&quot; _
1311 , &quot;TextAlign&quot; _
1312 , &quot;TripleState&quot; _
1313 , &quot;Value&quot; _
1314 , &quot;Visible&quot; _
1316 Dim vPropertiesMatrix(25) As Variant
1317 Select Case _ParentType
1318 Case CTLPARENTISFORM, CTLPARENTISSUBFORM
1319 vPropertiesMatrix(acCheckBox) = Array(0,4,5,6,7,9,10,11,12,13,14,15,16,17,27,28,29,32,36,37,38,39,40,41,42,43,44,45,46,47,52,54,61,62,63,64,65,67,68,69,70)
1320 vPropertiesMatrix(acComboBox) = Array(0,1,2,5,6,7,9,10,11,12,13,14,15,16,17,20,23,24,25,27,28,29,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,52,54,55,56,62,63,64,65,66,67,69,70)
1321 vPropertiesMatrix(acCommandButton) = Array(0,3,4,6,7,8,10,11,12,13,14,15,16,17,27,28,29,31,32,36,37,38,39,40,41,42,43,44,45,46,47,52,53,62,63,64,65,67,69,70)
1322 vPropertiesMatrix(acCurrencyField) = Array(0,1,2,5,6,7,9,10,11,12,13,14,15,16,17,25,27,28,32,33,36,37,39,40,41,42,43,44,45,46,47,48,49,52,54,62,63,64,65,67,69,70)
1323 vPropertiesMatrix(acDateField) = Array(0,1,2,5,6,7,9,10,11,12,13,14,15,16,17,19,25,27,28,32,33,36,37,39,40,41,42,43,44,45,46,47,48,49,52,54,62,63,64,65,66,67,69,70)
1324 vPropertiesMatrix(acFileControl) = Array(0,1,2,6,7,9,10,11,12,13,14,15,16,17,25,27,28,32,36,37,39,40,41,42,43,44,45,46,47,48,52,62,63,64,65,66,69,70)
1325 vPropertiesMatrix(acFixedText) = Array(0,1,2,4,6,7,10,11,12,13,14,15,16,17,27,28,36,37,39,40,41,42,43,44,45,46,52,62,65,67,70)
1326 vPropertiesMatrix(acFormattedField) = Array(0,1,2,5,6,7,9,10,11,12,13,14,15,16,17,19,25,27,28,32,33,35,36,37,39,40,41,42,43,44,45,46,47,48,49,52,54,62,63,64,65,66,67,69,70)
1327 vPropertiesMatrix(acGridControl) = Array(0,1,2,6,7,10,11,12,13,14,15,16,17,27,28,32,33,35,36,37,39,40,41,42,43,44,45,46,47,49,52,62,63,64,65,70)
1328 vPropertiesMatrix(acGroupBox) = Array(4,6,7,10,11,12,13,14,15,16,17,27,28,32,36,37,39,40,41,42,43,44,45,46,47,52,62,65,70)
1329 vPropertiesMatrix(acHiddenControl) = Array(7,27,28,52,62,65,69,70)
1330 vPropertiesMatrix(acImageButton) = Array(0,1,2,6,7,10,27,28,31,36,37,39,40,41,42,43,44,45,46,52,53,62,63,64,65,70)
1331 vPropertiesMatrix(acImageControl) = Array(0,1,2,5,6,7,10,25,27,28,32,36,37,39,40,41,42,43,44,45,46,47,52,53,54,62,63,64,65,70)
1332 vPropertiesMatrix(acListBox) = Array(0,1,2,5,6,7,9,10,11,12,13,14,15,16,17,20,23,24,25,26,27,28,29,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,49,52,54,55,56,57,62,63,64,65,67,69,70)
1333 vPropertiesMatrix(acNavigationBar) = Array(0,2,6,7,10,11,12,13,14,15,16,17,27,28,36,37,39,40,41,42,43,44,45,46,52,62,63,64,65,70)
1334 vPropertiesMatrix(acNumericField) = Array(0,1,2,5,6,7,9,10,11,12,13,14,15,16,17,25,27,28,32,33,36,37,39,40,41,42,43,44,45,46,47,48,49,52,54,62,63,64,65,67,69,70)
1335 vPropertiesMatrix(acPatternField) = Array(0,1,2,5,6,7,9,10,11,12,13,14,15,16,17,25,27,28,32,33,36,37,39,40,41,42,43,44,45,46,47,48,49,52,54,58,59,60,62,63,64,65,66,67,69,70)
1336 vPropertiesMatrix(acRadioButton) = Array(0,4,5,6,7,9,10,11,12,13,14,15,16,17,27,28,29,32,36,37,38,39,40,41,42,43,44,45,46,47,50,52,54,61,62,63,64,65,67,69,70)
1337 vPropertiesMatrix(acScrollBar) = Array(0,1,2,6,7,10,27,28,30,32,33,36,37,39,40,41,42,43,44,45,46,47,49,52,62,63,64,65,69,70)
1338 vPropertiesMatrix(acSpinButton) = Array(0,1,2,6,7,9,10,27,28,30,32,33,36,37,39,40,41,42,43,44,45,46,47,49,52,62,63,64,65,69,70)
1339 vPropertiesMatrix(0) = Array(7,18,21,22,27,28,52,62)
1340 vPropertiesMatrix(acTextField) = Array(0,1,2,5,6,7,9,10,11,12,13,14,15,16,17,25,27,28,32,33,34,36,37,39,40,41,42,43,44,45,46,47,48,49,52,54,58,59,60,62,63,64,65,66,67,69,70)
1341 vPropertiesMatrix(acTimeField) = Array(0,1,2,5,6,7,9,10,11,12,13,14,15,16,17,19,25,27,28,32,33,36,37,39,40,41,42,43,44,45,46,47,48,49,52,54,62,63,64,65,66,67,69,70)
1342 Case CTLPARENTISGROUP
1343 &apos; To be duplicated from above !!!
1344 vPropertiesMatrix(acRadioButton) = Array(0,4,5,6,7,9,10,11,12,13,14,15,16,17,27,28,29,32,36,37,38,39,40,41,42,43,44,45,46,47,50,52,54,61,62,63,64,65,67,69,70)
1345 Case CTLPARENTISGRID
1346 vPropertiesMatrix(acCheckBox) = Array(4,5,6,7,9,10,27,28,29,32,36,37,38,39,40,41,42,43,44,45,46,47,52,54,61,62,65,67,68,69)
1347 vPropertiesMatrix(acComboBox) = Array(4,5,6,7,9,10,20,23,24,25,27,28,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,52,54,55,56,62,65,66,67,69)
1348 vPropertiesMatrix(acCurrencyField) = Array(4,5,6,7,9,10,25,27,28,32,33,36,37,39,40,41,42,43,44,45,46,47,48,49,52,54,62,65,67,69)
1349 vPropertiesMatrix(acDateField) = Array(4,5,6,7,9,10,19,25,27,28,32,33,36,37,39,40,41,42,43,44,45,46,47,48,49,52,54,62,65,66,67,69)
1350 vPropertiesMatrix(acFormattedField) = Array(4,5,6,7,9,10,19,25,27,28,32,33,35,36,37,39,40,41,42,43,44,45,46,47,48,49,52,54,62,65,66,67,69)
1351 vPropertiesMatrix(acListBox) = Array(4,5,6,7,9,10,20,23,24,25,26,27,28,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,49,52,54,55,56,57,62,65,67,69)
1352 vPropertiesMatrix(acNumericField) = Array(4,5,6,7,9,10,25,27,28,32,33,36,37,39,40,41,42,43,44,45,46,47,48,49,52,54,62,65,67,69)
1353 vPropertiesMatrix(acPatternField) = Array(4,5,6,7,9,10,25,27,28,32,33,36,37,39,40,41,42,43,44,45,46,47,48,49,52,54,58,59,60,62,65,66,67,69)
1354 vPropertiesMatrix(acTextField) = Array(4,5,6,7,9,10,25,27,28,32,33,34,36,37,39,40,41,42,43,44,45,46,47,48,49,52,54,58,59,60,62,65,66,67,69)
1355 vPropertiesMatrix(acTimeField) = Array(4,5,6,7,9,10,19,25,27,28,32,33,36,37,39,40,41,42,43,44,45,46,47,48,49,52,54,62,65,66,67,69)
1356 Case CTLPARENTISDIALOG
1357 vPropertiesMatrix(acCheckBox) = Array(0,4,6,7,10,11,12,13,14,15,16,17,27,28,29,36,37,38,39,40,41,42,43,44,45,46,51,52,61,62,63,64,65,67,68,69,70)
1358 vPropertiesMatrix(acComboBox) = Array(0,1,2,6,7,10,11,12,13,14,15,16,17,20,23,24,25,27,28,29,36,37,38,39,40,41,42,43,44,45,46,48,51,52,55,62,63,64,65,66,67,69,70)
1359 vPropertiesMatrix(acCommandButton) = Array(0,3,4,6,7,8,10,11,12,13,14,15,16,17,27,28,29,36,37,38,39,40,41,42,43,44,45,46,51,52,53,62,63,64,65,67,70)
1360 vPropertiesMatrix(acCurrencyField) = Array(0,1,2,6,7,10,11,12,13,14,15,16,17,25,27,28,36,37,39,40,41,42,43,44,45,46,48,51,52,62,63,64,65,67,69,70)
1361 vPropertiesMatrix(acDateField) = Array(0,1,2,6,7,10,11,12,13,14,15,16,17,19,25,27,28,36,37,39,40,41,42,43,44,45,46,48,51,52,62,63,64,65,66,67,69,70)
1362 vPropertiesMatrix(acFileControl) = Array(0,1,2,6,7,10,11,12,13,14,15,16,17,25,27,28,36,37,39,40,41,42,43,44,45,46,48,51,52,62,63,64,65,66,67,69,70)
1363 vPropertiesMatrix(acFixedLine) = Array(0,4,6,7,10,11,12,13,14,15,16,17,27,28,36,37,39,40,41,42,43,44,45,46,51,52,62,63,65,70)
1364 vPropertiesMatrix(acFixedText) = Array(0,1,2,4,6,7,10,11,12,13,14,15,16,17,27,28,36,37,39,40,41,42,43,44,45,46,51,52,62,63,64,65,67,70)
1365 vPropertiesMatrix(acFormattedField) = Array(0,1,2,6,7,10,11,12,13,14,15,16,17,19,25,27,28,36,37,39,40,41,42,43,44,45,46,48,51,52,62,63,64,65,66,67,69,70)
1366 vPropertiesMatrix(acGroupBox) = Array(4,6,7,10,11,12,13,14,15,16,17,27,28,36,37,39,40,41,42,43,44,45,46,51,52,62,63,65,70)
1367 vPropertiesMatrix(acImageControl) = Array(0,1,2,6,7,10,27,28,36,37,39,40,41,42,43,44,45,46,51,52,53,62,63,64,65,70)
1368 vPropertiesMatrix(acListBox) = Array(0,1,2,6,7,10,11,12,13,14,15,16,17,20,23,24,25,26,27,28,29,36,37,38,39,40,41,42,43,44,45,46,51,52,55,57,62,63,64,65,67,69,70)
1369 vPropertiesMatrix(acNavigationBar) = Array(36,37,39,40,41,42,43,44,45,46)
1370 vPropertiesMatrix(acNumericField) = Array(0,1,2,6,7,10,11,12,13,14,15,16,17,25,27,28,36,37,39,40,41,42,43,44,45,46,48,51,52,62,63,64,65,67,69,70)
1371 vPropertiesMatrix(acPatternField) = Array(0,1,2,6,7,10,11,12,13,14,15,16,17,25,27,28,36,37,39,40,41,42,43,44,45,46,48,51,52,58,59,60,62,63,64,65,66,67,69,70)
1372 vPropertiesMatrix(acProgressBar) = Array(0,1,2,6,7,10,27,28,36,37,39,40,41,42,43,44,45,46,51,52,62,63,65,69,70)
1373 vPropertiesMatrix(acRadioButton) = Array(0,4,6,7,10,11,12,13,14,15,16,17,27,28,29,36,37,38,39,40,41,42,43,44,45,46,50,51,52,61,62,63,64,65,67,69,70)
1374 vPropertiesMatrix(acScrollBar) = Array(0,1,2,6,7,10,27,28,30,36,37,39,40,41,42,43,44,45,46,51,52,62,63,64,65,69,70)
1375 vPropertiesMatrix(acTextField) = Array(0,1,2,6,7,10,11,12,13,14,15,16,17,25,27,28,36,37,39,40,41,42,43,44,45,46,48,51,52,58,59,60,62,63,64,65,66,67,69,70)
1376 vPropertiesMatrix(acTimeField) = Array(0,1,2,6,7,10,11,12,13,14,15,16,17,19,25,27,28,36,37,39,40,41,42,43,44,45,46,48,51,52,62,63,64,65,66,67,69,70)
1377 End Select
1379 Dim i As Integer, iIndex As Integer
1380 If _ControlType = acSubForm Then iIndex = 0 Else iIndex = _ControlType
1381 If IsEmpty(vPropertiesMatrix(iIndex)) Then
1382 _ThisProperties = Array()
1383 Else
1384 ReDim _ThisProperties(0 To UBound(vPropertiesMatrix(iIndex)))
1385 For i = 0 To UBound(_ThisProperties)
1386 _ThisProperties(i) = vFullPropertiesList(vPropertiesMatrix(iIndex)(i))
1387 Next i
1388 End If
1390 _PropertiesList = _ThisProperties()
1392 End Function &apos; _PropertiesList
1394 REM -----------------------------------------------------------------------------------------------------------------------
1395 Private Function _PropertyGet(ByVal psProperty As String, ByVal Optional pvIndex As Variant) As Variant
1396 &apos; Return property value of the psProperty property name
1398 Dim iArg As Integer
1399 If _ErrorHandler() Then On Local Error Goto Error_Function
1400 Utils._SetCalledSub(&quot;Control.get&quot; &amp; psProperty)
1401 _PropertyGet = EMPTY
1403 &apos;Check Index argument
1404 Dim iArgNr As Integer
1405 If Not IsMissing(pvIndex) Then
1406 Select Case UCase(_A2B_.CalledSub)
1407 Case UCase(&quot;getProperty&quot;) : iArgNr = 3
1408 Case UCase(&quot;Control.getProperty&quot;) : iArgNr = 2
1409 Case UCase(&quot;Control.get&quot; &amp; psProperty) : iArgNr = 1
1410 End Select
1411 If Not Utils._CheckArgument(pvIndex, iArgNr, Utils._AddNumeric()) Then Goto Exit_Function
1412 End If
1414 Dim vDefaultValue As Variant, oDefaultValue As Object, vValue As Variant, oValue As Object, iIndex As Integer
1415 Dim lListIndex As Long, i As Integer, j As Integer, vCurrentValue As Variant, lListCount As Long
1416 Dim vListboxValue As Variant, vListSource, bSelected() As Boolean, bListboxBound As Boolean
1417 Dim vGet As Variant, vDate As Variant
1418 Dim ofSubForm As Object
1419 Dim vFormats() As Variant
1420 Dim vSelection As Variant, sSelectedText As String
1421 Dim oControlEvents As Object, sEventName As String
1423 If Not hasProperty(psProperty) Then Goto Trace_Error
1425 Select Case UCase(psProperty)
1426 Case UCase(&quot;BackColor&quot;)
1427 If Utils._hasUNOProperty(ControlModel, &quot;BackgroundColor&quot;) Then _PropertyGet = ControlModel.BackgroundColor
1428 Case UCase(&quot;BorderColor&quot;)
1429 If Utils._hasUNOProperty(ControlModel, &quot;BorderColor&quot;) Then _PropertyGet = ControlModel.BorderColor
1430 Case UCase(&quot;BorderStyle&quot;)
1431 If Utils._hasUNOProperty(ControlModel, &quot;Border&quot;) Then _PropertyGet = ControlModel.Border
1432 Case UCase(&quot;Cancel&quot;)
1433 If Utils._hasUNOProperty(ControlModel, &quot;PushButtonType&quot;) Then _PropertyGet = ( ControlModel.PushButtonType = com.sun.star.awt.PushButtonType.CANCEL )
1434 Case UCase(&quot;Caption&quot;)
1435 If Utils._hasUNOProperty(ControlModel, &quot;Label&quot;) Then _PropertyGet = ControlModel.Label
1436 Case UCase(&quot;ControlSource&quot;)
1437 If Utils._hasUNOProperty(ControlModel, &quot;DataField&quot;) Then _PropertyGet = ControlModel.DataField
1438 Case UCase(&quot;ControlTipText&quot;)
1439 If Utils._hasUNOProperty(ControlModel, &quot;HelpText&quot;) Then _PropertyGet = ControlModel.HelpText
1440 Case UCase(&quot;ControlType&quot;)
1441 _PropertyGet = _ControlType
1442 Case UCase(&quot;Default&quot;)
1443 If Utils._hasUNOProperty(ControlModel, &quot;DefaultButton&quot;) Then _PropertyGet = ControlModel.DefaultButton
1444 Case UCase(&quot;DefaultValue&quot;)
1445 Select Case _SubType
1446 Case CTLCHECKBOX, CTLRADIOBUTTON
1447 If Utils._hasUNOProperty(ControlModel, &quot;DefaultState&quot;) Then _PropertyGet = ControlModel.DefaultState
1448 Case CTLCOMBOBOX, CTLFILECONTROL, CTLPATTERNFIELD, CTLTEXTFIELD
1449 If Utils._hasUNOProperty(ControlModel, &quot;DefaultText&quot;) Then _PropertyGet = ControlModel.DefaultText
1450 Case CTLCURRENCYFIELD, CTLNUMERICFIELD
1451 If Utils._hasUNOProperty(ControlModel, &quot;DefaultValue&quot;) Then _PropertyGet = ControlModel.DefaultValue
1452 Case CTLDATEFIELD
1453 If Utils._hasUNOProperty(ControlModel, &quot;DefaultDate&quot;) Then
1454 Select Case VarType(ControlModel.DefaultDate)
1455 Case vbLong &apos; AOO and LO &lt;= 4.1
1456 vDefaultValue = ControlModel.DefaultDate
1457 vGet = DateSerial(Left(vDefaultValue, 4), Mid(vDefaultValue, 5, 2), Right(vDefaultValue, 2))
1458 Case vbObject &apos; LO &gt;= 4.2 com.sun.star.Util.Date
1459 Set oDefaultValue = ControlModel.DefaultDate
1460 vGet = DateSerial(oDefaultValue.Year,oDefaultValue.Month, oDefaultValue.Day)
1461 Case vbEmpty
1462 End Select
1463 End If
1464 Case CTLFORMATTEDFIELD
1465 If Utils._hasUNOProperty(ControlModel, &quot;EffectiveDefault&quot;) Then _PropertyGet = ControlModel.EffectiveDefault
1466 Case CTLLISTBOX
1467 If Utils._hasUNOProperty(ControlModel, &quot;DefaultSelection&quot;) And Utils._hasUNOProperty(ControlModel, &quot;StringItemList&quot;) Then
1468 vDefaultValue = ControlModel.DefaultSelection
1469 If IsArray(vDefaultValue) Then
1470 If UBound(vDefaultValue) &gt;= LBound(vDefaultValue) Then &apos; Is array initialized ?
1471 iIndex = UBound(ControlModel.StringItemList)
1472 If vDefaultValue(0) &gt;= 0 And vDefaultValue(0) &lt;= iIndex Then _PropertyGet = ControlModel.StringItemList(vDefaultValue(0))
1473 &apos; Only first default value is considered
1474 End If
1475 End If
1476 End If
1477 Case CTLSPINBUTTON
1478 If Utils._hasUNOProperty(ControlModel, &quot;DefaultSpinValue&quot;) Then _PropertyGet = ControlModel.DefaultSpinValue
1479 Case CTLTIMEFIELD
1480 If Utils._hasUNOProperty(ControlModel, &quot;DefaultTime&quot;) Then
1481 Select Case VarType(ControlModel.DefaultTime)
1482 Case vbLong &apos; AOO and LO &lt;= 4.1
1483 _PropertyGet = ControlModel.DefaultTime
1484 Case vbObject &apos; LO &gt;= 4.2 com.sun.star.Util.Time
1485 Set oDefaultValue = ControlModel.DefaultTime
1486 _PropertyGet = TimeSerial(oDefaultValue.Hours, oDefaultValue.Minutes, oDefaultValue.Seconds)
1487 Case vbEmpty
1488 End Select
1489 End If
1490 Case Else
1491 Goto Trace_Error
1492 End Select
1493 Case UCase(&quot;Enabled&quot;)
1494 If Utils._hasUNOProperty(ControlModel, &quot;Enabled&quot;) Then _PropertyGet = ControlModel.Enabled
1495 Case UCase(&quot;FontBold&quot;)
1496 If Utils._hasUNOProperty(ControlModel, &quot;FontWeight&quot;) Then _PropertyGet = ( ControlModel.FontWeight &gt;= com.sun.star.awt.FontWeight.BOLD )
1497 Case UCase(&quot;FontItalic&quot;)
1498 If Utils._hasUNOProperty(ControlModel, &quot;FontSlant&quot;) Then _PropertyGet = ( ControlModel.FontSlant = com.sun.star.awt.FontSlant.ITALIC )
1499 Case UCase(&quot;FontName&quot;)
1500 If Utils._hasUNOProperty(ControlModel, &quot;FontName&quot;) Then _PropertyGet = ControlModel.FontName
1501 Case UCase(&quot;FontSize&quot;)
1502 If Utils._hasUNOProperty(ControlModel, &quot;FontHeight&quot;) Then _PropertyGet = ControlModel.FontHeight
1503 Case UCase(&quot;FontUnderline&quot;)
1504 If Utils._hasUNOProperty(ControlModel, &quot;FontUnderline&quot;) Then _PropertyGet = _
1505 Not ( ControlModel.FontUnderline = com.sun.star.awt.FontUnderline.NONE _
1506 Or ControlModel.FontUnderline = com.sun.star.awt.FontUnderline.DONTKNOW )
1507 Case UCase(&quot;FontWeight&quot;)
1508 If Utils._hasUNOProperty(ControlModel, &quot;FontWeight&quot;) Then _PropertyGet = ControlModel.FontWeight
1509 Case UCase(&quot;ForeColor&quot;)
1510 If Utils._hasUNOProperty(ControlModel, &quot;TextColor&quot;) Then _PropertyGet = ControlModel.TextColor
1511 Case UCase(&quot;Form&quot;)
1512 Set ofSubForm = New SubForm &apos; Start building the SUBFORM object
1513 With ofSubForm
1514 Set .DatabaseForm = ControlModel
1515 ._Name = _Name
1516 ._Shortcut = _Shortcut &amp; &quot;.Form&quot;
1517 ._MainForm = _MainForm
1518 .ParentComponent = _FormComponent
1519 ._DocEntry = _DocEntry
1520 ._DbEntry = _DbEntry
1521 ._OrderBy = ControlModel.Order
1522 End With
1523 set _PropertyGet = ofSubForm
1524 Case UCase(&quot;Format&quot;)
1525 vFormats = _Formats(_Subtype)
1526 Select Case _SubType
1527 Case CTLDATEFIELD
1528 If Utils._hasUNOProperty(ControlModel, &quot;DateFormat&quot;) Then
1529 If ControlModel.DateFormat &lt;= UBound(vFormats) Then _PropertyGet = vFormats(ControlModel.DateFormat)
1530 End If
1531 Case CTLTIMEFIELD
1532 If Utils._hasUNOProperty(ControlModel, &quot;TimeFormat&quot;) Then
1533 If ControlModel.TimeFormat &lt;= UBound(vFormats) Then _PropertyGet = vFormats(ControlModel.TimeFormat)
1534 End If
1535 Case Else
1536 If Utils._hasUNOProperty(ControlModel, &quot;FormatKey&quot;) Then
1537 If Utils._hasUNOProperty(ControlModel, &quot;FormatsSupplier&quot;) Then
1538 _PropertyGet = ControlModel.FormatsSupplier.getNumberFormats.getByKey(ControlModel.FormatKey).FormatString
1539 End If
1540 End If
1541 End Select
1542 Case UCase(&quot;ItemData&quot;)
1543 If Utils._hasUNOProperty(ControlModel, &quot;StringItemList&quot;) Then
1544 If IsMissing(pvIndex) Then
1545 _PropertyGet = ControlModel.StringItemList
1546 Else
1547 If pvIndex &lt; 0 Or pvIndex &gt; UBound(ControlModel.StringItemList) Then Goto Trace_Error_Index
1548 _PropertyGet = ControlModel.StringItemList(pvIndex)
1549 End If
1550 End If
1551 Case UCase(&quot;ListCount&quot;)
1552 If Utils._hasUNOProperty(ControlModel, &quot;StringItemList&quot;) Then _PropertyGet = UBound(ControlModel.StringItemList) + 1
1553 Case UCase(&quot;ListIndex&quot;)
1554 If Utils._hasUNOProperty(ControlModel, &quot;StringItemList&quot;) Then
1555 lListIndex = -1 &apos; Either Multiple selections or no selection at all
1556 Select Case _SubType
1557 Case CTLCOMBOBOX
1558 If Not Utils._hasUNOProperty(ControlModel, &quot;Text&quot;) Then Goto Trace_Error
1559 iIndex = 0
1560 If ControlModel.Text &lt;&gt; &quot;&quot; Then
1561 For j = 0 To UBound(ControlModel.StringItemList)
1562 If ControlModel.StringItemList(j) = ControlModel.Text Then
1563 lListIndex = j
1564 iIndex = iIndex + 1
1565 End If
1566 Next j
1567 If iIndex &lt;&gt; 1 Then lListIndex = -1 &apos; Multiselection or synonyms rejected
1568 End If
1569 Case CTLLISTBOX &apos; No mean found to access bound column !! See mail Lionel 10/5/2013 for improvement
1570 If Not Utils._hasUNOProperty(ControlModel, &quot;SelectedItems&quot;) Then Goto Trace_Error
1571 If UBound(ControlModel.SelectedItems) &gt; 0 Then &apos; Several items selected
1572 Else &apos; Mono selection
1573 If _ParentType &lt;&gt; CTLPARENTISDIALOG Then &apos; getCurrentValue not found in dialog listboxes ??
1574 vCurrentValue = ControlModel.getCurrentValue() &apos; Space or uninitialized array if no selection at all
1575 If IsArray(vCurrentValue) Then &apos; Is an array if MultiSelect
1576 vListboxValue = &quot;&quot;
1577 If UBound(vCurrentValue) = 0 Then vListboxValue = vCurrentValue(0)
1578 Else
1579 vListboxValue = vCurrentValue
1580 End If
1581 If vListboxValue &lt;&gt; &quot;&quot; Then &apos; Speed up search PM Pastim 12/02/2013
1582 If Ubound(ControlModel.SelectedItems) &gt;= 0 Then lListIndex = Controlmodel.Selecteditems(0)
1583 End If
1584 Else
1585 If Ubound(ControlModel.SelectedItems) &gt;= 0 Then lListIndex = Controlmodel.Selecteditems(0)
1586 End If
1587 End If
1588 End Select
1589 _PropertyGet = lListIndex
1590 End If
1591 Case UCase(&quot;Locked&quot;)
1592 If Utils._hasUNOProperty(ControlModel, &quot;ReadOnly&quot;) Then _PropertyGet = ControlModel.ReadOnly
1593 Case UCase(&quot;MultiSelect&quot;)
1594 If Utils._hasUNOProperty(ControlModel, &quot;MultiSelection&quot;) Then
1595 _PropertyGet = ControlModel.MultiSelection &apos; Boolean in OO, Integer (0, 1 or 2) in VBA
1596 ElseIf Utils._hasUNOProperty(ControlModel, &quot;MultiSelectionSimpleMode&quot;) Then &apos; Not documented: only for GridControls !? Changed in OO &gt;= 3,3 !?
1597 _PropertyGet = ControlModel.MultiSelectionSimpleMode
1598 Else
1599 _PropertyGet = False
1600 End If
1601 Case UCase(&quot;Name&quot;)
1602 _PropertyGet = _Name
1603 Case UCase(&quot;OnActionPerformed&quot;), UCase(&quot;OnAdjustmentValueChanged&quot;), UCase(&quot;OnApproveAction&quot;), UCase(&quot;OnApproveReset&quot;) _
1604 , UCase(&quot;OnApproveUpdate&quot;), UCase(&quot;OnChanged&quot;), UCase(&quot;OnErrorOccurred&quot;), UCase(&quot;OnFocusGained&quot;) _
1605 , UCase(&quot;OnFocusLost&quot;), UCase(&quot;OnItemStateChanged&quot;), UCase(&quot;OnKeyPressed&quot;), UCase(&quot;OnKeyReleased&quot;) _
1606 , UCase(&quot;OnMouseDragged&quot;), UCase(&quot;OnMouseEntered&quot;), UCase(&quot;OnMouseExited&quot;), UCase(&quot;OnMouseMoved&quot;) _
1607 , UCase(&quot;OnMousePressed&quot;), UCase(&quot;OnMouseReleased&quot;), UCase(&quot;OnResetted&quot;), UCase(&quot;OnTextChanged&quot;) _
1608 , UCase(&quot;OnUpdated&quot;)
1609 Select Case _ParentType
1610 Case CTLPARENTISDIALOG
1611 Set oControlEvents = ControlModel.getEvents()
1612 sEventName = &quot;com.sun.star.awt.&quot; &amp; _GetListener(psProperty) &amp; &quot;::&quot; &amp; Utils._GetEventName(psProperty)
1613 If oControlEvents.hasByName(sEventName) Then
1614 _PropertyGet = oControlEvents.getByName(sEventName).ScriptCode
1615 Else
1616 _PropertyGet = &quot;&quot;
1617 End If
1618 Case Else
1619 _PropertyGet = Utils._GetEventScriptCode(ControlModel, psProperty, _Name)
1620 End Select
1621 Case UCase(&quot;OptionValue&quot;)
1622 If Utils._hasUNOProperty(ControlModel, &quot;RefValue&quot;) Then
1623 If ControlModel.RefValue &lt;&gt; &quot;&quot; Then
1624 _PropertyGet = ControlModel.RefValue
1625 ElseIf Utils._hasUNOProperty(ControlModel, &quot;Label&quot;) Then
1626 _PropertyGet = ControlModel.Label
1627 End If
1628 End If
1629 Case UCase(&quot;ObjectType&quot;)
1630 _PropertyGet = _Type
1631 Case UCase(&quot;Page&quot;)
1632 If Utils._hasUNOProperty(ControlModel, &quot;Step&quot;) Then _PropertyGet = ControlModel.Step
1633 Case UCase(&quot;Parent&quot;)
1634 Set _PropertyGet = PropertiesGet._ParentObject(_Shortcut)
1635 Case UCase(&quot;Picture&quot;)
1636 _PropertyGet = ConvertToUrl(ControlModel.ImageURL)
1637 Case UCase(&quot;Required&quot;)
1638 If Utils._hasUNOProperty(ControlModel, &quot;InputRequired&quot;) Then _PropertyGet = ControlModel.InputRequired
1639 Case UCase(&quot;RowSource&quot;)
1640 Select Case _ParentType
1641 Case CTLPARENTISDIALOG
1642 If Utils._hasUNOProperty(ControlModel, &quot;StringItemList&quot;) Then
1643 If IsArray(ControlModel.StringItemList) Then vListSource = ControlModel.StringItemList Else vListSource = Array(ControlModel.StringItemList)
1644 _PropertyGet = Join(vListSource, &quot;;&quot;)
1645 End If
1646 Case Else
1647 If Utils._hasUNOProperty(ControlModel, &quot;ListSource&quot;) Then
1648 Select Case ControlModel.ListSourceType
1649 Case com.sun.star.form.ListSourceType.VALUELIST _
1650 , com.sun.star.form.ListSourceType.TABLEFIELDS
1651 If IsArray(ControlModel.StringItemList) Then vListSource = ControlModel.StringItemList Else vListSource = Array(ControlModel.StringItemList)
1652 Case com.sun.star.form.ListSourceType.TABLE _
1653 , com.sun.star.form.ListSourceType.QUERY _
1654 , com.sun.star.form.ListSourceType.SQL _
1655 , com.sun.star.form.ListSourceType.SQLPASSTHROUGH
1656 If IsArray(ControlModel.ListSource) Then vListSource = ControlModel.ListSource Else vListSource = Array(ControlModel.ListSource)
1657 End Select
1658 _PropertyGet = Join(vListSource, &quot;;&quot;)
1659 End If
1660 End Select
1661 Case UCase(&quot;RowSourceType&quot;)
1662 If Utils._hasUNOProperty(ControlModel, &quot;ListSourceType&quot;) Then _PropertyGet = ControlModel.ListSourceType
1663 Case UCase(&quot;Selected&quot;)
1664 If Utils._hasUNOProperty(ControlModel, &quot;StringItemList&quot;) Then
1665 lListIndex = UBound(ControlModel.StringItemList)
1666 If Not IsMissing(pvIndex) Then
1667 If pvIndex &lt; 0 Or pvIndex &gt; lListIndex Then Goto Trace_Error_Index
1668 End If
1669 If lListIndex &lt; 0 Then &apos; Do nothing if listbox empty
1670 _PropertyGet = Array()
1671 Else
1672 Redim bSelected(0 To lListIndex)
1673 For j = 0 To lListIndex
1674 bSelected(j) = False
1675 Next j
1676 For j = 0 To UBound(ControlModel.SelectedItems)
1677 iIndex = ControlModel.SelectedItems(j)
1678 If iIndex &gt;= 0 And iIndex &lt;= lListIndex Then bSelected(iIndex) = True
1679 Next j
1680 If IsMissing(pvIndex) Then _PropertyGet = bSelected Else _PropertyGet = bSelected(pvIndex)
1681 End If
1682 End If
1683 Case UCase(&quot;SelLength&quot;)
1684 If Utils._hasUNOProperty(ControlView, &quot;Selection&quot;) Then
1685 vSelection = ControlView.getSelection()
1686 If vSelection.Max &gt;= vSelection.Min Then
1687 _PropertyGet = vSelection.Max - vSelection.Min
1688 Else
1689 _PropertyGet = 0 &apos; probably control does not have focus
1690 End If
1691 Else
1692 _PropertyGet = 0
1693 End If
1694 Case UCase(&quot;SelStart&quot;)
1695 If Utils._hasUNOProperty(ControlView, &quot;Selection&quot;) Then
1696 vSelection = ControlView.getSelection()
1697 If vSelection.Max &gt;= vSelection.Min Then
1698 _PropertyGet = vSelection.Min + 1
1699 Else
1700 _PropertyGet = 1 &apos; probably control does not have focus
1701 End If
1702 Else
1703 _PropertyGet = 1
1704 End If
1705 Case UCase(&quot;SelText&quot;)
1706 If Utils._hasUNOProperty(ControlView, &quot;SelectedText&quot;) Then
1707 _PropertyGet = ControlView.getSelectedText()
1708 Else
1709 _PropertyGet = &quot;&quot;
1710 End If
1711 Case UCase(&quot;SpecialEffect&quot;)
1712 If Utils._hasUNOProperty(ControlModel, &quot;VisualEffect&quot;) Then _PropertyGet = ControlModel.VisualEffect
1713 Case UCase(&quot;SubType&quot;)
1714 _PropertyGet = _SubType
1715 Case UCase(&quot;TabIndex&quot;)
1716 If Utils._hasUNOProperty(ControlModel, &quot;TabIndex&quot;) Then _PropertyGet = ControlModel.TabIndex
1717 Case UCase(&quot;TabStop&quot;)
1718 If Utils._hasUNOProperty(ControlModel, &quot;TabStop&quot;) Then _PropertyGet = ControlModel.TabStop
1719 Case UCase(&quot;Tag&quot;)
1720 If Utils._hasUNOProperty(ControlModel, &quot;Tag&quot;) Then _PropertyGet = ControlModel.Tag
1721 Case UCase(&quot;Text&quot;)
1722 Select Case _SubType
1723 Case CTLDATEFIELD
1724 If Utils._hasUNOProperty(ControlModel, &quot;Date&quot;) Then
1725 If Utils._hasUNOProperty(ControlModel, &quot;FormatKey&quot;) Then
1726 If Utils._hasUNOProperty(ControlModel, &quot;FormatsSupplier&quot;) Then
1727 Select Case VarType(ControlModel.Date)
1728 Case vbLong &apos; AOO and LO &lt;= 4.1
1729 vDate = DateSerial(Left(ControlModel.Date, 4), Mid(ControlModel.Date, 5, 2), Right(ControlModel.Date, 2))
1730 Case vbObject &apos; LO &gt;= 4.2
1731 vDate = DateSerial(ControlModel.Date.Year, ControlModel.Date.Month, ControlModel.Date.Day)
1732 Case vbEmpty
1733 End Select
1734 _PropertyGet = Format(vDate, ControlModel.FormatsSupplier.getNumberFormats.getByKey(ControlModel.FormatKey).FormatString)
1735 End If
1736 End If
1737 End If
1738 Case CTLTIMEFIELD
1739 If Utils._hasUNOProperty(ControlModel, &quot;Text&quot;) Then
1740 Select Case VarType(ControlModel.Time)
1741 Case vbLong &apos; AOO and LO &lt;= 4.1
1742 _PropertyGet = Format(ControlModel.Time, &quot;HH:MM:SS&quot;)
1743 Case vbObject &apos; LO &gt;= 4.2 com.sun.star.Util.Time
1744 Set oValue = ControlModel.Time
1745 _PropertyGet = Format(TimeSerial(oValue.Hours, oValue.Minutes, oValue.Seconds), &quot;HH:MM:SS&quot;)
1746 Case vbEmpty
1747 End Select
1748 End If
1749 Case Else
1750 If Utils._hasUNOProperty(ControlModel, &quot;Text&quot;) Then _PropertyGet = ControlModel.Text
1751 End Select
1752 Case UCase(&quot;TextAlign&quot;)
1753 If Utils._hasUNOProperty(ControlModel, &quot;Tag&quot;) Then _PropertyGet = ControlModel.Tag
1754 Case UCase(&quot;TripleState&quot;)
1755 If Utils._hasUNOProperty(ControlModel, &quot;TriState&quot;) Then _PropertyGet = ControlModel.TriState
1756 Case UCase(&quot;Value&quot;)
1757 Select Case _SubType
1758 Case CTLCHECKBOX
1759 If Utils._hasUNOProperty(ControlModel, &quot;State&quot;) Then vGet = ControlModel.State
1760 Case CTLCOMMANDBUTTON
1761 vGet = False
1762 If Utils._hasUNOProperty(ControlModel, &quot;Toggle&quot;) Then
1763 If Utils._hasUNOProperty(ControlModel, &quot;State&quot;) Then vGet = ( ControlModel.State = 1 )
1764 End If
1765 Case CTLCOMBOBOX, CTLFILECONTROL, CTLPATTERNFIELD, CTLTEXTFIELD
1766 If Utils._hasUNOProperty(ControlModel, &quot;Text&quot;) Then vGet = ControlModel.Text
1767 Case CTLCURRENCYFIELD
1768 If Utils._hasUNOProperty(ControlModel, &quot;Value&quot;) Then vGet = ControlModel.Value
1769 Case CTLDATEFIELD
1770 If Utils._hasUNOProperty(ControlModel, &quot;Date&quot;) Then
1771 Select Case VarType(ControlModel.Date)
1772 Case vbLong &apos; AOO and LO &lt;= 4.1
1773 vValue = ControlModel.Date
1774 vGet = DateSerial(Left(vValue, 4), Mid(vValue, 5, 2), Right(vValue, 2))
1775 Case vbObject &apos; LO &gt;= 4.2 com.sun.star.Util.Date
1776 Set oValue = ControlModel.Date
1777 vGet = DateSerial(oValue.Year, oValue.Month, oValue.Day)
1778 Case vbEmpty
1779 End Select
1780 End If
1781 Case CTLFORMATTEDFIELD
1782 If Utils._hasUNOProperty(ControlModel, &quot;EffectiveValue&quot;) Then vGet = ControlModel.EffectiveValue
1783 Case CTLHIDDENCONTROL
1784 If Utils._hasUNOProperty(ControlModel, &quot;HiddenValue&quot;) Then vGet = ControlModel.HiddenValue
1785 Case CTLLISTBOX
1786 If Not Utils._hasUNOProperty(ControlModel, &quot;StringItemList&quot;) Then Goto Trace_Error
1787 If Not Utils._hasUNOProperty(ControlModel, &quot;SelectedItems&quot;) Then Goto Trace_Error
1788 If UBound(ControlModel.SelectedItems) &gt; 0 Then &apos; Several items selected
1789 vGet = EMPTY &apos; Listbox has no value, only an array of Selected flags to identify values
1790 Else &apos; Mono selection
1791 Select Case _ParentType
1792 Case CTLPARENTISDIALOG
1793 If Ubound(ControlModel.SelectedItems) &gt;= 0 Then
1794 lListIndex = Controlmodel.Selecteditems(0)
1795 If lListIndex &gt; -1 And lListIndex &lt;= UBound(ControlModel.StringItemList) Then
1796 vGet = ControlModel.StringItemList(lListIndex)
1797 Else
1798 vGet = EMPTY
1799 End If
1800 End If
1801 Case Else
1802 vCurrentValue = ControlModel.getCurrentValue() &apos; Space or uninitialized array if no selection at all
1803 If IsArray(vCurrentValue) Then &apos; Is an array if MultiSelect
1804 If UBound(vCurrentValue) &gt;= LBound(vCurrentValue) Then
1805 vListboxValue = vCurrentValue(0)
1806 Else
1807 vListboxValue = &quot;&quot;
1808 End If
1809 Else
1810 vListboxValue = vCurrentValue
1811 End If
1812 lListIndex = -1 &apos; Speed up getting value PM PASTIM 12/02/2013
1813 If vListboxValue &lt;&gt; &quot;&quot; Then
1814 If Ubound(ControlModel.SelectedItems) &gt;= 0 Then lListIndex = Controlmodel.Selecteditems(0)
1815 End If
1816 &apos; If listbox has hidden column = real bound field, then explore ValueItemList
1817 bListboxBound = _ListboxBound()
1818 If bListboxBound Then
1819 If lListIndex &gt; -1 Then vGet = ControlModel.ValueItemList(lListIndex) &apos; PASTIM
1820 Else
1821 vGet = vListboxValue
1822 End If
1823 End Select
1824 End If
1825 Case CTLNUMERICFIELD
1826 If Utils._hasUNOProperty(ControlModel, &quot;Value&quot;) Then vGet = ControlModel.Value
1827 Case CTLPROGRESSBAR
1828 If Utils._hasUNOProperty(ControlModel, &quot;ProgressValue&quot;) Then vGet = ControlModel.ProgressValue
1829 Case CTLSCROLLBAR
1830 If Utils._hasUNOProperty(ControlModel, &quot;ScrollValue&quot;) Then vGet = ControlModel.ScrollValue
1831 Case CTLSPINBUTTON
1832 If Utils._hasUNOProperty(ControlModel, &quot;SpinValue&quot;) Then vGet = ControlModel.SpinValue
1833 Case CTLTIMEFIELD
1834 If Utils._hasUNOProperty(ControlModel, &quot;Time&quot;) Then
1835 Select Case VarType(ControlModel.Time)
1836 Case vbLong &apos; AOO and LO &lt;= 4.1
1837 vGet = ControlModel.Time
1838 Case vbObject &apos; LO &gt;= 4.2 com.sun.star.Util.Time
1839 Set oValue = ControlModel.Time
1840 vGet = TimeSerial(oValue.Hours, oValue.Minutes, oValue.Seconds)
1841 Case vbEmpty
1842 End Select
1843 End If
1844 Case Else
1845 End Select
1846 If _SubType &lt;&gt; CTLLISTBOX Then &apos; Give getCurrentValue an additional try
1847 If IsEmpty(vGet) And Utils._hasUNOMethod(ControlModel, &quot;getCurrentValue&quot;) Then vGet = ControlModel.getCurrentValue()
1848 End If
1849 _PropertyGet = vGet
1850 Case UCase(&quot;Visible&quot;)
1851 Select Case _SubType
1852 Case CTLHIDDENCONTROL
1853 _PropertyGet = False
1854 Case Else
1855 If Utils._hasUNOMethod(ControlView, &quot;isVisible&quot;) Then _PropertyGet = CBool(ControlView.isVisible())
1856 End Select
1857 Case Else
1858 Goto Trace_Error
1859 End Select
1861 If IsEmpty(_PropertyGet) Then TraceError(TRACEINFO, ERRPROPERTYINIT, Utils._CalledSub(), 0, , psProperty)
1863 Exit_Function:
1864 Utils._ResetCalledSub(&quot;Control.get&quot; &amp; psProperty)
1865 Exit Function
1866 Trace_Error:
1867 TraceError(TRACEWARNING, ERRPROPERTY, Utils._CalledSub(), 0, , psProperty)
1868 _PropertyGet = EMPTY
1869 Goto Exit_Function
1870 Trace_Error_Index:
1871 TraceError(TRACEFATAL, ERRINDEXVALUE, Utils._CalledSub(), 0, 1, psProperty)
1872 _PropertyGet = EMPTY
1873 Goto Exit_Function
1874 Error_Function:
1875 TraceError(TRACEABORT, Err, &quot;Control._PropertyGet&quot;, Erl)
1876 _PropertyGet = EMPTY
1877 GoTo Exit_Function
1878 End Function &apos; _PropertyGet V0.9.1
1880 REM -----------------------------------------------------------------------------------------------------------------------
1881 Private Function _PropertySet(ByVal psProperty As String, ByVal pvValue As Variant, ByVal Optional pvIndex As Variant) As Boolean
1882 &apos; Return True if property setting OK
1884 If _ErrorHandler() Then On Local Error Goto Error_Function
1885 Utils._SetCalledSub(&quot;Control.set&quot; &amp; psProperty)
1886 _PropertySet = True
1888 &apos;Check Index argument
1889 If Not IsMissing(pvIndex) Then
1890 If Not Utils._CheckArgument(pvIndex, 1, Utils._AddNumeric()) Then Goto Exit_Function
1891 End If
1892 &apos;Execute
1893 Dim iArgNr As Integer, vButton As Variant, i As Integer
1894 Dim odbDatabase As Object, vNames() As Variant, bFound As Boolean, sName As String
1895 Dim bMultiSelect As Boolean, iCount As Integer, iSelectedItems() As Integer, lListCount As Long, bSelected() As Boolean
1896 Dim vItemList() As Variant, vFormats() As Variant
1897 Dim oStruct As Object, sValue As String
1898 Dim vSelection As Variant, sText As String, lStart As long
1899 Dim oControlEvents As Object, sListener As String, sEvent As String, sEventName As String, oEvent As Object
1901 _PropertySet = True
1902 Select Case UCase(_A2B_.CalledSub)
1903 Case UCase(&quot;setProperty&quot;) : iArgNr = 3
1904 Case UCase(&quot;Control.setProperty&quot;) : iArgNr = 2
1905 Case UCase(&quot;Control.set&quot; &amp; psProperty) : iArgNr = 1
1906 End Select
1908 If Not hasProperty(psProperty) Then Goto Trace_Error
1910 Select Case UCase(psProperty)
1911 Case UCase(&quot;BackColor&quot;)
1912 If Not Utils._hasUNOProperty(ControlModel, &quot;BackgroundColor&quot;) Then Goto Trace_Error
1913 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
1914 ControlModel.BackgroundColor = CLng(pvValue)
1915 Case UCase(&quot;BorderColor&quot;)
1916 If Not Utils._hasUNOProperty(ControlModel, &quot;BorderColor&quot;) Then Goto Trace_Error
1917 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
1918 ControlModel.BorderColor = CLng(pvValue)
1919 Case UCase(&quot;BorderStyle&quot;)
1920 If Not Utils._hasUNOProperty(ControlModel, &quot;BorderColor&quot;) Then Goto Trace_Error
1921 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
1922 If pvValue &lt; 0 Or pvValue &gt; 2 Then Goto Trace_Error_Value &apos; 0 = No border, 1 = 3D border, 2 = Normal border
1923 ControlModel.Border = CLng(pvValue)
1924 Case UCase(&quot;Cancel&quot;)
1925 If Not Utils._hasUNOProperty(ControlModel, &quot;PushButtonType&quot;) Then Goto Trace_Error
1926 If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
1927 If pvValue Then vButton = com.sun.star.awt.PushButtonType.CANCEL Else vButton = com.sun.star.awt.PushButtonType.STANDARD
1928 ControlModel.PushButtonType = vButton
1929 Case UCase(&quot;Caption&quot;)
1930 If Not Utils._hasUNOProperty(ControlModel, &quot;Label&quot;) Then Goto Trace_Error
1931 If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
1932 ControlModel.Label = pvValue
1933 Case UCase(&quot;ControlTipText&quot;)
1934 If Not Utils._hasUNOProperty(ControlModel, &quot;HelpText&quot;) Then Goto Trace_Error
1935 If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
1936 ControlModel.HelpText = pvValue
1937 Case UCase(&quot;Default&quot;)
1938 If Not Utils._hasUNOProperty(ControlModel, &quot;DefaultButton&quot;) Then Goto Trace_Error
1939 If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
1940 ControlModel.DefaultButton = pvValue
1941 Case UCase(&quot;DefaultValue&quot;)
1942 Select Case _SubType
1943 Case CTLDATEFIELD
1944 If Not Utils._hasUNOProperty(ControlModel, &quot;DefaultDate&quot;) Then Goto Trace_Error
1945 If Not Utils._CheckArgument(pvValue, iArgNr, vbDate, , False) Then Goto Trace_Error_Value
1946 Select Case VarType(ControlModel.DefaultDate)
1947 Case vbEmpty, vbLong &apos; AOO and LO &lt;= 4.1
1948 ControlModel.DefaultDate = Year(pvValue) * 10000 + Month(pvValue) * 100 + Day(pvValue)
1949 Case vbObject &apos; LO &gt;= 4.2 com.sun.star.Util.Date
1950 ControlModel.DefaultDate.Year = Year(pvValue)
1951 ControlModel.DefaultDate.Month = Month(pvValue)
1952 ControlModel.DefaultDate.Day = Day(pvValue)
1953 End Select
1954 Case CTLLISTBOX
1955 If Not Utils._hasUNOProperty(ControlModel, &quot;DefaultSelection&quot;) Or Not Utils._hasUNOProperty(ControlModel, &quot;StringItemList&quot;) Then Goto Trace_Error
1956 If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
1957 For i = 0 To UBound(ControlModel.StringItemList)
1958 If UCase(pvValue) = UCase(ControlModel.StringItemList(i)) Then
1959 ControlModel.DefaultSelection = Array(i)
1960 Exit For
1961 End If
1962 Next i
1963 Case CTLSPINBUTTON
1964 If Not Utils._hasUNOProperty(ControlModel, &quot;DefaultSpinValue&quot;) Then Goto Trace_Error
1965 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
1966 ControlModel.DefaultSpinValue = pvValue
1967 Case CTLCHECKBOX
1968 If Not Utils._hasUNOProperty(ControlModel, &quot;DefaultState&quot;) Then Goto Trace_Error
1969 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
1970 If pvValue &lt; 0 Or pvValue &gt; 2 Then Goto Trace_Error_Value &apos; 0 = Not checked 1 = Checked 2 = don&apos;t know
1971 ControlModel.DefaultState = pvValue
1972 Case CTLRADIOBUTTON
1973 If Not Utils._hasUNOProperty(ControlModel, &quot;DefaultState&quot;) Then Goto Trace_Error
1974 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
1975 If pvValue &lt; 0 Or pvValue &gt; 1 Then Goto Trace_Error_Value &apos; 0 = Not checked 1 = Checked
1976 ControlModel.DefaultState = pvValue
1977 Case CTLCOMBOBOX, CTLFILECONTROL, CTLPATTERNFIELD, CTLTEXTFIELD
1978 If Not Utils._hasUNOProperty(ControlModel, &quot;DefaultText&quot;) Then Goto Trace_Error
1979 If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
1980 ControlModel.DefaultText = pvValue
1981 Case CTLTIMEFIELD
1982 If Not Utils._hasUNOProperty(ControlModel, &quot;DefaultTime&quot;) Then Goto Trace_Error
1983 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
1984 If pvValue &gt;= 0 And pvValue &lt;= 23595999 Then
1985 Select Case VarType(ControlModel.DefaultTime)
1986 Case vbEmpty, vbLong &apos; AOO and LO &lt;= 4.1
1987 ControlModel.DefaultTime = pvValue
1988 Case vbObject &apos; LO &gt;= 4.2 com.sun.star.Util.Time
1989 ControlModel.DefaultDate.Hours = Hour(pvValue)
1990 ControlModel.DefaultDate.Minutes = Minute(pvValue)
1991 ControlModel.DefaultDate.Seconds = Second(pvValue)
1992 End Select
1993 Else Goto Trace_Error_Value
1994 End If
1995 Case CTLCURRENCYFIELD, CTLNUMERICFIELD
1996 If Not Utils._hasUNOProperty(ControlModel, &quot;DefaultValue&quot;) Then Goto Trace_Error
1997 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
1998 ControlModel.DefaultValue = pvValue
1999 Case CTLFORMATTEDFIELD
2000 If Not Utils._hasUNOProperty(ControlModel, &quot;EffectiveDefault&quot;) Then Goto Trace_Error
2001 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
2002 ControlModel.EffectiveDefault = pvValue &apos; Thanks, PASTIM
2003 Case Else
2004 Goto Trace_Error
2005 End Select
2006 Case UCase(&quot;Enabled&quot;)
2007 If Not Utils._hasUNOProperty(ControlModel, &quot;Enabled&quot;) Then Goto Trace_Error
2008 If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
2009 ControlModel.Enabled = pvValue
2010 Case UCase(&quot;FontBold&quot;)
2011 If Not Utils._hasUNOProperty(ControlModel, &quot;FontWeight&quot;) Then Goto Trace_Error
2012 If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
2013 If pvValue Then &apos; Iif construction does not work !
2014 ControlModel.FontWeight = com.sun.star.awt.FontWeight.BOLD
2015 Else
2016 ControlModel.FontWeight = com.sun.star.awt.FontWeight.NORMAL
2017 End If
2018 Case UCase(&quot;FontItalic&quot;)
2019 If Not Utils._hasUNOProperty(ControlModel, &quot;FontSlant&quot;) Then Goto Trace_Error
2020 If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
2021 If pvValue Then &apos; Iif construction does not work !
2022 ControlModel.FontSlant = com.sun.star.awt.FontSlant.ITALIC
2023 Else
2024 ControlModel.FontSlant = com.sun.star.awt.FontSlant.NONE
2025 End If
2026 Case UCase(&quot;FontName&quot;)
2027 If Not Utils._hasUNOProperty(ControlModel, &quot;FontName&quot;) Then Goto Trace_Error
2028 If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
2029 ControlModel.FontName = pvValue
2030 Case UCase(&quot;FontSize&quot;)
2031 If Not Utils._hasUNOProperty(ControlModel, &quot;FontHeight&quot;) Then Goto Trace_Error
2032 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
2033 If pvValue &lt; 1 Or pvValue &gt; 127 Then Goto Trace_Error_Value
2034 ControlModel.FontHeight = pvValue
2035 Case UCase(&quot;FontUnderline&quot;)
2036 If Not Utils._hasUNOProperty(ControlModel, &quot;FontUnderline&quot;) Then Goto Trace_Error
2037 If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
2038 If pvValue Then &apos; Iif construction does not work !
2039 ControlModel.FontUnderline = com.sun.star.awt.FontUnderline.SINGLE
2040 Else
2041 ControlModel.FontUnderline = com.sun.star.awt.FontUnderline.NONE
2042 End If
2043 Case UCase(&quot;FontWeight&quot;)
2044 If Not Utils._hasUNOProperty(ControlModel, &quot;FontWeight&quot;) Then Goto Trace_Error
2045 If Not Utils._IsScalar(CSng(pvValue), vbSingle, Array( _
2046 com.sun.star.awt.FontWeight.THIN _
2047 , com.sun.star.awt.FontWeight.ULTRALIGHT _
2048 , com.sun.star.awt.FontWeight.LIGHT _
2049 , com.sun.star.awt.FontWeight.SEMILIGHT _
2050 , com.sun.star.awt.FontWeight.NORMAL _
2051 , com.sun.star.awt.FontWeight.SEMIBOLD _
2052 , com.sun.star.awt.FontWeight.BOLD _
2053 , com.sun.star.awt.FontWeight.ULTRABOLD _
2054 , com.sun.star.awt.FontWeight.BLACK _
2055 )) Then Goto Trace_Error_Value
2056 ControlModel.FontWeight = pvValue
2057 Case UCase(&quot;Format&quot;)
2058 If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
2059 vFormats = _Formats(_SubType)
2060 Select Case _SubType
2061 Case CTLDATEFIELD, CTLTIMEFIELD
2062 bFound = False
2063 For i = 0 To UBound(vFormats)
2064 If UCase(pvValue) = UCase(vFormats(i)) Then
2065 If _SubType = CTLDATEFIELD Then
2066 If Utils._hasUNOProperty(ControlModel, &quot;DateFormat&quot;) Then ControlModel.DateFormat = i Else Goto Trace_Error
2067 Else
2068 If Utils._hasUNOProperty(ControlModel, &quot;TimeFormat&quot;) Then ControlModel.TimeFormat = i Else Goto Trace_Error
2069 End If
2070 bFound = True
2071 Exit For
2072 End If
2073 Next i
2074 If Not bFound Then Goto Trace_Error_Value
2075 Case Else
2076 Goto Trace_Error
2077 End Select
2078 Case UCase(&quot;ForeColor&quot;)
2079 If Not Utils._hasUNOProperty(ControlModel, &quot;TextColor&quot;) Then Goto Trace_Error
2080 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
2081 ControlModel.TextColor = CLng(pvValue)
2082 Case UCase(&quot;ListIndex&quot;)
2083 If Not Utils._hasUNOProperty(ControlModel, &quot;StringItemList&quot;) Then Goto Trace_Error
2084 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
2085 If pvValue &lt; 0 Or pvValue &gt; UBound(ControlModel.StringItemList) Then Goto Trace_Error_Value
2086 Select Case _SubType
2087 Case CTLCOMBOBOX
2088 ControlModel.Text = ControlModel.StringItemList(pvValue)
2089 Case CTLLISTBOX
2090 ControlModel.SelectedItems = Array(pvValue)
2091 End Select
2092 Case UCase(&quot;Locked&quot;)
2093 If Not Utils._hasUNOProperty(ControlModel, &quot;ReadOnly&quot;) Then Goto Trace_Error
2094 If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
2095 ControlModel.ReadOnly = pvValue
2096 Case UCase(&quot;MultiSelect&quot;)
2097 If Not Utils._hasUNOProperty(ControlModel, &quot;MultiSelection&quot;) And Not Utils._hasUNOProperty(ControlModel, &quot;MultiSelectionSimpleMode&quot;) Then Goto Trace_Error
2098 If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
2099 If Utils._hasUNOProperty(ControlModel, &quot;MultiSelection&quot;) Then
2100 ControlModel.MultiSelection = pvValue
2101 ElseIf Utils._hasUNOProperty(ControlModel, &quot;MultiSelectionSimpleMode&quot;) Then
2102 ControlModel.MultiSelectionSimpleMode = pvValue
2103 End If
2104 If Not pvValue Then ControlModel.SelectedItems = Array() &apos; Cancel selections when MultiSelect becomes False
2105 Case UCase(&quot;OnActionPerformed&quot;), UCase(&quot;OnAdjustmentValueChanged&quot;), UCase(&quot;OnApproveAction&quot;), UCase(&quot;OnApproveReset&quot;) _
2106 , UCase(&quot;OnApproveUpdate&quot;), UCase(&quot;OnChanged&quot;), UCase(&quot;OnErrorOccurred&quot;), UCase(&quot;OnFocusGained&quot;) _
2107 , UCase(&quot;OnFocusLost&quot;), UCase(&quot;OnItemStateChanged&quot;), UCase(&quot;OnKeyPressed&quot;), UCase(&quot;OnKeyReleased&quot;) _
2108 , UCase(&quot;OnMouseDragged&quot;), UCase(&quot;OnMouseEntered&quot;), UCase(&quot;OnMouseExited&quot;), UCase(&quot;OnMouseMoved&quot;) _
2109 , UCase(&quot;OnMousePressed&quot;), UCase(&quot;OnMouseReleased&quot;), UCase(&quot;OnResetted&quot;), UCase(&quot;OnTextChanged&quot;) _
2110 , UCase(&quot;OnUpdated&quot;)
2111 If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
2112 Select Case _ParentType
2113 Case CTLPARENTISDIALOG
2114 If Not Utils._RegisterDialogEventScript(ControlModel _
2115 , psProperty _
2116 , _GetListener(psProperty) _
2117 , pvValue _
2118 ) Then GoTo Trace_Error
2119 Case Else
2120 If Not Utils._RegisterEventScript(ControlModel _
2121 , psProperty _
2122 , _GetListener(psProperty) _
2123 , pvValue _
2124 , _Name _
2125 ) Then GoTo Trace_Error
2126 End Select
2127 Case UCase(&quot;OptionValue&quot;)
2128 If Not Utils._hasUNOProperty(ControlModel, &quot;RefValue&quot;) Then Goto Trace_Error
2129 If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
2130 If Not Utils._hasUNOProperty(ControlModel, &quot;Label&quot;) Then
2131 If pvValue = &quot;&quot; Then Goto Trace_Error_Value
2132 If ControlModel.RefValue &lt;&gt; &quot;&quot; Then ControlModel.RefValue = pvValue
2133 Else
2134 ControlModel.Label = pvValue
2135 End If
2136 Case UCase(&quot;Page&quot;)
2137 If Not Utils._hasUNOProperty(ControlModel, &quot;Step&quot;) Then Goto Trace_Error
2138 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
2139 If pvValue &lt; 0 Then Goto Trace_Error_Value
2140 ControlModel.Step = pvValue
2141 Case UCase(&quot;Picture&quot;)
2142 If Not Utils._hasUNOProperty(ControlModel, &quot;ImageURL&quot;) Then Goto Trace_Error
2143 If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
2144 ControlModel.ImageURL = ConvertToUrl(pvValue)
2145 Case UCase(&quot;Required&quot;)
2146 If Not Utils._hasUNOProperty(ControlModel, &quot;InputRequired&quot;) Then Goto Trace_Error
2147 If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
2148 ControlModel.InputRequired = pvValue
2149 Case UCase(&quot;RowSource&quot;)
2150 Select Case _ParentType
2151 Case CTLPARENTISDIALOG
2152 If Not Utils._hasUNOProperty(ControlModel, &quot;StringItemList&quot;) Then Goto Trace_Error
2153 ControlModel.StringItemList = Split(pvValue, &quot;;&quot;)
2154 Case Else
2155 If Not Utils._hasUNOProperty(ControlModel, &quot;ListSource&quot;) Then Goto Trace_Error
2156 If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
2157 Select Case ControlModel.ListSourceType
2158 Case com.sun.star.form.ListSourceType.QUERY _
2159 , com.sun.star.form.ListSourceType.TABLE _
2160 , com.sun.star.form.ListSourceType.TABLEFIELDS
2161 Set odbDatabase = Application._CurrentDb(_DocEntry, _DbEntry)
2162 If ControlModel.ListSourceType = com.sun.star.form.ListSourceType.QUERY Then vNames = odbDatabase.Connection.getQueries.GetElementNames _
2163 Else vNames = odbDatabase.Connection.getTables.GetElementNames
2164 bFound = False &apos; Check existence of table or query and find its correct (case-sensitive) name
2165 For i = 0 To UBound(vNames)
2166 If UCase(vNames(i)) = UCase(pvValue) Then
2167 bFound = True
2168 sName = vNames(i)
2169 Exit For
2170 End If
2171 Next i
2172 If Not bFound Then Goto Trace_Error_Value
2173 If _SubType = CTLCOMBOBOX Then ControlModel.ListSource = sName Else ControlModel.ListSource = Array(sName)
2174 ControlModel.refresh()
2175 Case com.sun.star.form.ListSourceType.SQL
2176 Set odbDatabase = Application._CurrentDb(_DocEntry, _DbEntry)
2177 If _SubType = CTLCOMBOBOX Then ControlModel.ListSource = odbDatabase._ReplaceSquareBrackets(pvValue) Else ControlModel.ListSource = Array(odbDatabase._ReplaceSquareBrackets(pvValue))
2178 ControlModel.refresh()
2179 Case com.sun.star.form.ListSourceType.VALUELIST &apos; Forbidden for COMBOBOX !
2180 If _SubType = CTLCOMBOBOX Then Goto Trace_Error
2181 ControlModel.ListSource = Split(pvValue, &quot;;&quot;)
2182 ControlModel.StringItemList = ControlModel.ListSource
2183 Case com.sun.star.form.ListSourceType.SQLPASSTHROUGH
2184 If _SubType = CTLCOMBOBOX Then ControlModel.ListSource = pvValue Else ControlModel.ListSource = Array(pvValue)
2185 ControlModel.refresh()
2186 End Select
2187 End Select
2188 If _SubType = CTLLISTBOX Then ControlModel.SelectedItems = Array()
2189 Case UCase(&quot;RowSourceType&quot;) &apos; Refresh done when RowSource changes, not RowSourceType
2190 If Not Utils._hasUNOProperty(ControlModel, &quot;ListSourceType&quot;) Then Goto Trace_Error
2191 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
2192 If Not Utils._IsScalar(pvValue, Utils._AddNumeric(), Array( _
2193 com.sun.star.form.ListSourceType.VALUELIST _
2194 , com.sun.star.form.ListSourceType.TABLE _
2195 , com.sun.star.form.ListSourceType.QUERY _
2196 , com.sun.star.form.ListSourceType.SQL _
2197 , com.sun.star.form.ListSourceType.SQLPASSTHROUGH _
2198 , com.sun.star.form.ListSourceType.TABLEFIELDS _
2199 )) Then Goto Trace_Error_Value
2200 ControlModel.ListSourceType = pvValue
2201 Case UCase(&quot;Selected&quot;)
2202 If Not Utils._hasUNOProperty(ControlModel, &quot;SelectedItems&quot;) Then Goto Trace_Error
2203 If Not Utils._hasUNOProperty(ControlModel, &quot;StringItemList&quot;) Then Goto Trace_Error
2204 If Utils._hasUNOProperty(ControlModel, &quot;MultiSelection&quot;) Then
2205 bMultiSelect = ControlModel.MultiSelection
2206 ElseIf Utils._hasUNOProperty(ControlModel, &quot;MultiSelectionSimpleMode&quot;) Then
2207 bMultiSelect = ControlModel.MultiSelectionSimpleMode
2208 Else: Goto Trace_Error
2209 End If
2210 lListCount = UBound(ControlModel.StringItemList) + 1
2211 If IsMissing(pvIndex) Then &apos; Full boolean array passed
2212 If Not IsArray(pvValue) Then Goto Trace_Error_Array
2213 If LBound(pvValue) &lt;&gt; 0 Or UBound(pvValue) &lt; 0 Then Goto Trace_Error_Array
2214 If Not Utils._CheckArgument(pvValue(0), iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
2215 If UBound(pvValue) &lt;&gt; lListCount - 1 Then Goto Trace_Error_Index
2216 iCount = 0
2217 For i = 0 To UBound(pvValue) &apos; Count True values
2218 If pvValue(i) Then iCount = iCount + 1
2219 Next i
2220 If iCount &gt; 0 Then
2221 Redim iSelectedItems(0 To iCount - 1)
2222 iCount = 0
2223 For i = 0 To UBound(pvValue)
2224 If pvValue(i) Then
2225 iSelectedItems(iCount) = i
2226 iCount = iCount + 1
2227 End If
2228 Next i
2229 ControlModel.SelectedItems = iSelectedItems &apos; iSelectedItems maps OO internals (size = # of selected items)
2230 Else
2231 ControlModel.SelectedItems = Array()
2232 End If
2233 Else &apos; Single boolean value passed
2234 If Not Utils._CheckArgument(pvIndex, iArgNr + 1, Utils._AddNumeric()) Then Goto Exit_Function
2235 If pvIndex &lt; 0 Or pvIndex &gt;= lListCount Then Goto Trace_Error_Index
2236 If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
2237 ReDim bSelected(0 To lListCount - 1) &apos; bSelected maps VBA internals (size = # of displayed items)
2238 If Not bMultiSelect Then &apos; Set all other values to False
2239 For i = 0 To lListCount - 1
2240 If i = pvIndex Then
2241 bSelected(i) = pvValue &apos; All entries = False except one
2242 Else
2243 bSelected(i) = False
2244 End If
2245 Next i
2246 Else
2247 For i = 0 To lListCount - 1
2248 bSelected(i) = False
2249 Next i
2250 iSelectedItems = ControlModel.SelectedItems
2251 iCount = UBound(iSelectedItems)
2252 For i = 0 To iCount
2253 bSelected(iSelectedItems(i)) = True
2254 Next i
2255 bSelected(pvIndex) = pvValue
2256 End If
2257 iCount = 0 &apos; Rebuild SelectedItems
2258 For i = 0 To lListCount - 1
2259 If bSelected(i) Then iCount = iCount + 1
2260 Next i
2261 If iCount &gt; 0 Then
2262 Redim iSelectedItems(0 To iCount - 1)
2263 iCount = 0
2264 For i = 0 To lListCount - 1
2265 If bSelected(i) Then
2266 iSelectedItems(iCount) = i
2267 iCount = iCount + 1
2268 End If
2269 Next i
2270 ControlModel.SelectedItems = iSelectedItems
2271 Else
2272 ControlModel.SelectedItems = Array()
2273 End If
2274 End If
2275 Case UCase(&quot;SelLength&quot;)
2276 If Not Utils._hasUNOProperty(ControlView, &quot;Selection&quot;) Then Goto trace_Error
2277 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
2278 If pvValue &lt; 0 Then Goto Trace_Error_Value
2279 vSelection = ControlView.getSelection()
2280 vSelection.Max = vSelection.Min + pvValue
2281 ControlView.setSelection(vSelection)
2282 Case UCase(&quot;SelStart&quot;)
2283 If Not Utils._hasUNOProperty(ControlView, &quot;Selection&quot;) Then Goto trace_Error
2284 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
2285 If pvValue &lt; 1 Or pvValue &gt; Len(ControlModel.Text) + 1 Then Goto Trace_Error_Value
2286 vSelection = ControlView.getSelection()
2287 vSelection.Min = pvValue - 1
2288 vSelection.Max = pvValue - 1 &apos; Also reset length to 0
2289 ControlView.setSelection(vSelection)
2290 Case UCase(&quot;SelText&quot;)
2291 If Not Utils._hasUNOProperty(ControlView, &quot;Selection&quot;) Then Goto trace_Error
2292 If Not Utils._hasUNOProperty(ControlModel, &quot;Text&quot;) Then Goto trace_Error
2293 If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
2294 If Len(pvValue) &gt; 0 Then
2295 vSelection = ControlView.getSelection()
2296 sText = ControlModel.Text
2297 lStart = InStr(1, sText, pvValue, 0) &apos; Case sensitive !
2298 If lStart &gt; 0 Then
2299 vSelection.Min = lStart - 1
2300 vSelection.Max = lStart + Len(pvValue) - 1
2301 ControlView.setSelection(vSelection)
2302 End If
2303 End If
2304 Case UCase(&quot;SpecialEffect&quot;)
2305 If Not Utils._hasUNOProperty(ControlModel, &quot;VisualEffect&quot;) Then Goto Trace_Error
2306 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
2307 If pvValue &lt; 0 Or pvValue &gt; 2 Then Goto Trace_Error_Value &apos; 0 = None, 1 = Look3D, 2 = Flat
2308 ControlModel.VisualEffect = pvValue
2309 Case UCase(&quot;TabIndex&quot;)
2310 If Not Utils._hasUNOProperty(ControlModel, &quot;TabIndex&quot;) Then Goto Trace_Error
2311 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
2312 If pvValue &lt; -1 Then Goto Trace_Error_Value
2313 ControlModel.TabIndex = pvValue
2314 Case UCase(&quot;TabStop&quot;)
2315 If Not Utils._hasUNOProperty(ControlModel, &quot;Tabstop&quot;) Then Goto Trace_Error
2316 If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
2317 ControlModel.Tabstop = pvValue
2318 Case UCase(&quot;Tag&quot;)
2319 If Not Utils._hasUNOProperty(ControlModel, &quot;Tag&quot;) Then Goto Trace_Error
2320 If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
2321 ControlModel.Tag = pvValue
2322 Case UCase(&quot;TextAlign&quot;)
2323 If Not Utils._hasUNOProperty(ControlModel, &quot;Align&quot;) Then Goto Trace_Error
2324 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
2325 If pvValue &lt; 0 Or pvValue &gt; 2 Then Goto Trace_Error_Value &apos; 0 = Left, 1 = Center, 2 = Right
2326 ControlModel.Align = pvValue
2327 Case UCase(&quot;TripleState&quot;)
2328 If Not Utils._hasUNOProperty(ControlModel, &quot;TriState&quot;) Then Goto Trace_Error
2329 If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
2330 ControlModel.TriState = pvValue
2331 Case UCase(&quot;Value&quot;)
2332 Select Case _SubType
2333 Case CTLCHECKBOX
2334 If Not Utils._hasUNOProperty(ControlModel, &quot;State&quot;) Then Goto Trace_Error
2335 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(vbBoolean), , False) Then Goto Trace_Error_Value
2336 If VarType(pvValue) = vbBoolean Then pvValue = Iif(pvValue, 1, 0)
2337 If pvValue &lt; 0 Or pvValue &gt; 2 Then Goto Trace_Error_Value &apos; 0 = Not checked 1 = Checked 2 = don&apos;t know
2338 ControlModel.State = pvValue
2339 Case CTLCOMMANDBUTTON
2340 If Not Utils._hasUNOProperty(ControlModel, &quot;State&quot;) Then Goto Trace_Error
2341 If Not Utils._hasUNOProperty(ControlModel, &quot;Toggle&quot;) Then Goto Trace_Error
2342 If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
2343 If pvValue Then ControlModel.State = 1 Else ControlModel.State = 0
2344 Case CTLCOMBOBOX
2345 If Not Utils._hasUNOProperty(ControlModel, &quot;Text&quot;) Or Not Utils._hasUNOProperty(ControlModel, &quot;StringItemList&quot;) _
2346 Then Goto Trace_Error
2347 If pvValue &lt;&gt; &quot;&quot; Then
2348 If Not Utils._CheckArgument(pvValue, iArgNr, vbString, ControlModel.StringItemList, False) Then Goto Trace_Error_Value
2349 End If
2350 ControlModel.Text = pvValue
2351 Case CTLCURRENCYFIELD, CTLNUMERICFIELD
2352 If Not Utils._hasUNOProperty(ControlModel, &quot;Value&quot;) Then Goto Trace_Error
2353 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
2354 ControlModel.Value = pvValue
2355 Case CTLDATEFIELD
2356 If Not Utils._hasUNOProperty(ControlModel, &quot;Date&quot;) Then Goto Trace_Error
2357 If Not Utils._CheckArgument(pvValue, iArgNr, vbDate, , False) Then Goto Trace_Error_Value
2358 Select Case _InspectPropertyType(ControlModel, &quot;Date&quot;)
2359 Case &quot;long&quot; &apos; AOO and LO &lt;= 4.1
2360 &apos;ControlModel.Date = Year(pvValue) * 10000 + Month(pvValue) * 100 + Day(pvValue) &apos; Gives error in dialogs ?!?
2361 ControlModel.setPropertyValue(&quot;Date&quot;, Year(pvValue) * 10000 + Month(pvValue) * 100 + Day(pvValue))
2362 Case &quot;com.sun.star.util.Date&quot; &apos; LO &gt;= 4.2
2363 &apos;Direct assignment of ControlModel.Date.Xxx has no effect ?!?
2364 Set oStruct = CreateUnoStruct(&quot;com.sun.star.util.Date&quot;)
2365 oStruct.Year = Year(pvValue)
2366 oStruct.Month = Month(pvValue)
2367 oStruct.Day = Day(pvValue)
2368 Set ControlModel.Date = oStruct
2369 End Select
2370 Case CTLFILECONTROL, CTLPATTERNFIELD, CTLTEXTFIELD
2371 If Not Utils._hasUNOProperty(ControlModel, &quot;Text&quot;) Then Goto Trace_Error
2372 If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
2373 ControlModel.Text = pvValue
2374 Case CTLFORMATTEDFIELD
2375 If Not Utils._hasUNOProperty(ControlModel, &quot;EffectiveValue&quot;) Then Goto Trace_Error
2376 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(vbString), , False) Then Goto Trace_Error_Value
2377 ControlModel.EffectiveValue = pvValue
2378 Case CTLHIDDENCONTROL
2379 If Not Utils._hasUNOProperty(ControlModel, &quot;HiddenValue&quot;) Then Goto Trace_Error
2380 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(Array(vbString, vbBoolean, vbDate)), , False) Then Goto Trace_Error_Value
2381 ControlModel.HiddenValue = pvValue
2382 Case CTLLISTBOX
2383 If Not Utils._hasUNOProperty(ControlModel, &quot;SelectedItems&quot;) Or Not Utils._hasUNOProperty(ControlModel, &quot;StringItemList&quot;) _
2384 Then Goto Trace_Error
2385 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(Array(vbString, vbDate)), , False) Then Goto Trace_Error_Value &apos; PASTIM
2386 If IsArray(pvValue) Then Goto Trace_Error_Value &apos; Setting the value on a listbox is allowed only if single value and value in the list
2387 &apos; Check ValueItemList
2388 bFound = False
2389 Select Case _ParentType
2390 Case CTLPARENTISDIALOG
2391 vItemList = ControlModel.StringItemList
2392 Case Else
2393 If _ListboxBound() Then &apos; Performance improvement (PASTIM PM 9 Feb 2013)
2394 If Not Utils._hasUNOProperty(ControlModel, &quot;ValueItemList&quot;) Then Goto Trace_Error
2395 vItemList = ControlModel.ValueItemList
2396 Else
2397 vItemList = ControlModel.StringItemList
2398 End If
2399 End Select
2400 For i = 0 To UBound(vItemList)
2401 If pvValue = vItemList(i) Then
2402 bFound = True
2403 Exit For
2404 End If
2405 Next i
2406 If bFound Then ControlModel.SelectedItems = Array(i) Else Goto Trace_Error_Value
2407 Case CTLPROGRESSBAR
2408 If Not Utils._hasUNOProperty(ControlModel, &quot;ProgressValue&quot;) Then Goto Trace_Error
2409 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
2410 If Utils._hasUNOProperty(ControlModel, &quot;ProgressValueMin&quot;) Then
2411 If pvValue &lt; ControlModel.ProgressValueMin Then Goto Trace_Error_Value
2412 End If
2413 If Utils._hasUNOProperty(ControlModel, &quot;ProgressValueMax&quot;) Then
2414 If pvValue &gt; ControlModel.ProgressValueMax Then Goto Trace_Error_Value
2415 End If
2416 ControlModel.ProgressValue = pvValue
2417 Case CTLSCROLLBAR
2418 If Not Utils._hasUNOProperty(ControlModel, &quot;ScrollValue&quot;) Then Goto Trace_Error
2419 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
2420 If Utils._hasUNOProperty(ControlModel, &quot;ScrollValueMin&quot;) Then
2421 If pvValue &lt; ControlModel.ScrollValueMin Then Goto Trace_Error_Value
2422 End If
2423 If Utils._hasUNOProperty(ControlModel, &quot;ScrollValueMax&quot;) Then
2424 If pvValue &gt; ControlModel.ScrollValueMax Then Goto Trace_Error_Value
2425 End If
2426 ControlModel.ScrollValue = pvValue
2427 Case CTLSPINBUTTON
2428 If Not Utils._hasUNOProperty(ControlModel, &quot;SpinValue&quot;) Then Goto Trace_Error
2429 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
2430 If Utils._hasUNOProperty(ControlModel, &quot;SpinValueMin&quot;) Then
2431 If pvValue &lt; ControlModel.SpinValueMin Then Goto Trace_Error_Value
2432 End If
2433 If Utils._hasUNOProperty(ControlModel, &quot;SpinValueMax&quot;) Then
2434 If pvValue &gt; ControlModel.SpinValueMax Then Goto Trace_Error_Value
2435 End If
2436 ControlModel.SpinValue = pvValue
2437 Case CTLTIMEFIELD
2438 If Not Utils._hasUNOProperty(ControlModel, &quot;Time&quot;) Then Goto Trace_Error
2439 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
2440 Select Case _InspectPropertyType(ControlModel, &quot;Time&quot;)
2441 Case &quot;long&quot; &apos; AOO and LO &lt;= 4.0
2442 ControlModel.Time = CLng(pvValue)
2443 Case &quot;com.sun.star.util.Time&quot; &apos; LO &gt;= 4.1
2444 &apos;Direct assignment of ControlModel.Time.Xxx gives error ?!?
2445 Set oStruct = CreateUnoStruct(&quot;com.sun.star.util.Time&quot;)
2446 sValue = Right(&quot;00000000&quot; &amp; Str(CLng(pvValue)), 8)
2447 oStruct.Hours = Val(Left(sValue, 2))
2448 oStruct.Minutes = Val(Mid(sValue, 3, 2))
2449 oStruct.Seconds = Val(Mid(sValue, 5, 2))
2450 Set ControlModel.Time = oStruct
2451 End Select
2452 Case Else
2453 Goto Trace_Error
2454 End Select
2455 &apos; FINAL COMMITMENT
2456 If Utils._hasUNOMethod(ControlModel, &quot;commit&quot;) Then ControlModel.commit() &apos; f.i. checkboxes have no commit method ?? [PASTIM]
2457 Case UCase(&quot;Visible&quot;)
2458 If _SubType = CTLHIDDENCONTROL Then Goto Trace_Error &apos; Hidden remains hidden !!
2459 If Not Utils._hasUNOMethod(ControlView, &quot;setVisible&quot;) Then Goto Trace_Error
2460 If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
2461 If pvValue Then ControlModel.EnableVisible = True
2462 ControlView.setVisible(pvValue)
2463 Case Else
2464 Goto Trace_Error
2465 End Select
2467 Exit_Function:
2468 Utils._ResetCalledSub(&quot;Control.set&quot; &amp; psProperty)
2469 Exit Function
2470 Trace_Error:
2471 TraceError(TRACEFATAL, ERRPROPERTY, Utils._CalledSub(), 0, , psProperty)
2472 _PropertySet = False
2473 Goto Exit_Function
2474 Trace_Error_Value:
2475 TraceError(TRACEFATAL, ERRPROPERTYVALUE, Utils._CalledSub(), 0, 1, Array(pvValue, psProperty))
2476 _PropertySet = False
2477 Goto Exit_Function
2478 Trace_Error_Index:
2479 TraceError(TRACEFATAL, ERRINDEXVALUE, Utils._CalledSub(), 0, 1, psProperty)
2480 _PropertySet = False
2481 Goto Exit_Function
2482 Trace_Error_Array:
2483 TraceError(TRACEFATAL, ERRPROPERTYNOTARRAY, Utils._CalledSub(), 0, 1, iArgNr)
2484 _PropertySet = False
2485 Goto Exit_Function
2486 Error_Function:
2487 TraceError(TRACEABORT, Err, &quot;Control._PropertySet&quot;, Erl)
2488 _PropertySet = False
2489 GoTo Exit_Function
2490 End Function &apos; _PropertySet V1.1.0
2492 </script:module>