1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="PropertiesSet" script:language="StarBasic">
REM =======================================================================================================================
REM === The Access2Base library is a part of the LibreOffice project. ===
REM === Full documentation is available on http://www.access2base.com ===
REM =======================================================================================================================
Option Explicit
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setAbsolutePosition(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
' Only for open forms
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setAbsolutePosition")
setAbsolutePosition = PropertiesSet._setProperty(pvObject, "AbsolutePosition", pvValue)
End Function ' setAbsolutePosition
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setAllowAdditions(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
' Only for open forms
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setAllowAdditions")
setAllowAdditions = PropertiesSet._setProperty(pvObject, "AllowAdditions", pvValue)
End Function ' setAllowAdditions
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setAllowDeletions(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
' Only for open forms
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setAllowDeletions")
setAllowDeletions = PropertiesSet._setProperty(pvObject, "AllowDeletions", pvValue)
End Function ' setAllowDeletions
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setAllowEdits(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
' Only for open forms
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setAllowEdits")
setAllowEdits = PropertiesSet._setProperty(pvObject, "AllowEdits", pvValue)
End Function ' setAllowEdits
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setBackColor(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setBackColor")
setBackColor = PropertiesSet._setProperty(pvObject, "BackColor", pvValue)
End Function ' setBackColor
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setBookmark(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setBookmark")
setBookmark = PropertiesSet._setProperty(pvObject, "Bookmark", pvValue)
End Function ' setBookmark
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setBorderColor (Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setBorderColor")
setBorderColor = PropertiesSet._setProperty(pvObject, "BorderColor", pvValue)
End Function ' setBorderColor
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setBorderStyle(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setBorderStyle")
setBorderStyle = PropertiesSet._setProperty(pvObject, "BorderStyle", pvValue)
End Function ' setBorderStyle
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setCancel(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setCancel")
setCancel = PropertiesSet._setProperty(pvObject, "Cancel", pvValue)
End Function ' setCancel
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setCaption(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setCaption")
setCaption = PropertiesSet._setProperty(pvObject, "Caption", pvValue)
End Function ' setCaption
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setControlTipText(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setControlTipText")
setControlTipText = PropertiesSet._setProperty(pvObject, "ControlTipText", pvValue)
End Function ' setControlTipText
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setCurrentRecord(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setCurrentRecord")
setCurrentRecord = PropertiesSet._setProperty(pvObject, "CurrentRecord", pvValue)
End Function ' setCurrentRecord
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setDefault(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setDefault")
setDefault = PropertiesSet._setProperty(pvObject, "Default", pvValue)
End Function ' setDefault
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setDefaultValue(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setDefaultValue")
setDefaultValue = PropertiesSet._setProperty(pvObject, "DefaultValue", pvValue)
End Function ' setDefaultValue
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setDescription(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setDescription")
setDescription = PropertiesSet._setProperty(pvObject, "Description", pvValue)
End Function ' setDescription
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setEnabled(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setEnabled")
setEnabled = PropertiesSet._setProperty(pvObject, "Enabled", pvValue)
End Function ' setEnabled
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setFilter(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setFilter")
setFilter = PropertiesSet._setProperty(pvObject, "Filter", pvValue)
End Function ' setFilter
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setFilterOn(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
' Only for open forms
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setFilterOn")
setFilterOn = PropertiesSet._setProperty(pvObject, "FilterOn", pvValue)
End Function ' setFilterOn
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setFontBold(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setFontBold")
setFontBold = PropertiesSet._setProperty(pvObject, "FontBold", pvValue)
End Function ' setFontBold
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setFontItalic(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setFontItalic")
setFontItalic = PropertiesSet._setProperty(pvObject, "FontItalic", pvValue)
End Function ' setFontItalic
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setFontName(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setFontName")
setFontName = PropertiesSet._setProperty(pvObject, "FontName", pvValue)
End Function ' setFontName
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setFontSize(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setFontSize")
setFontSize = PropertiesSet._setProperty(pvObject, "FontSize", pvValue)
End Function ' setFontSize
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setFontUnderline(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setFontUnderline")
setFontUnderline = PropertiesSet._setProperty(pvObject, "FontUnderline", pvValue)
End Function ' setFontUnderline
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setFontWeight(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setFontWeight")
setFontWeight = PropertiesSet._setProperty(pvObject, "FontWeight", pvValue)
End Function ' setFontWeight
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setForeColor(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setForeColor")
setForeColor = PropertiesSet._setProperty(pvObject, "ForeColor", pvValue)
End Function ' setForeColor
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setHeight(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
' Only for open forms
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setHeight")
setHeight = PropertiesSet._setProperty(pvObject, "Height", pvValue)
End Function ' setHeight
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setListIndex(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setListIndex")
setListIndex = PropertiesSet._setProperty(pvObject, "ListIndex", pvValue)
End Function ' setListIndex
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setLocked(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setLocked")
setLocked = PropertiesSet._setProperty(pvObject, "Locked", pvValue)
End Function ' setLocked
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setMultiSelect(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setMultiSelect")
setMultiSelect = PropertiesSet._setProperty(pvObject, "MultiSelect", pvValue)
End Function ' setMultiSelect
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setOnAction(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setOnAction")
setOnAction = PropertiesSet._setProperty(pvObject, "OnAction", pvValue)
End Function ' setOnAction
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setOptionValue(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setOptionValue")
setOptionValue = PropertiesSet._setProperty(pvObject, "OptionValue", pvValue)
End Function ' setOptionValue
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setOrderBy(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setOrderBy")
setOrderBy = PropertiesSet._setProperty(pvObject, "OrderBy", pvValue)
End Function ' setOrderBy
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setOrderByOn(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
' Only for open forms
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setOrderByOn")
setOrderByOn = PropertiesSet._setProperty(pvObject, "OrderByOn", pvValue)
End Function ' setOrderByOn
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setPage(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setPage")
setPage = PropertiesSet._setProperty(pvObject, "Page", pvValue)
End Function ' setPage V0.9.1
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setProperty(Optional pvItem As Variant, ByVal Optional psProperty As String, ByVal Optional pvValue As Variant, ByVal Optional pvIndex As Variant) As Variant
' Return True if property setting OK
Utils._SetCalledSub("setProperty")
If IsMissing(pvItem) Or IsMissing(psProperty) Or IsMissing(pvValue) Or IsEmpty(pvItem) Then Call _TraceArguments()
If IsMissing(pvIndex) Then
setProperty = PropertiesSet._setProperty(pvItem, psProperty, pvValue)
Else
setProperty = PropertiesSet._setProperty(pvItem, psProperty, pvValue, pvIndex)
End If
Utils._ResetCalledSub("setProperty")
End Function
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setRecordSource(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
' Only for open forms
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setRecordSource")
setRecordSource = PropertiesSet._setProperty(pvObject, "RecordSource", pvValue)
End Function ' setRecordSource
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setRequired(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setRequired")
setRequired = PropertiesSet._setProperty(pvObject, "Required", pvValue)
End Function ' setRequired
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setRowSource(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setRowSource")
setRowSource = PropertiesSet._setProperty(pvObject, "RowSource", pvValue)
End Function ' setRowSource
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setRowSourceType(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setRowSourceType")
setRowSourceType = PropertiesSet._setProperty(pvObject, "RowSourceType", pvValue)
End Function ' setRowSourceType
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setSelected(Optional pvObject As Variant, ByVal Optional pvValue As Variant, ByVal Optional pvIndex As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Then Call _TraceArguments("setSelected")
If IsEmpty(pvObject) Then Call _TraceArguments("setSelected")
If IsMissing(pvIndex) Then
setSelected = PropertiesSet._setProperty(pvObject, "Selected", pvValue)
Else
setSelected = PropertiesSet._setProperty(pvObject, "Selected", pvValue, pvIndex)
End If
End Function ' setSelected
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setSelLength(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setSelLength")
setSelLength = PropertiesSet._setProperty(pvObject, "SelLength", pvValue)
End Function ' setSelLength
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setSelStart(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setSelStart")
setSelStart = PropertiesSet._setProperty(pvObject, "SelStart", pvValue)
End Function ' setSelStart
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setSelText(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setSelText")
setSelText = PropertiesSet._setProperty(pvObject, "SelText", pvValue)
End Function ' setSelText
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setSpecialEffect(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setSpecialEffect")
setSpecialEffect = PropertiesSet._setProperty(pvObject, "SpecialEffect", pvValue)
End Function ' setSpecialEffect
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setTabIndex(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setTabIndex")
setTabIndex = PropertiesSet._setProperty(pvObject, "TabIndex", pvValue)
End Function ' setTabIndex
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setTabStop(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setTabStop")
setTabStop = PropertiesSet._setProperty(pvObject, "TabStop", pvValue)
End Function ' setTabStop
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setTag(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setTag")
setTag = PropertiesSet._setProperty(pvObject, "Tag", pvValue)
End Function ' setTag
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setTextAlign(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setTextAlign")
setTextAlign = PropertiesSet._setProperty(pvObject, "TextAlign", pvValue)
End Function ' setTextAlign
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setTooltipText(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setTooltipText")
setTooltipText = PropertiesSet._setProperty(pvObject, "TooltipText", pvValue)
End Function ' setTooltipText
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setTripleState(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setTripleState")
setTripleState = PropertiesSet._setProperty(pvObject, "TripleState", pvValue)
End Function ' setTripleState
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setVisible(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
' Only for open forms and controls
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setVisible")
setVisible = PropertiesSet._setProperty(pvObject, "Visible", pvValue)
End Function ' setVisible
REM -----------------------------------------------------------------------------------------------------------------------
Public Function setWidth(Optional pvObject As Variant, ByVal Optional pvValue As Variant) As Boolean
' Only for open forms
If IsMissing(pvObject) Or IsMissing(pvValue) Or IsEmpty(pvObject) Then Call _TraceArguments("setWidth")
setWidth = PropertiesSet._setProperty(pvObject, "Width", pvValue)
End Function ' setWidth
REM -----------------------------------------------------------------------------------------------------------------------
REM --- PRIVATE FUNCTIONS ---
REM -----------------------------------------------------------------------------------------------------------------------
Private Function _CheckProperty(pvObject As Object, ByVal psProperty As String) As Boolean
' Return False if psProperty not within the PropertyValues set of pvItem
Dim i As Integer, oPropertyValues As Variant, oProperty As Variant
oPropertyValues = pvObject.PropertyValues
For i = LBound(oPropertyValues) To UBound(oPropertyValues)
oProperty = oPropertyValues(i)
If UCase(oProperty.Name) = UCase(psProperty) Then
_CheckProperty = True
Exit Function
End If
Next i
_CheckProperty = False
Exit Function
End Function ' CheckProperty V0.7.5
REM -----------------------------------------------------------------------------------------------------------------------
Private Function _setProperty(pvItem As Variant, ByVal psProperty As String, ByVal pvValue As Variant, ByVal Optional pvIndex As Variant) As Boolean
' Return True if property setting OK
Utils._SetCalledSub("set" & psProperty)
If _ErrorHandler() Then On Local Error Goto Error_Function
'pvItem must be an object and have the requested property
If Not Utils._CheckArgument(pvItem, 1, vbObject) Then Goto Exit_Function
'Check Index argument
If Not IsMissing(pvIndex) Then
If Not Utils._CheckArgument(pvIndex, 4, Utils._AddNumeric()) Then Goto Exit_Function
End If
'Execute
Dim iArgNr As Integer, lFormat As Long
Dim i As Integer, iCount As Integer, iSelectedItems() As Integer, bListboxBound As Boolean
Dim odbDatabase As Object, vNames As Variant, bFound As Boolean, sName As String, oModel As Object
Dim ocButton As Variant, iRadioIndex As Integer
_setProperty = True
If _A2B_.CalledSub = "setProperty" Then iArgNr = 3 Else iArgNr = 2
If Not PropertiesGet._hasProperty(pvItem._Type, pvItem._PropertiesList(), psProperty) Then Goto Trace_Error_Control
Select Case UCase(psProperty)
Case UCase("AbsolutePosition")
If Not Utils._CheckArgument(pvItem, 1, OBJRECORDSET) Then Goto Exit_Function
pvItem.AbsolutePosition = pvValue
Case UCase("AllowAdditions")
If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJSUBFORM)) Then Goto Exit_Function
pvItem.AllowAdditions = pvValue
Case UCase("AllowDeletions")
If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJSUBFORM)) Then Goto Exit_Function
pvItem.AllowDeletions = pvValue
Case UCase("AllowEdits")
If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJSUBFORM)) Then Goto Exit_Function
pvItem.AllowEdits = pvValue
Case UCase("BackColor")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
pvItem.BackColor = pvValue
Case UCase("Bookmark")
If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJRECORDSET)) Then Goto Exit_Function
pvItem.Bookmark = pvValue
Case UCase("BorderColor")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
pvItem.BorderColor = pvValue
Case UCase("BorderStyle")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
pvItem.BorderColor = pvValue
Case UCase("Cancel")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
pvItem.Cancel = pvValue
Case UCase("Caption")
If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJDIALOG, OBJCONTROL)) Then Goto Exit_Function
pvItem.Caption = pvValue
Case UCase("ControlTipText")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
pvItem.ControlTipText = pvValue
Case UCase("CurrentRecord")
If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJSUBFORM)) Then Goto Exit_Function
pvItem.CurrentRecord = pvValue
Case UCase("Default")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
pvItem.Default = pvValue
Case UCase("DefaultValue")
If Not Utils._CheckArgument(pvItem, 1, Array(OBJCONTROL, OBJFIELD)) Then Goto Exit_Function
pvItem.DefaultValue = pvValue
Case UCase("Description")
If Not Utils._CheckArgument(pvItem, 1, OBJFIELD) Then Goto Exit_Function
pvItem.DefaultValue = pvValue
Case UCase("Enabled")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
pvItem.Enabled = pvValue
Case UCase("Filter")
If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJSUBFORM, OBJRECORDSET)) Then Goto Exit_Function
pvItem.Filter = pvValue
Case UCase("FilterOn")
If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJSUBFORM)) Then Goto Exit_Function
pvItem.FilterOn = pvValue
Case UCase("FontBold")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
pvItem.FontBold = pvValue
Case UCase("FontItalic")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
pvItem.FontItalic = pvValue
Case UCase("FontName")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
pvItem.FontName = pvValue
Case UCase("FontSize")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
pvItem.FontSize = pvValue
Case UCase("FontUnderline")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
pvItem.FontUnderline = pvValue
Case UCase("FontWeight")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
pvItem.FontWeight = pvValue
Case UCase("ForeColor")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
pvItem.ForeColor = pvValue
Case UCase("Height")
If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJDIALOG)) Then Goto Exit_Function
pvItem.Height = pvValue
Case UCase("ListIndex")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
pvItem.ListIndex = pvValue
Case UCase("Locked")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
pvItem.Locked = pvValue
Case UCase("MultiSelect")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
pvItem.MultiSelect = pvValue
Case UCase("OnAction")
If Not Utils._CheckArgument(pvItem, 1, OBJCOMMANDBARCONTROL) Then Goto Exit_Function
pvItem.OnAction = pvValue
Case UCase("OptionValue")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
pvItem.OptionValue = pvValue
Case UCase("OrderBy")
If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJSUBFORM)) Then Goto Exit_Function
pvItem.OrderBy = pvValue
Case UCase("OrderByOn")
If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJSUBFORM)) Then Goto Exit_Function
pvItem.OrderByOn = pvValue
Case UCase("Page")
If Not Utils._CheckArgument(pvItem, 1, Array(OBJDIALOG, OBJCONTROL)) Then Goto Exit_Function
pvItem.Page = pvValue
Case UCase("RecordSource")
If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJSUBFORM)) Then Goto Exit_Function
pvItem.RecordSource = pvValue
Case UCase("Required")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
pvItem.Required = pvValue
Case UCase("RowSource")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
pvItem.RowSource = pvValue
Case UCase("RowSourceType") ' Refresh done when RowSource changes, not RowSourceType
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
pvItem.RowSourceType = pvValue
Case UCase("Selected")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
If IsMissing(pvIndex) Then pvItem.Selected = pvValue Else pvItem.SelectedI(pvValue, pvIndex)
Case UCase("SelLength")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
pvItem.SelLength = pvValue
Case UCase("SelStart")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
pvItem.SelStart = pvValue
Case UCase("SelText")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
pvItem.SelText = pvValue
Case UCase("SpecialEffect")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
pvItem.SpecialEffect = pvValue
Case UCase("TabIndex")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
pvItem.TabIndex = pvValue
Case UCase("TabStop")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
pvItem.TabStop = pvValue
Case UCase("Tag")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
pvItem.Tag = pvValue
Case UCase("TextAlign")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
pvItem.TextAlign = pvValue
Case UCase("TooltipText")
If Not Utils._CheckArgument(pvItem, 1, OBJCOMMANDBARCONTROL) Then Goto Exit_Function
pvItem.TooltipText = pvValue
Case UCase("TripleState")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
pvItem.TripleState = pvValue
Case UCase("Value")
If Not Utils._CheckArgument(pvItem, 1, Array(OBJCONTROL, OBJOPTIONGROUP, OBJFIELD, OBJTEMPVAR)) Then Goto Exit_Function
pvItem.Value = pvValue
Case UCase("Visible")
If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJDIALOG, OBJCONTROL, OBJCOMMANDBAR, OBJCOMMANDBARCONTROL)) Then Goto Exit_Function
pvItem.Visible = pvValue
Case UCase("Width")
If Not Utils._CheckArgument(pvItem, 1, Array(OBJFORM, OBJDIALOG)) Then Goto Exit_Function
pvItem.Width = pvValue
Case Else
Goto Trace_Error_Control
End Select
Exit_Function:
Utils._ResetCalledSub("set" & psProperty)
Exit Function
Trace_Error_Form:
TraceError(TRACEFATAL, ERRFORMNOTFOUND, Utils._CalledSub(), 0, 1, pvItem._Name)
_setProperty = False
Goto Exit_Function
Trace_Error_Control:
TraceError(TRACEFATAL, ERRPROPERTY, Utils._CalledSub(), 0, 1, psProperty)
_setProperty = False
Goto Exit_Function
Trace_Error_Value:
TraceError(TRACEFATAL, ERRPROPERTYVALUE, Utils._CalledSub(), 0, 1, Array(pvValue, psProperty))
_setProperty = False
Goto Exit_Function
Trace_Error_Index:
TraceError(TRACEFATAL, ERRINDEXVALUE, Utils._CalledSub(), 0, 1, psProperty)
_setProperty = Nothing
Goto Exit_Function
Trace_Error_Array:
TraceError(TRACEFATAL, ERRPROPERTYNOTARRAY, Utils._CalledSub(), 0, 1, iArgNr)
_setProperty = Nothing
Goto Exit_Function
Error_Function:
TraceError(TRACEABORT, Err, "_setProperty", Erl)
GoTo Exit_Function
End Function ' _setProperty V0.9.1
</script:module>
|