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