cURL: follow redirects
[LibreOffice.git] / wizards / source / access2base / Dialog.xba
blob9d633cda14cb44dd2f550fd60cfb5c148c496db6
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="Dialog" script:language="StarBasic">REM =======================================================================================================================
4 REM === The Access2Base library is a part of the LibreOffice project. ===
5 REM === Full documentation is available on http://www.access2base.com ===
6 REM =======================================================================================================================
8 Option Compatible
9 Option ClassModule
11 Option Explicit
13 REM -----------------------------------------------------------------------------------------------------------------------
14 REM --- CLASS ROOT FIELDS ---
15 REM -----------------------------------------------------------------------------------------------------------------------
17 Private _Type As String &apos; Must be FORM
18 Private _Name As String
19 Private _Shortcut As String
20 Private _Dialog As Object &apos; com.sun.star.io.XInputStreamProvider
21 Private UnoDialog As Object &apos; com.sun.star.awt.XControl
23 REM -----------------------------------------------------------------------------------------------------------------------
24 REM --- CONSTRUCTORS / DESTRUCTORS ---
25 REM -----------------------------------------------------------------------------------------------------------------------
26 Private Sub Class_Initialize()
27 _Type = OBJDIALOG
28 _Name = &quot;&quot;
29 Set _Dialog = Nothing
30 Set UnoDialog = Nothing
31 End Sub &apos; Constructor
33 REM -----------------------------------------------------------------------------------------------------------------------
34 Private Sub Class_Terminate()
35 On Local Error Resume Next
36 Call Class_Initialize()
37 End Sub &apos; Destructor
39 REM -----------------------------------------------------------------------------------------------------------------------
40 Public Sub Dispose()
41 Call Class_Terminate()
42 End Sub &apos; Explicit destructor
44 REM -----------------------------------------------------------------------------------------------------------------------
45 REM --- CLASS GET/LET/SET PROPERTIES ---
46 REM -----------------------------------------------------------------------------------------------------------------------
47 REM -----------------------------------------------------------------------------------------------------------------------
48 Property Get Caption() As Variant
49 Caption = _PropertyGet(&quot;Caption&quot;)
50 End Property &apos; Caption (get)
52 Property Let Caption(ByVal pvValue As Variant)
53 Call _PropertySet(&quot;Caption&quot;, pvValue)
54 End Property &apos; Caption (set)
56 REM -----------------------------------------------------------------------------------------------------------------------
57 Property Get Height() As Variant
58 Height = _PropertyGet(&quot;Height&quot;)
59 End Property &apos; Height (get)
61 Property Let Height(ByVal pvValue As Variant)
62 Call _PropertySet(&quot;Height&quot;, pvValue)
63 End Property &apos; Height (set)
65 REM -----------------------------------------------------------------------------------------------------------------------
66 Property Get IsLoaded() As Boolean
67 IsLoaded = _PropertyGet(&quot;IsLoaded&quot;)
68 End Property
70 REM -----------------------------------------------------------------------------------------------------------------------
71 Property Get Name() As String
72 Name = _PropertyGet(&quot;Name&quot;)
73 End Property &apos; Name (get)
75 Public Function pName() As String &apos; For compatibility with &lt; V0.9.0
76 pName = _PropertyGet(&quot;Name&quot;)
77 End Function &apos; pName (get)
79 REM -----------------------------------------------------------------------------------------------------------------------
80 Property Get ObjectType() As String
81 ObjectType = _PropertyGet(&quot;ObjectType&quot;)
82 End Property &apos; ObjectType (get)
84 REM -----------------------------------------------------------------------------------------------------------------------
85 Public Function OptionGroup(ByVal Optional pvGroupName As Variant) As Variant
86 &apos; Return either an error or an object of type OPTIONGROUP based on its name
87 &apos; A group is determined by the successive TabIndexes of the radio button
88 &apos; The name of the group = the name of its first element
90 Utils._SetCalledSub(&quot;Dialog.OptionGroup&quot;)
91 If IsMissing(pvGroupName) Then Call _TraceArguments()
92 If _ErrorHandler() Then On Local Error Goto Error_Function
94 Set OptionGroup = Nothing
95 If Not Utils._CheckArgument(pvGroupName, 1, vbString) Then Goto Exit_Function
97 Dim iAllCount As Integer, iRadioLast As Integer, iGroupCount As Integer, iBegin As Integer, iEnd As Integer
98 Dim oRadios() As Object, sGroupName As String
99 Dim i As Integer, j As Integer, bFound As Boolean, ocControl As Object, oRadio As Object, iTabIndex As Integer
100 Dim ogGroup As Object, vGroup() As Variant, vIndex() As Variant
101 iAllCount = Controls.Count
102 If iAllCount &gt; 0 Then
103 iRadioLast = -1
104 ReDim oRadios(0 To iAllCount - 1)
105 For i = 0 To iAllCount - 1 &apos; Store all RadioButtons objects
106 Set ocControl = Controls(i)
107 If ocControl._SubType = CTLRADIOBUTTON Then
108 iRadioLast = iRadioLast + 1
109 Set oRadios(iRadioLast) = ocControl
110 End If
111 Next i
112 Else
113 Goto Error_Arg &apos; No control in dialog
114 End If
116 If iRadioLast &lt; 0 then Goto Error_Arg &apos; No radio buttons in the dialog
118 &apos;Resort oRadio array based on tab indexes
119 If iRadioLast &gt; 0 Then
120 For i = 0 To iRadioLast - 1 &apos; Bubble sort
121 For j = i + 1 To iRadioLast
122 If oRadios(i).TabIndex &gt; oRadios(j).TabIndex Then
123 Set oRadio = oRadios(i)
124 Set oRadios(i) = oRadios(j)
125 Set oRadios(j) = oRadio
126 End If
127 Next j
128 Next i
129 End If
131 &apos;Scan Names to find match with argument
132 bFound = False
133 For i = 0 To iRadioLast
134 If UCase(oRadios(i)._Name) = UCase(pvGroupName) Then
135 Select Case i
136 Case 0 : bFound = True
137 Case Else
138 If oRadios(i).TabIndex &gt; oRadios(i - 1).TabIndex + 1 Then
139 bFound = True
140 Else
141 Goto Error_Arg &apos; same group as preceding item although name correct
142 End If
143 End Select
144 If bFound Then
145 iBegin = i
146 iEnd = i
147 sGroupName = oRadios(i)._Name
148 End If
149 ElseIf bFound Then
150 If oRadios(i).TabIndex = oRadios(i - 1).TabIndex + 1 Then iEnd = i
151 End If
152 Next i
154 If bFound Then &apos; Create OptionGroup
155 iGroupCount = iEnd - iBegin + 1
156 Set ogGroup = New OptionGroup
157 ReDim vGroup(0 To iGroupCount - 1)
158 ReDim vIndex(0 To iGroupCount - 1)
159 With ogGroup
160 ._Name = sGroupName
161 ._Count = iGroupCount
162 ._ButtonsGroup = vGroup
163 ._ButtonsIndex = vIndex
164 For i = 0 To iGroupCount - 1
165 Set ._ButtonsGroup(i) = oRadios(iBegin + i).ControlModel
166 ._ButtonsIndex(i) = i
167 Next i
168 ._ParentType = CTLPARENTISDIALOG
169 ._ParentComponent = UnoDialog
170 End With
171 Else Goto Error_Arg
172 End If
174 Set OptionGroup = ogGroup
176 Exit_Function:
177 Utils._ResetCalledSub(&quot;Dialog.OptionGroup&quot;)
178 Exit Function
179 Error_Arg:
180 TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), 0, , Array(1, pvGroupName))
181 Goto Exit_Function
182 Error_Function:
183 TraceError(TRACEABORT, Err, &quot;Dialog.OptionGroup&quot;, Erl)
184 GoTo Exit_Function
185 End Function &apos; OptionGroup V0.9.1
187 REM -----------------------------------------------------------------------------------------------------------------------
188 Property Get Page() As Variant
189 Page = _PropertyGet(&quot;Page&quot;)
190 End Property &apos; Page (get)
192 Property Let Page(ByVal pvValue As Variant)
193 Call _PropertySet(&quot;Page&quot;, pvValue)
194 End Property &apos; Page (set)
196 REM -----------------------------------------------------------------------------------------------------------------------
197 Public Function Properties(ByVal Optional pvIndex As Variant) As Variant
198 &apos; Return
199 &apos; a Collection object if pvIndex absent
200 &apos; a Property object otherwise
202 Dim vProperty As Variant, vPropertiesList() As Variant, sObject As String
203 vPropertiesList = _PropertiesList()
204 sObject = Utils._PCase(_Type)
205 If IsMissing(pvIndex) Then
206 vProperty = PropertiesGet._Properties(sObject, _Name, vPropertiesList)
207 Else
208 vProperty = PropertiesGet._Properties(sObject, _Name, vPropertiesList, pvIndex)
209 vProperty._Value = _PropertyGet(vPropertiesList(pvIndex))
210 End If
212 Exit_Function:
213 Set Properties = vProperty
214 Exit Function
215 End Function &apos; Properties
217 REM -----------------------------------------------------------------------------------------------------------------------
218 Property Get Visible() As Variant
219 Visible = _PropertyGet(&quot;Visible&quot;)
220 End Property &apos; Visible (get)
222 Property Let Visible(ByVal pvValue As Variant)
223 Call _PropertySet(&quot;Visible&quot;, pvValue)
224 End Property &apos; Visible (set)
226 REM -----------------------------------------------------------------------------------------------------------------------
227 Property Get Width() As Variant
228 Width = _PropertyGet(&quot;Width&quot;)
229 End Property &apos; Width (get)
231 Property Let Width(ByVal pvValue As Variant)
232 Call _PropertySet(&quot;Width&quot;, pvValue)
233 End Property &apos; Width (set)
235 REM -----------------------------------------------------------------------------------------------------------------------
236 REM --- CLASS METHODS ---
237 REM -----------------------------------------------------------------------------------------------------------------------
239 Public Function Controls(Optional ByVal pvIndex As Variant) As Variant
240 &apos; Return a Control object with name or index = pvIndex
242 If _ErrorHandler() Then On Local Error Goto Error_Function
243 Utils._SetCalledSub(&quot;Dialog.Controls&quot;)
245 Dim ocControl As Variant, sParentShortcut As String, iControlCount As Integer
246 Dim oCounter As Variant, sControls() As Variant, i As Integer, bFound As Boolean, sIndex As String
247 Dim j As Integer
249 Set ocControl = Nothing
250 If Not IsLoaded Then Goto Trace_Error_NotOpen
251 Set ocControl = New Control
252 ocControl._ParentType = CTLPARENTISDIALOG
253 sParentShortcut = _Shortcut
254 sControls() = UnoDialog.Model.getElementNames()
255 iControlCount = UBound(sControls) + 1
257 If IsMissing(pvIndex) Then &apos; No argument, return Collection object
258 Set oCounter = New Collect
259 oCounter._CollType = COLLCONTROLS
260 oCounter._Count = iControlCount
261 Set Controls = oCounter
262 Goto Exit_Function
263 End If
265 If Not Utils._CheckArgument(pvIndex, 1, Utils._AddNumeric(vbString)) Then Goto Exit_Function
267 &apos; Start building the ocControl object
268 &apos; Determine exact name
270 Select Case VarType(pvIndex)
271 Case vbInteger, vbLong, vbSingle, vbDouble, vbCurrency, vbBigint, vbDecimal
272 If pvIndex &lt; 0 Or pvIndex &gt; iControlCount - 1 Then Goto Trace_Error_Index
273 ocControl._Name = sControls(pvIndex)
274 Case vbString &apos; Check control name validity (non case sensitive)
275 bFound = False
276 sIndex = UCase(Utils._Trim(pvIndex))
277 For i = 0 To iControlCount - 1
278 If UCase(sControls(i)) = sIndex Then
279 bFound = True
280 Exit For
281 End If
282 Next i
283 If bFound Then ocControl._Name = sControls(i) Else Goto Trace_NotFound
284 End Select
286 ocControl._Shortcut = sParentShortcut &amp; &quot;!&quot; &amp; Utils._Surround(ocControl._Name)
287 Set ocControl.ControlModel = UnoDialog.Model.getByName(ocControl._Name)
288 Set ocControl.ControlView = UnoDialog.getControl(ocControl._Name)
289 ocControl._ImplementationName = ocControl.ControlModel.getImplementationName()
290 ocControl._FormComponent = UnoDialog
292 ocControl._Initialize()
293 Set Controls = ocControl
295 Exit_Function:
296 Utils._ResetCalledSub(&quot;Dialog.Controls&quot;)
297 Exit Function
298 Trace_Error:
299 TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), 0, , Array(iArg, pvIndex))
300 Set Controls = Nothing
301 Goto Exit_Function
302 Trace_Error_NotOpen:
303 TraceError(TRACEFATAL, ERRDIALOGNOTSTARTED, Utils._CalledSub(), 0, , _Name)
304 Set Controls = Nothing
305 Goto Exit_Function
306 Trace_Error_Index:
307 TraceError(TRACEFATAL, ERRCOLLECTION, Utils._CalledSub(), 0, 1)
308 Set Controls = Nothing
309 Goto Exit_Function
310 Trace_NotFound:
311 TraceError(TRACEFATAL, ERRCONTROLNOTFOUND, Utils._CalledSub(), 0, , Array(pvIndex, pvIndex))
312 Set Controls = Nothing
313 Goto Exit_Function
314 Error_Function:
315 TraceError(TRACEABORT, Err, &quot;Dialog.Controls&quot;, Erl)
316 Set Controls = Nothing
317 GoTo Exit_Function
318 End Function &apos; Controls
320 REM -----------------------------------------------------------------------------------------------------------------------
321 Public Sub EndExecute(ByVal Optional pvReturn As Variant)
322 &apos; Stop executing the dialog
324 If _ErrorHandler() Then On Local Error Goto Error_Sub
325 Utils._SetCalledSub(&quot;Dialog.endExecute&quot;)
327 If IsMissing(pvReturn) Then pvReturn = 0
328 If Not Utils._CheckArgument(pvReturn, 1, Utils._AddNumeric(), , False) Then Goto Trace_Error
330 Dim lExecute As Long
331 lExecute = CLng(pvReturn)
332 If IsNull(_Dialog) Then Goto Error_Execute
333 If IsNull(UnoDialog) Then Goto Error_Not_Started
334 Call UnoDialog.endDialog(lExecute)
336 Exit_Sub:
337 Utils._ResetCalledSub(&quot;Dialog.endExecute&quot;)
338 Exit Sub
339 Trace_Error:
340 TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), 0, , Array(&quot;1&quot;, Utils._CStr(pvReturn)))
341 Goto Exit_Sub
342 Error_Execute:
343 TraceError(TRACEFATAL, ERRDIALOGUNDEFINED, Utils._CalledSub(), 0)
344 Goto Exit_Sub
345 Error_Not_Started:
346 TraceError(TRACEWARNING, ERRDIALOGNOTSTARTED, Utils._CalledSub(), 0, 1, _Name)
347 Goto Exit_Sub
348 Error_Sub:
349 TraceError(TRACEABORT, Err, &quot;Dialog.endExecute&quot;, Erl)
350 GoTo Exit_Sub
351 End Sub &apos; EndExecute
353 REM -----------------------------------------------------------------------------------------------------------------------
354 Public Function Execute() As Long
355 &apos; Execute dialog
357 &apos;If _ErrorHandler() Then On Local Error Goto Error_Function
358 &apos;Seems smart not to trap errors: debugging of dialog events otherwise made very difficult !
359 Utils._SetCalledSub(&quot;Dialog.Execute&quot;)
361 Dim lExecute As Long
362 If IsNull(_Dialog) Then Goto Error_Execute
363 If IsNull(UnoDialog) Then Goto Error_Not_Started
364 lExecute = UnoDialog.execute()
366 Select Case lExecute
367 Case 1 : Execute = dlgOK
368 Case 0 : Execute = dlgCancel
369 Case Else : Execute = lExecute
370 End Select
372 Exit_Function:
373 Utils._ResetCalledSub(&quot;Dialog.Execute&quot;)
374 Exit Function
375 Error_Execute:
376 TraceError(TRACEFATAL, ERRDIALOGUNDEFINED, Utils._CalledSub(), 0)
377 Goto Exit_Function
378 Error_Not_Started:
379 TraceError(TRACEWARNING, ERRDIALOGNOTSTARTED, Utils._CalledSub(), 0, 1, _Name)
380 Goto Exit_Function
381 Error_Function:
382 TraceError(TRACEABORT, Err, &quot;Dialog.Execute&quot;, Erl)
383 GoTo Exit_Function
384 End Function &apos; Execute
386 REM -----------------------------------------------------------------------------------------------------------------------
387 Public Function getProperty(Optional ByVal pvProperty As Variant) As Variant
388 &apos; Return property value of psProperty property name
390 Utils._SetCalledSub(&quot;Dialog.getProperty&quot;)
391 If IsMissing(pvProperty) Then Call _TraceArguments()
392 getProperty = _PropertyGet(pvProperty)
393 Utils._ResetCalledSub(&quot;Dialog.getProperty&quot;)
395 End Function &apos; getProperty
397 REM -----------------------------------------------------------------------------------------------------------------------
398 Public Function hasProperty(ByVal Optional pvProperty As Variant) As Boolean
399 &apos; Return True if object has a valid property called pvProperty (case-insensitive comparison !)
401 If IsMissing(pvProperty) Then hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList()) Else hasProperty = PropertiesGet._hasProperty(_Type, _PropertiesList(), pvProperty)
402 Exit Function
404 End Function &apos; hasProperty
406 REM -----------------------------------------------------------------------------------------------------------------------
407 Public Function Move( ByVal Optional pvLeft As Variant _
408 , ByVal Optional pvTop As Variant _
409 , ByVal Optional pvWidth As Variant _
410 , ByVal Optional pvHeight As Variant _
411 ) As Variant
412 &apos; Execute Move method
413 Utils._SetCalledSub(&quot;Dialog.Move&quot;)
414 If IsMissing(pvLeft) Then Call _TraceArguments()
415 On Local Error Goto Error_Function
416 Move = False
417 Dim iArgNr As Integer
418 Select Case UCase(_A2B_.CalledSub)
419 Case UCase(&quot;Move&quot;) : iArgNr = 1
420 Case UCase(&quot;Dialog.Move&quot;) : iArgNr = 0
421 End Select
422 If IsMissing(pvLeft) Then Call _TraceArguments()
423 If IsMissing(pvTop) Then pvTop = -1
424 If IsMissing(pvWidth) Then pvWidth = -1
425 If IsMissing(pvHeight) Then pvHeight = -1
426 If Not Utils._CheckArgument(pvLeft, iArgNr + 1, Utils._AddNumeric()) Then Goto Exit_Function
427 If Not Utils._CheckArgument(pvTop, iArgNr + 2, Utils._AddNumeric()) Then Goto Exit_Function
428 If Not Utils._CheckArgument(pvWidth, iArgNr + 3, Utils._AddNumeric()) Then Goto Exit_Function
429 If Not Utils._CheckArgument(pvHeight, iArgNr + 4, Utils._AddNumeric()) Then Goto Exit_Function
431 Dim iArg As Integer, iWrong As Integer &apos; Check arguments values
432 iArg = 0
433 If pvHeight &lt; -1 Then
434 iArg = 4 : iWrong = pvHeight
435 ElseIf pvWidth &lt; -1 Then
436 iArg = 3 : iWrong = pvWidth
437 ElseIf pvTop &lt; -1 Then
438 iArg = 2 : iWrong = pvTop
439 ElseIf pvLeft &lt; -1 Then
440 iArg = 1 : iWrong = pvLeft
441 End If
442 If iArg &gt; 0 Then
443 TraceError(TRACEFATAL, ERRWRONGARGUMENT, Utils._CalledSub(), 0, 1, Array(iArgNr + iArg, iWrong))
444 Goto Exit_Function
445 End If
447 Dim iPosSize As Integer
448 iPosSize = 0
449 If pvLeft &gt;= 0 Then iPosSize = iPosSize + com.sun.star.awt.PosSize.X
450 If pvTop &gt;= 0 Then iPosSize = iPosSize + com.sun.star.awt.PosSize.Y
451 If pvWidth &gt; 0 Then iPosSize = iPosSize + com.sun.star.awt.PosSize.WIDTH
452 If pvHeight &gt; 0 Then iPosSize = iPosSize + com.sun.star.awt.PosSize.HEIGHT
453 If iPosSize &gt; 0 Then UnoDialog.setPosSize(pvLeft, pvTop, pvWidth, pvHeight, iPosSize)
454 Move = True
456 Exit_Function:
457 Utils._ResetCalledSub(&quot;Dialog.Move&quot;)
458 Exit Function
459 Error_Function:
460 TraceError(TRACEABORT, Err, &quot;Dialog.Move&quot;, Erl)
461 GoTo Exit_Function
462 End Function &apos; Move
464 REM -----------------------------------------------------------------------------------------------------------------------
465 Public Function setProperty(ByVal Optional psProperty As String, ByVal Optional pvValue As Variant) As Boolean
466 &apos; Return True if property setting OK
467 Utils._SetCalledSub(&quot;Dialog.setProperty&quot;)
468 setProperty = _PropertySet(psProperty, pvValue)
469 Utils._ResetCalledSub(&quot;Dialog.setProperty&quot;)
470 End Function
472 REM -----------------------------------------------------------------------------------------------------------------------
473 Public Function Start() As Boolean
474 &apos; Create dialog
476 If _ErrorHandler() Then On Local Error Goto Error_Function
477 Utils._SetCalledSub(&quot;Dialog.Start&quot;)
479 Dim oStart As Object
480 Start = False
481 If IsNull(_Dialog) Then Goto Error_Start
482 If Not IsNull(UnoDialog) Then Goto Error_Yet_Started
483 Set oStart = CreateUnoDialog(_Dialog)
484 If IsNull(oStart) Then
485 Goto Error_Start
486 Else
487 Start = True
488 Set UnoDialog = oStart
489 With _A2B_
490 If .hasItem(COLLALLDIALOGS, _Name) Then .Dialogs.Remove(_Name) &apos; Inserted to solve errors, when aborts between start and terminate
491 .Dialogs.Add(UnoDialog, UCase(_Name))
492 End With
493 End If
495 Exit_Function:
496 Utils._ResetCalledSub(&quot;Dialog.Start&quot;)
497 Exit Function
498 Error_Start:
499 TraceError(TRACEFATAL, ERRDIALOGUNDEFINED, Utils._CalledSub(), 0)
500 Goto Exit_Function
501 Error_Yet_Started:
502 TraceError(TRACEWARNING, ERRDIALOGSTARTED, Utils._CalledSub(), 0)
503 Goto Exit_Function
504 Error_Function:
505 TraceError(TRACEABORT, Err, &quot;Dialog.Start&quot;, Erl)
506 GoTo Exit_Function
507 End Function &apos; Start
509 REM -----------------------------------------------------------------------------------------------------------------------
510 Public Function Terminate() As Boolean
511 &apos; Close dialog
513 If _ErrorHandler() Then On Local Error Goto Error_Function
514 Utils._SetCalledSub(&quot;Dialog.Terminate&quot;)
516 Terminate = False
517 If IsNull(_Dialog) Then Goto Error_Terminate
518 If IsNull(UnoDialog) Then Goto Error_Not_Started
519 UnoDialog.Dispose()
520 Set UnoDialog = Nothing
521 _A2B_.Dialogs.Remove(_Name)
522 Terminate = True
524 Exit_Function:
525 Utils._ResetCalledSub(&quot;Dialog.Terminate&quot;)
526 Exit Function
527 Error_Terminate:
528 TraceError(TRACEFATAL, ERRDIALOGUNDEFINED, Utils._CalledSub(), 0)
529 Goto Exit_Function
530 Error_Not_Started:
531 TraceError(TRACEWARNING, ERRDIALOGNOTSTARTED, Utils._CalledSub(), 0, 1, _Name)
532 Goto Exit_Function
533 Error_Function:
534 TraceError(TRACEABORT, Err, &quot;Dialog.Terminate&quot;, Erl)
535 GoTo Exit_Function
536 End Function &apos; Terminate
538 REM -----------------------------------------------------------------------------------------------------------------------
539 REM --- PRIVATE FUNCTIONS ---
540 REM -----------------------------------------------------------------------------------------------------------------------
541 REM -----------------------------------------------------------------------------------------------------------------------
542 Private Function _PropertiesList() As Variant
544 If IsLoaded Then
545 _PropertiesList = Array(&quot;Caption&quot;, &quot;Height&quot;, &quot;IsLoaded&quot;, &quot;Name&quot; _
546 , &quot;ObjectType&quot;, &quot;Page&quot;, &quot;Visible&quot;, &quot;Width&quot; _
548 Else
549 _PropertiesList = Array(&quot;IsLoaded&quot;, &quot;Name&quot; _
551 End If
553 End Function &apos; _PropertiesList
555 REM -----------------------------------------------------------------------------------------------------------------------
556 Private Function _PropertyGet(ByVal psProperty As String) As Variant
557 &apos; Return property value of the psProperty property name
559 If _ErrorHandler() Then On Local Error Goto Error_Function
560 Utils._SetCalledSub(&quot;Dialog.get&quot; &amp; psProperty)
562 &apos;Execute
563 Dim vEMPTY As Variant
564 _PropertyGet = vEMPTY
566 Select Case UCase(psProperty)
567 Case UCase(&quot;Name&quot;), UCase(&quot;IsLoaded&quot;)
568 Case Else
569 If IsNull(UnoDialog) Then Goto Trace_Error_Dialog
570 End Select
571 Select Case UCase(psProperty)
572 Case UCase(&quot;Caption&quot;)
573 _PropertyGet = UnoDialog.getTitle()
574 Case UCase(&quot;Height&quot;)
575 _PropertyGet = UnoDialog.getPosSize().Height
576 Case UCase(&quot;IsLoaded&quot;)
577 _PropertyGet = _A2B_.hasItem(COLLALLDIALOGS, _Name)
578 Case UCase(&quot;Name&quot;)
579 _PropertyGet = _Name
580 Case UCase(&quot;ObjectType&quot;)
581 _PropertyGet = _Type
582 Case UCase(&quot;Page&quot;)
583 _PropertyGet = UnoDialog.Model.Step
584 Case UCase(&quot;Visible&quot;)
585 _PropertyGet = UnoDialog.IsVisible()
586 Case UCase(&quot;Width&quot;)
587 _PropertyGet = UnoDialog.getPosSize().Width
588 Case Else
589 Goto Trace_Error
590 End Select
592 Exit_Function:
593 Utils._ResetCalledSub(&quot;Dialog.get&quot; &amp; psProperty)
594 Exit Function
595 Trace_Error:
596 TraceError(TRACEWARNING, ERRPROPERTY, Utils._CalledSub(), 0, 1, psProperty)
597 _PropertyGet = vEMPTY
598 Goto Exit_Function
599 Trace_Error_Dialog:
600 TraceError(TRACEFATAL, ERRDIALOGNOTSTARTED, Utils._CalledSub(), 0, 1, _Name)
601 _PropertyGet = vEMPTY
602 Goto Exit_Function
603 Error_Function:
604 TraceError(TRACEABORT, Err, &quot;Dialog._PropertyGet&quot;, Erl)
605 _PropertyGet = vEMPTY
606 GoTo Exit_Function
607 End Function &apos; _PropertyGet
609 REM -----------------------------------------------------------------------------------------------------------------------
610 Private Function _PropertySet(ByVal psProperty As String, ByVal pvValue As Variant) As Boolean
612 Utils._SetCalledSub(&quot;Dialog.set&quot; &amp; psProperty)
613 If _ErrorHandler() Then On Local Error Goto Error_Function
614 _PropertySet = True
616 &apos;Execute
617 Dim iArgNr As Integer
619 If _IsLeft(_A2B_.CalledSub, &quot;Dialog.&quot;) Then iArgNr = 1 Else iArgNr = 2
620 If IsNull(UnoDialog) Then Goto Trace_Error_Dialog
621 Select Case UCase(psProperty)
622 Case UCase(&quot;Caption&quot;)
623 If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
624 UnoDialog.setTitle(pvValue)
625 Case UCase(&quot;Height&quot;)
626 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
627 UnoDialog.setPosSize(0, 0, 0, pvValue, com.sun.star.awt.PosSize.HEIGHT)
628 Case UCase(&quot;Page&quot;)
629 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric(), , False) Then Goto Trace_Error_Value
630 If pvValue &lt; 0 Then Goto Trace_Error_Value
631 UnoDialog.Model.Step = pvValue
632 Case UCase(&quot;Visible&quot;)
633 If Not Utils._CheckArgument(pvValue, iArgNr, vbBoolean, , False) Then Goto Trace_Error_Value
634 UnoDialog.setVisible(pvValue)
635 Case UCase(&quot;Width&quot;)
636 If Not Utils._CheckArgument(pvValue, iArgNr, Utils._AddNumeric()) Then Goto Trace_Error_Value
637 UnoDialog.setPosSize(0, 0, pvValue, 0, com.sun.star.awt.PosSize.WIDTH)
638 Case Else
639 Goto Trace_Error
640 End Select
642 Exit_Function:
643 Utils._ResetCalledSub(&quot;Dialog.set&quot; &amp; psProperty)
644 Exit Function
645 Trace_Error_Dialog:
646 TraceError(TRACEFATAL, ERRDIALOGNOTSTARTED, Utils._CalledSub(), 0, 1, _Name)
647 _PropertySet = False
648 Goto Exit_Function
649 Trace_Error:
650 TraceError(TRACEFATAL, ERRPROPERTY, Utils._CalledSub(), 0, 1, psProperty)
651 _PropertySet = False
652 Goto Exit_Function
653 Trace_Error_Value:
654 TraceError(TRACEFATAL, ERRPROPERTYVALUE, Utils._CalledSub(), 0, 1, Array(pvValue, psProperty))
655 _PropertySet = False
656 Goto Exit_Function
657 Error_Function:
658 TraceError(TRACEABORT, Err, &quot;Dialog._PropertySet&quot;, Erl)
659 _PropertySet = False
660 GoTo Exit_Function
661 End Function &apos; _PropertySet
662 </script:module>