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