-
Notifications
You must be signed in to change notification settings - Fork 2
/
cboMultiSelTest.sc2
413 lines (366 loc) · 10.7 KB
/
cboMultiSelTest.sc2
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
*--------------------------------------------------------------------------------------------------------------------------------------------------------
* (ES) AUTOGENERADO - ¡¡ATENCIÓN!! - ¡¡NO PENSADO PARA EJECUTAR!! USAR SOLAMENTE PARA INTEGRAR CAMBIOS Y ALMACENAR CON HERRAMIENTAS SCM!!
* (EN) AUTOGENERATED - ATTENTION!! - NOT INTENDED FOR EXECUTION!! USE ONLY FOR MERGING CHANGES AND STORING WITH SCM TOOLS!!
*--------------------------------------------------------------------------------------------------------------------------------------------------------
*< FOXBIN2PRG: Version="1.19" SourceFile="cbomultiseltest.scx" /> (Solo para binarios VFP 9 / Only for VFP 9 binaries)
*
*
DEFINE CLASS dataenvironment AS dataenvironment
*< CLASSDATA: Baseclass="dataenvironment" Timestamp="" Scale="" Uniqueid="" ClassIcon="1" />
DataSource = .NULL.
Height = 0
Left = 0
Name = "Dataenvironment"
Top = 0
Width = 0
ENDDEFINE
DEFINE CLASS form1 AS form
*< CLASSDATA: Baseclass="form" Timestamp="" Scale="" Uniqueid="" />
*-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder
*< OBJECTDATA: ObjPath="Cbomultisel1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="Cbomultisel2" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="Cbomultisel3" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="lblPropBind" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="Label2" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="Label3" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="cmdPrior3" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="cmdNext3" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="cmdPrior2" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="cmdNext2" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="txt2" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="txt3" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="Label1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="txt1" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="Cbomultisel4" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="Label4" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="cmdPrior4" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="cmdNext4" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="txt4a" UniqueID="" Timestamp="" />
*< OBJECTDATA: ObjPath="txt4b" UniqueID="" Timestamp="" />
BorderStyle = 1
Caption = "Multi Select Combo Control Test"
DoCreate = .T.
Height = 354
Left = 0
Name = "Form1"
Top = 0
Width = 426
ADD OBJECT 'Cbomultisel1' AS cbomultisel WITH ;
Height = 24, ;
Left = 30, ;
Name = "Cbomultisel1", ;
RowSourceType = 6, ;
Top = 33, ;
Width = 171
*< END OBJECT: ClassLib="cbomultisel.vcx" BaseClass="combobox" />
ADD OBJECT 'Cbomultisel2' AS cbomultisel WITH ;
Height = 24, ;
Left = 30, ;
Name = "Cbomultisel2", ;
RowSourceType = 2, ;
Top = 87, ;
Width = 171
*< END OBJECT: ClassLib="cbomultisel.vcx" BaseClass="combobox" />
ADD OBJECT 'Cbomultisel3' AS cbomultisel WITH ;
Height = 24, ;
Left = 30, ;
Name = "Cbomultisel3", ;
RowSourceType = 3, ;
Top = 175, ;
Width = 171
*< END OBJECT: ClassLib="cbomultisel.vcx" BaseClass="combobox" />
ADD OBJECT 'Cbomultisel4' AS cbomultisel WITH ;
Height = 24, ;
Left = 27, ;
Name = "Cbomultisel4", ;
RowSourceType = 2, ;
Top = 264, ;
Width = 171
*< END OBJECT: ClassLib="cbomultisel.vcx" BaseClass="combobox" />
ADD OBJECT 'cmdNext2' AS commandbutton WITH ;
Caption = ">", ;
Height = 25, ;
Left = 263, ;
Name = "cmdNext2", ;
Top = 89, ;
Width = 31
*< END OBJECT: BaseClass="commandbutton" />
ADD OBJECT 'cmdNext3' AS commandbutton WITH ;
Caption = ">", ;
Height = 25, ;
Left = 264, ;
Name = "cmdNext3", ;
Top = 173, ;
Width = 31
*< END OBJECT: BaseClass="commandbutton" />
ADD OBJECT 'cmdNext4' AS commandbutton WITH ;
Caption = ">", ;
Height = 25, ;
Left = 260, ;
Name = "cmdNext4", ;
Top = 266, ;
Width = 31
*< END OBJECT: BaseClass="commandbutton" />
ADD OBJECT 'cmdPrior2' AS commandbutton WITH ;
Caption = "<", ;
Height = 25, ;
Left = 224, ;
Name = "cmdPrior2", ;
Top = 89, ;
Width = 31
*< END OBJECT: BaseClass="commandbutton" />
ADD OBJECT 'cmdPrior3' AS commandbutton WITH ;
Caption = "<", ;
Height = 25, ;
Left = 225, ;
Name = "cmdPrior3", ;
Top = 173, ;
Width = 31
*< END OBJECT: BaseClass="commandbutton" />
ADD OBJECT 'cmdPrior4' AS commandbutton WITH ;
Caption = "<", ;
Height = 25, ;
Left = 221, ;
Name = "cmdPrior4", ;
Top = 266, ;
Width = 31
*< END OBJECT: BaseClass="commandbutton" />
ADD OBJECT 'Label1' AS label WITH ;
Caption = "Underlying value", ;
Height = 19, ;
Left = 208, ;
Name = "Label1", ;
Top = 39, ;
Width = 96
*< END OBJECT: BaseClass="label" />
ADD OBJECT 'Label2' AS label WITH ;
Caption = "Select Source Bound", ;
Height = 19, ;
Left = 30, ;
Name = "Label2", ;
Top = 68, ;
Width = 138
*< END OBJECT: BaseClass="label" />
ADD OBJECT 'Label3' AS label WITH ;
Caption = "Cursor Fields Bound", ;
Height = 19, ;
Left = 30, ;
Name = "Label3", ;
Top = 156, ;
Width = 147
*< END OBJECT: BaseClass="label" />
ADD OBJECT 'Label4' AS label WITH ;
Caption = "Numbers Alias", ;
Height = 19, ;
Left = 27, ;
Name = "Label4", ;
Top = 245, ;
Width = 138
*< END OBJECT: BaseClass="label" />
ADD OBJECT 'lblPropBind' AS label WITH ;
Caption = "Property Bound w/Delimiters", ;
Height = 19, ;
Left = 30, ;
Name = "lblPropBind", ;
Top = 12, ;
Width = 171
*< END OBJECT: BaseClass="label" />
ADD OBJECT 'txt1' AS textbox WITH ;
Height = 22, ;
Left = 304, ;
Name = "txt1", ;
Top = 35, ;
Width = 93
*< END OBJECT: BaseClass="textbox" />
ADD OBJECT 'txt2' AS textbox WITH ;
Height = 25, ;
Left = 30, ;
Name = "txt2", ;
Top = 116, ;
Width = 171
*< END OBJECT: BaseClass="textbox" />
ADD OBJECT 'txt3' AS textbox WITH ;
Height = 25, ;
Left = 29, ;
Name = "txt3", ;
Top = 204, ;
Width = 172
*< END OBJECT: BaseClass="textbox" />
ADD OBJECT 'txt4a' AS textbox WITH ;
Height = 25, ;
Left = 27, ;
Name = "txt4a", ;
Top = 293, ;
Width = 123
*< END OBJECT: BaseClass="textbox" />
ADD OBJECT 'txt4b' AS textbox WITH ;
Height = 25, ;
Left = 156, ;
Name = "txt4b", ;
Top = 292, ;
Width = 90
*< END OBJECT: BaseClass="textbox" />
PROCEDURE Init
SET CLASSLIB TO cboMultiSel.vcx
WITH Thisform
.AddProperty("mySels", "'A','C'")
WITH .cboMultiSel1
*.RowSourceType=6 && Fields
.ControlSource="Thisform.mySels"
.ColumnWidths = "15, 200"
.srcValCol = "CD"
.srcDispCol = "NME"
.valDelim = "'"
* set this property last if setting other properties in code (as above)
.RowSource = "CSRC.CD, NME"
ENDWITH
.txt1.ControlSource = "Thisform.mySels"
WITH .cboMultiSel2
*.RowSourceType=2 && Alias
.ControlSource="CX.CDS"
* define display picklist column attributes using list-style properties
.ColumnWidths = "25, 190"
.srcColTitls = "Code, Name"
.srcValCol = "CD"
.srcDispCol = "NME"
.showHdrs = .F.
.RowSource = "CSRC"
ENDWITH
.txt2.ControlSource = "CX.OTHER"
WITH .cboMultiSel3
*.RowSourceType=3 && SQL
.ControlSource="CCTCT.AGTPHNS"
* define display picklist column attributes using the array style
* to set up a format (transform) for phone.
DIMENSION .srcColdefs[2,4]
.srcColDefs[1,1] = "PHONE"
.srcColDefs[1,2] = 120
.srcColDefs[1,3] = "AGT PHN"
.srcColDefs[1,4] = "@R (999)999-9999"
.srcColDefs[2,1] = "NAME"
.srcColDefs[2,2] = 150
.srcColDefs[2,3] = "CO NAME"
.srcColDefs[2,4] = ""
.srcValCol = "PHONE"
.srcDispCol = "TRANSFORM(PHONE, '@R (999)999-9999')"
* set this property last if setting other properties in code (as above)
.RowSource = "SELECT PHN AS PHONE, NME AS NAME FROM CAGT INTO CURSOR CRSLTS"
ENDWITH
.txt3.ControlSource = "CCTCT.CONME"
WITH .cboMultiSel4
.ControlSource="CY.VALS"
.ColumnWidths = "100"
.srcValCol = "NBR"
.srcDispCol = "NBR"
.showHdrs = .F.
* set this property last if setting other properties in code (as above)
.RowSource = "CNBRS"
ENDWITH
.txt4a.ControlSource = "CY.COL2"
.txt4b.ControlSource = "CY.COL3"
ENDWITH
ENDPROC
PROCEDURE Load
CREATE CURSOR CX (cds C(50), other V(100))
INSERT INTO CX VALUES ("A,D", "SOMETHING")
INSERT INTO CX VALUES ("E", "MORE")
GO TOP
CREATE CURSOR CY (vals V(50), col2 C(30), col3 D)
INSERT INTO CY VALUES ("120,3", "TWO VALUES", DATE())
INSERT INTO CY VALUES ("88", "ONE VALUE", DATE()-10)
INSERT INTO CY VALUES ("1035,55.5,.0234", "THREE VALUES", DATE()-100)
GO TOP
CREATE CURSOR CSRC (CD V(10), NME V(50))
INSERT INTO CSRC VALUES ('A', 'ALPHA')
INSERT INTO CSRC VALUES ('B', 'BRAVO')
INSERT INTO CSRC VALUES ('C', 'CHARLIE')
INSERT INTO CSRC VALUES ('D', 'DELTA')
INSERT INTO CSRC VALUES ('E', 'EPSILON')
INSERT INTO CSRC VALUES ('ZZ', 'ZEBRA')
GO TOP
CREATE CURSOR CCTCT (AGTPHNS V(100), CONME V(50))
INSERT INTO CCTCT VALUES ("8175551234,5121234567", "ABC CORP.")
INSERT INTO CCTCT VALUES ("8005559999", "CONGLOMERATE INC.")
INSERT INTO CCTCT VALUES ("8885556789", "XYZ, LLC.")
GO TOP
CREATE CURSOR CAGT (PHN C(10), NME V(30))
INSERT INTO CAGT VALUES ("8175551234", "JOHN SMITH")
INSERT INTO CAGT VALUES ("8005559999", "MARY JANE DOE")
INSERT INTO CAGT VALUES ("8885556789", "XAVIER HASSAN")
INSERT INTO CAGT VALUES ("5121234567", "A. CHEN")
GO TOP
CREATE CURSOR CNBRS (NBR N(10,4))
INSERT INTO CNBRS VALUES (120)
INSERT INTO CNBRS VALUES (3)
INSERT INTO CNBRS VALUES (88)
INSERT INTO CNBRS VALUES (1035)
INSERT INTO CNBRS VALUES (55.5)
INSERT INTO CNBRS VALUES (.0234)
GO TOP
ENDPROC
PROCEDURE Unload
CLOSE DATABASES
ENDPROC
PROCEDURE Cbomultisel1.Refresh
LPARAMETERS tlSkipSetSels
DODEFAULT(tlSkipSetSels)
Thisform.txt1.Refresh()
ENDPROC
PROCEDURE cmdNext2.Click
IF !EOF("CX")
SKIP IN CX
IF EOF("CX")
GO BOTTOM IN CX
ENDIF
ENDIF
Thisform.Refresh()
ENDPROC
PROCEDURE cmdNext3.Click
IF !EOF("CCTCT")
SKIP IN CCTCT
IF EOF("CCTCT")
GO BOTTOM IN CCTCT
ENDIF
ENDIF
Thisform.Refresh()
ENDPROC
PROCEDURE cmdNext4.Click
IF !EOF("CY")
SKIP IN CY
IF EOF("CY")
GO BOTTOM IN CY
ENDIF
ENDIF
Thisform.Refresh()
ENDPROC
PROCEDURE cmdPrior2.Click
IF !BOF("CX")
SKIP -1 IN CX
IF BOF("CX")
GO TOP IN CX
ENDIF
ENDIF
Thisform.Refresh()
ENDPROC
PROCEDURE cmdPrior3.Click
IF !BOF("CCTCT")
SKIP -1 IN CCTCT
IF BOF("CCTCT")
GO TOP IN CCTCT
ENDIF
ENDIF
Thisform.Refresh()
ENDPROC
PROCEDURE cmdPrior4.Click
IF !BOF("CY")
SKIP -1 IN CY
IF BOF("CY")
GO TOP IN CY
ENDIF
ENDIF
Thisform.Refresh()
ENDPROC
PROCEDURE txt1.Valid
Thisform.cboMultisel1.Refresh()
ENDPROC
ENDDEFINE