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