-
Notifications
You must be signed in to change notification settings - Fork 3
/
listBrowserObject.e
1042 lines (888 loc) · 34.6 KB
/
listBrowserObject.e
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
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
OPT MODULE, OSVERSION=37
MODULE 'reaction/reaction_macros',
'window','classes/window',
'gadgets/layout','layout',
'reaction/reaction_lib',
'button','gadgets/button',
'images/bevel',
'string',
'listbrowser','gadgets/listbrowser',
'gadgets/integer','integer',
'gadgets/checkbox','checkbox',
'images/label','label',
'amigalib/boopsi','amigalib/lists',
'exec/lists','exec/nodes',
'exec/memory',
'libraries/gadtools',
'intuition/intuition',
'intuition/imageclass',
'intuition/gadgetclass'
MODULE '*reactionObject','*reactionForm','*listPicker','*stringlist','*reactionListObject','*reactionLists','*sourceGen','*validator'
EXPORT ENUM LISTBGAD_IDENT, LISTBGAD_LABEL, LISTBGAD_HINT, LISTBGAD_LISTSELECT, LISTBGAD_COLUMNSBUTTON,
LISTBGAD_TOP, LISTBGAD_MAKEVISIBLE,
LISTBGAD_POSITION, LISTBGAD_VIRTUALWIDTH, LISTBGAD_NUMCOLS,
LISTBGAD_LEFT, LISTBGAD_SPACING, LISTBGAD_SELECTED,
LISTBGAD_DISABLED, LISTBGAD_READONLY, LISTBGAD_SHOWSELECTED, LISTBGAD_MULTISELECT,
LISTBGAD_SEPARATOR, LISTBGAD_VSEPARATOR, LISTBGAD_HSEPARATOR, LISTBGAD_BORDERLESS,
LISTBGAD_COLUMNTITLES, LISTBGAD_AUTOFIT, LISTBGAD_VPROP, LISTBGAD_HPROP,
LISTBGAD_SCROLLRAST, LISTBGAD_HIERARCHICAL, LISTBGAD_EDITABLE,
LISTBGAD_OK, LISTBGAD_CHILD, LISTBGAD_CANCEL
CONST NUM_LISTB_GADS=LISTBGAD_CANCEL+1
ENUM EDITCOLGADS_LIST, EDITCOLGADS_COLTITLE, EDITCOLGADS_COLWIDTH,EDITCOLGADS_SETBTN, EDITCOLGADS_OK, EDITCOLGADS_CANCEL
CONST NUM_EDITCOL_GADS=EDITCOLGADS_CANCEL+1
EXPORT OBJECT listBrowserObject OF reactionObject
listObjectId:LONG
top:INT
makeVisible:INT
position:INT
virtualWidth:INT
numColumns:INT
left:INT
spacing:INT
selected:INT
disabled:CHAR
readOnly:CHAR
showSelected:CHAR
multiSelect:CHAR
separators:CHAR
vertSeparators:CHAR
horzSeparators:CHAR
borderless:CHAR
columnTitles:CHAR
autofit:CHAR
vertProp:CHAR
horzProp:CHAR
scrollRaster:CHAR
hierarchical:CHAR
editable:CHAR
colWidths:PTR TO stdlist
colTitles:PTR TO stringlist
PRIVATE
columnInfo:PTR TO columninfo
browsernodes:PTR TO LONG
ENDOBJECT
OBJECT listBrowserSettingsForm OF reactionForm
PRIVATE
listBrowserObject:PTR TO listBrowserObject
colTitles:PTR TO stringlist
colWidths:PTR TO stdlist
selectedListId:LONG
ENDOBJECT
OBJECT editColumnsForm OF reactionForm
count:LONG
browserlist:PTR TO LONG
columnInfo:PTR TO columninfo
nodes:PTR TO stdlist
selectedNodeNum:INT
ENDOBJECT
PROC create() OF listBrowserSettingsForm
DEF gads:PTR TO LONG
NEW gads[NUM_LISTB_GADS]
self.gadgetList:=gads
NEW gads[NUM_LISTB_GADS]
self.gadgetActions:=gads
self.windowObj:=WindowObject,
WA_TITLE, 'ListBrowser Attribute Setting',
WA_LEFT, 0,
WA_TOP, 0,
WA_HEIGHT, 80,
WA_WIDTH, 150,
WA_MINWIDTH, 150,
WA_MAXWIDTH, 8192,
WA_MINHEIGHT, 80,
WA_MAXHEIGHT, 8192,
WA_ACTIVATE, TRUE,
WINDOW_POSITION, WPOS_CENTERSCREEN,
WA_PUBSCREEN, 0,
->WA_CustomScreen, gScreen,
->WINDOW_AppPort, gApp_port,
WA_CLOSEGADGET, TRUE,
WA_DEPTHGADGET, TRUE,
WA_SIZEGADGET, TRUE,
WA_DRAGBAR, TRUE,
WA_IDCMP,IDCMP_GADGETDOWN OR IDCMP_GADGETUP OR IDCMP_CLOSEWINDOW OR 0,
WINDOW_PARENTGROUP, VLayoutObject,
LAYOUT_SPACEOUTER, TRUE,
LAYOUT_DEFERLAYOUT, TRUE,
LAYOUT_ADDCHILD, LayoutObject,
LAYOUT_ORIENTATION, LAYOUT_ORIENT_HORIZ,
LAYOUT_ADDCHILD, self.gadgetList[ LISTBGAD_IDENT ]:=StringObject,
GA_ID, LISTBGAD_IDENT,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
STRINGA_MAXCHARS, 80,
StringEnd,
CHILD_LABEL, LabelObject,
LABEL_TEXT, 'Identifier',
LabelEnd,
LAYOUT_ADDCHILD, self.gadgetList[ LISTBGAD_LABEL ]:=StringObject,
GA_ID, LISTBGAD_LABEL,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
STRINGA_MAXCHARS, 80,
StringEnd,
CHILD_LABEL, LabelObject,
LABEL_TEXT, '_Label',
LabelEnd,
LAYOUT_ADDCHILD, self.gadgetList[ LISTBGAD_HINT ]:=ButtonObject,
GA_ID, LISTBGAD_HINT,
GA_TEXT, 'Hint',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,
CHILD_WEIGHTEDWIDTH,50,
LAYOUT_ADDCHILD, self.gadgetList[ LISTBGAD_LISTSELECT ]:=ButtonObject,
GA_ID, LISTBGAD_LISTSELECT,
GA_TEXT, '_Pick a List',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,
CHILD_WEIGHTEDWIDTH,50,
LAYOUT_ADDCHILD, self.gadgetList[ LISTBGAD_COLUMNSBUTTON ]:=ButtonObject,
GA_ID, LISTBGAD_COLUMNSBUTTON,
GA_TEXT, 'Edit Columns',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,
CHILD_WEIGHTEDWIDTH,50,
LayoutEnd,
LAYOUT_ADDCHILD, LayoutObject,
LAYOUT_ORIENTATION, LAYOUT_ORIENT_HORIZ,
LAYOUT_ADDCHILD, self.gadgetList[ LISTBGAD_TOP ]:=IntegerObject,
GA_ID, LISTBGAD_TOP,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
INTEGER_MINIMUM, 0,
IntegerEnd,
CHILD_LABEL, LabelObject,
LABEL_TEXT, '_Top',
LabelEnd,
LAYOUT_ADDCHILD, self.gadgetList[ LISTBGAD_MAKEVISIBLE ]:=IntegerObject,
GA_ID, LISTBGAD_MAKEVISIBLE,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
INTEGER_MINIMUM, 0,
IntegerEnd,
CHILD_LABEL, LabelObject,
LABEL_TEXT, 'Make_Visible',
LabelEnd,
LayoutEnd,
LAYOUT_ADDCHILD, LayoutObject,
LAYOUT_ORIENTATION, LAYOUT_ORIENT_HORIZ,
LAYOUT_ADDCHILD, self.gadgetList[ LISTBGAD_POSITION ]:=IntegerObject,
GA_ID, LISTBGAD_POSITION,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
INTEGER_MINIMUM, 0,
IntegerEnd,
CHILD_LABEL, LabelObject,
LABEL_TEXT, 'Positi_on',
LabelEnd,
LAYOUT_ADDCHILD, self.gadgetList[ LISTBGAD_VIRTUALWIDTH ]:=IntegerObject,
GA_ID, LISTBGAD_VIRTUALWIDTH,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
INTEGER_MINIMUM, 0,
IntegerEnd,
CHILD_LABEL, LabelObject,
LABEL_TEXT, 'Virtual_Width',
LabelEnd,
LAYOUT_ADDCHILD, self.gadgetList[ LISTBGAD_NUMCOLS ]:=IntegerObject,
GA_ID, LISTBGAD_NUMCOLS,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
INTEGER_MINIMUM, 0,
IntegerEnd,
CHILD_LABEL, LabelObject,
LABEL_TEXT, '_NumColumns',
LabelEnd,
LayoutEnd,
LAYOUT_ADDCHILD, LayoutObject,
LAYOUT_ORIENTATION, LAYOUT_ORIENT_HORIZ,
LAYOUT_ADDCHILD, self.gadgetList[ LISTBGAD_LEFT ]:=IntegerObject,
GA_ID, LISTBGAD_LEFT,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
INTEGER_MINIMUM, 0,
IntegerEnd,
CHILD_LABEL, LabelObject,
LABEL_TEXT, '_Left',
LabelEnd,
LAYOUT_ADDCHILD, self.gadgetList[ LISTBGAD_SPACING ]:=IntegerObject,
GA_ID, LISTBGAD_SPACING,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
INTEGER_MINIMUM, 0,
IntegerEnd,
CHILD_LABEL, LabelObject,
LABEL_TEXT, 'Spacing',
LabelEnd,
LAYOUT_ADDCHILD, self.gadgetList[ LISTBGAD_SELECTED ]:=IntegerObject,
GA_ID, LISTBGAD_SELECTED,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
INTEGER_MINIMUM, -1,
IntegerEnd,
CHILD_LABEL, LabelObject,
LABEL_TEXT, 'Select_ed',
LabelEnd,
LayoutEnd,
LAYOUT_ADDCHILD, LayoutObject,
LAYOUT_ORIENTATION, LAYOUT_ORIENT_HORIZ,
LAYOUT_ADDCHILD, self.gadgetList[ LISTBGAD_DISABLED ]:=CheckBoxObject,
GA_ID, LISTBGAD_DISABLED,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
GA_TEXT, '_Disabled',
CHECKBOX_TEXTPLACE, PLACETEXT_LEFT,
CheckBoxEnd,
LAYOUT_ADDCHILD, self.gadgetList[ LISTBGAD_READONLY ]:=CheckBoxObject,
GA_ID, LISTBGAD_READONLY,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
GA_TEXT, '_ReadOnly',
CHECKBOX_TEXTPLACE, PLACETEXT_LEFT,
CheckBoxEnd,
LAYOUT_ADDCHILD, self.gadgetList[ LISTBGAD_SHOWSELECTED ]:=CheckBoxObject,
GA_ID, LISTBGAD_SHOWSELECTED,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
GA_TEXT, '_ShowSelected',
CHECKBOX_TEXTPLACE, PLACETEXT_LEFT,
CheckBoxEnd,
LAYOUT_ADDCHILD, self.gadgetList[ LISTBGAD_MULTISELECT ]:=CheckBoxObject,
GA_ID, LISTBGAD_MULTISELECT,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
GA_TEXT, '_MultiSelect',
CHECKBOX_TEXTPLACE, PLACETEXT_LEFT,
CheckBoxEnd,
LayoutEnd,
LAYOUT_ADDCHILD, LayoutObject,
LAYOUT_ORIENTATION, LAYOUT_ORIENT_HORIZ,
LAYOUT_ADDCHILD, self.gadgetList[ LISTBGAD_SEPARATOR ]:=CheckBoxObject,
GA_ID, LISTBGAD_SEPARATOR,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
GA_TEXT, 'Sep_arators',
CHECKBOX_TEXTPLACE, PLACETEXT_LEFT,
CheckBoxEnd,
LAYOUT_ADDCHILD, self.gadgetList[ LISTBGAD_VSEPARATOR ]:=CheckBoxObject,
GA_ID, LISTBGAD_VSEPARATOR,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
GA_TEXT, 'VertSeparators',
CHECKBOX_TEXTPLACE, PLACETEXT_LEFT,
CheckBoxEnd,
LAYOUT_ADDCHILD, self.gadgetList[ LISTBGAD_HSEPARATOR ]:=CheckBoxObject,
GA_ID, LISTBGAD_HSEPARATOR,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
GA_TEXT, 'HorizSeparators',
CHECKBOX_TEXTPLACE, PLACETEXT_LEFT,
CheckBoxEnd,
LAYOUT_ADDCHILD, self.gadgetList[ LISTBGAD_BORDERLESS ]:=CheckBoxObject,
GA_ID, LISTBGAD_BORDERLESS,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
GA_TEXT, '_Borderless',
CHECKBOX_TEXTPLACE, PLACETEXT_LEFT,
CheckBoxEnd,
LayoutEnd,
LAYOUT_ADDCHILD, LayoutObject,
LAYOUT_ORIENTATION, LAYOUT_ORIENT_HORIZ,
LAYOUT_ADDCHILD, self.gadgetList[ LISTBGAD_COLUMNTITLES ]:=CheckBoxObject,
GA_ID, LISTBGAD_COLUMNTITLES,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
GA_TEXT, 'Col_umnTitles',
CHECKBOX_TEXTPLACE, PLACETEXT_LEFT,
CheckBoxEnd,
LAYOUT_ADDCHILD, self.gadgetList[ LISTBGAD_AUTOFIT ]:=CheckBoxObject,
GA_ID, LISTBGAD_AUTOFIT,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
GA_TEXT, 'AutoFit',
CHECKBOX_TEXTPLACE, PLACETEXT_LEFT,
CheckBoxEnd,
LAYOUT_ADDCHILD, self.gadgetList[ LISTBGAD_VPROP ]:=CheckBoxObject,
GA_ID, LISTBGAD_VPROP,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
GA_TEXT, 'VerticalProp',
CHECKBOX_TEXTPLACE, PLACETEXT_LEFT,
CheckBoxEnd,
LAYOUT_ADDCHILD, self.gadgetList[ LISTBGAD_HPROP ]:=CheckBoxObject,
GA_ID, LISTBGAD_HPROP,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
GA_TEXT, 'HorizontalProp',
CHECKBOX_TEXTPLACE, PLACETEXT_LEFT,
CheckBoxEnd,
LayoutEnd,
LAYOUT_ADDCHILD, LayoutObject,
LAYOUT_ORIENTATION, LAYOUT_ORIENT_HORIZ,
LAYOUT_ADDCHILD, self.gadgetList[ LISTBGAD_SCROLLRAST ]:=CheckBoxObject,
GA_ID, LISTBGAD_SCROLLRAST,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
GA_TEXT, 'ScrollRaster',
CHECKBOX_TEXTPLACE, PLACETEXT_LEFT,
CheckBoxEnd,
LAYOUT_ADDCHILD, self.gadgetList[ LISTBGAD_HIERARCHICAL ]:=CheckBoxObject,
GA_ID, LISTBGAD_HIERARCHICAL,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
GA_TEXT, 'Hierarchical',
CHECKBOX_TEXTPLACE, PLACETEXT_LEFT,
CheckBoxEnd,
LAYOUT_ADDCHILD, self.gadgetList[ LISTBGAD_EDITABLE ]:=CheckBoxObject,
GA_ID, LISTBGAD_EDITABLE,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
GA_TEXT, 'Editable',
CHECKBOX_TEXTPLACE, PLACETEXT_LEFT,
CheckBoxEnd,
LayoutEnd,
LAYOUT_ADDCHILD, LayoutObject,
LAYOUT_ORIENTATION, LAYOUT_ORIENT_HORIZ,
LAYOUT_ADDCHILD, self.gadgetList[ LISTBGAD_OK ]:=ButtonObject,
GA_ID, LISTBGAD_OK,
GA_TEXT, '_OK',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,
LAYOUT_ADDCHILD, self.gadgetList[ LISTBGAD_CHILD ]:=ButtonObject,
GA_ID, LISTBGAD_CHILD,
GA_TEXT, 'C_hild',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,
LAYOUT_ADDCHILD, self.gadgetList[ LISTBGAD_CANCEL ]:=ButtonObject,
GA_ID, LISTBGAD_CANCEL,
GA_TEXT, '_Cancel',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,
LayoutEnd,
LayoutEnd,
WindowEnd
self.gadgetActions[LISTBGAD_LISTSELECT]:={selectList}
self.gadgetActions[LISTBGAD_CHILD]:={editChildSettings}
self.gadgetActions[LISTBGAD_COLUMNTITLES]:={colTitles}
self.gadgetActions[LISTBGAD_COLUMNSBUTTON]:={editColumns}
self.gadgetActions[LISTBGAD_HINT]:={editHint}
self.gadgetActions[LISTBGAD_CANCEL]:=MR_CANCEL
self.gadgetActions[LISTBGAD_OK]:=MR_OK
ENDPROC
PROC colTitles(nself,gadget,id,code) OF listBrowserSettingsForm
self:=nself
SetGadgetAttrsA(self.gadgetList[ LISTBGAD_COLUMNSBUTTON ],0,0,[GA_DISABLED,IF code=1 THEN FALSE ELSE TRUE,0])
DoMethod(self.windowObj, WM_RETHINK)
ENDPROC
PROC editColumns(nself,gadget,id,code) OF listBrowserSettingsForm
DEF editColumnsForm: PTR TO editColumnsForm
DEF colcount
self:=nself
self.setBusy()
colcount:=Gets(self.gadgetList[ LISTBGAD_NUMCOLS ],INTEGER_NUMBER)
NEW editColumnsForm.create(colcount)
editColumnsForm.editColumns(self.colTitles,self.colWidths)
END editColumnsForm
self.clearBusy()
ENDPROC
PROC selectList(nself,gadget,id,code) OF listBrowserSettingsForm
DEF frmListPicker:PTR TO listPickerForm
DEF res
self:=nself
self.setBusy()
NEW frmListPicker.create()
IF (res:=frmListPicker.selectList())<>-1
self.selectedListId:=res
ENDIF
END frmListPicker
self.clearBusy()
ENDPROC
PROC editChildSettings(nself,gadget,id,code) OF listBrowserSettingsForm
self:=nself
self.setBusy()
self.listBrowserObject.editChildSettings()
self.clearBusy()
ENDPROC
PROC end() OF listBrowserSettingsForm
END self.gadgetList[NUM_LISTB_GADS]
END self.gadgetActions[NUM_LISTB_GADS]
DisposeObject(self.windowObj)
ENDPROC
EXPORT PROC canClose(modalRes) OF listBrowserSettingsForm
DEF res
IF modalRes=MR_CANCEL THEN RETURN TRUE
IF checkIdent(self,self.listBrowserObject,LISTBGAD_IDENT)=FALSE
RETURN FALSE
ENDIF
ENDPROC TRUE
PROC editHint(nself,gadget,id,code) OF listBrowserSettingsForm
self:=nself
self.setBusy()
self.listBrowserObject.editHint()
self.clearBusy()
self.updateHint(LISTBGAD_HINT, self.listBrowserObject.hintText)
ENDPROC
PROC editSettings(comp:PTR TO listBrowserObject) OF listBrowserSettingsForm
DEF res
self.listBrowserObject:=comp
self.selectedListId:=comp.listObjectId
self.colTitles:=comp.colTitles
self.colWidths:=comp.colWidths
self.updateHint(LISTBGAD_HINT, comp.hintText)
SetGadgetAttrsA(self.gadgetList[ LISTBGAD_IDENT ],0,0,[STRINGA_TEXTVAL,comp.ident,0])
SetGadgetAttrsA(self.gadgetList[ LISTBGAD_LABEL ],0,0,[STRINGA_TEXTVAL,comp.label,0])
SetGadgetAttrsA(self.gadgetList[ LISTBGAD_TOP ],0,0,[INTEGER_NUMBER,comp.top,0])
SetGadgetAttrsA(self.gadgetList[ LISTBGAD_MAKEVISIBLE ],0,0,[INTEGER_NUMBER,comp.makeVisible,0])
SetGadgetAttrsA(self.gadgetList[ LISTBGAD_POSITION ],0,0,[INTEGER_NUMBER,comp.position,0])
SetGadgetAttrsA(self.gadgetList[ LISTBGAD_VIRTUALWIDTH ],0,0,[INTEGER_NUMBER,comp.virtualWidth,0])
SetGadgetAttrsA(self.gadgetList[ LISTBGAD_NUMCOLS ],0,0,[INTEGER_NUMBER,comp.numColumns,0])
SetGadgetAttrsA(self.gadgetList[ LISTBGAD_LEFT ],0,0,[INTEGER_NUMBER,comp.left,0])
SetGadgetAttrsA(self.gadgetList[ LISTBGAD_SPACING ],0,0,[INTEGER_NUMBER,comp.spacing,0])
SetGadgetAttrsA(self.gadgetList[ LISTBGAD_SELECTED ],0,0,[INTEGER_NUMBER,comp.selected,0])
SetGadgetAttrsA(self.gadgetList[ LISTBGAD_DISABLED ],0,0,[CHECKBOX_CHECKED,comp.disabled,0])
SetGadgetAttrsA(self.gadgetList[ LISTBGAD_READONLY ],0,0,[CHECKBOX_CHECKED,comp.readOnly,0])
SetGadgetAttrsA(self.gadgetList[ LISTBGAD_SHOWSELECTED ],0,0,[CHECKBOX_CHECKED,comp.showSelected,0])
SetGadgetAttrsA(self.gadgetList[ LISTBGAD_MULTISELECT ],0,0,[CHECKBOX_CHECKED,comp.multiSelect,0])
SetGadgetAttrsA(self.gadgetList[ LISTBGAD_SEPARATOR ],0,0,[CHECKBOX_CHECKED,comp.separators,0])
SetGadgetAttrsA(self.gadgetList[ LISTBGAD_VSEPARATOR ],0,0,[CHECKBOX_CHECKED,comp.vertSeparators,0])
SetGadgetAttrsA(self.gadgetList[ LISTBGAD_HSEPARATOR ],0,0,[CHECKBOX_CHECKED,comp.horzSeparators,0])
SetGadgetAttrsA(self.gadgetList[ LISTBGAD_BORDERLESS ],0,0,[CHECKBOX_CHECKED,comp.borderless,0])
SetGadgetAttrsA(self.gadgetList[ LISTBGAD_COLUMNTITLES ],0,0,[CHECKBOX_CHECKED,comp.columnTitles,0])
SetGadgetAttrsA(self.gadgetList[ LISTBGAD_AUTOFIT ],0,0,[CHECKBOX_CHECKED,comp.autofit,0])
SetGadgetAttrsA(self.gadgetList[ LISTBGAD_VPROP ],0,0,[CHECKBOX_CHECKED,comp.vertProp,0])
SetGadgetAttrsA(self.gadgetList[ LISTBGAD_HPROP ],0,0,[CHECKBOX_CHECKED,comp.horzProp,0])
SetGadgetAttrsA(self.gadgetList[ LISTBGAD_SCROLLRAST ],0,0,[CHECKBOX_CHECKED,comp.scrollRaster,0])
SetGadgetAttrsA(self.gadgetList[ LISTBGAD_HIERARCHICAL ],0,0,[CHECKBOX_CHECKED,comp.hierarchical,0])
SetGadgetAttrsA(self.gadgetList[ LISTBGAD_EDITABLE ],0,0,[CHECKBOX_CHECKED,comp.editable,0])
self.colTitles(self,0,0,comp.columnTitles)
res:=self.showModal()
IF res=MR_OK
AstrCopy(comp.ident,Gets(self.gadgetList[ LISTBGAD_IDENT ],STRINGA_TEXTVAL))
AstrCopy(comp.label,Gets(self.gadgetList[ LISTBGAD_LABEL ],STRINGA_TEXTVAL))
comp.listObjectId:=self.selectedListId
comp.top:=Gets(self.gadgetList[ LISTBGAD_TOP ],INTEGER_NUMBER)
comp.makeVisible:=Gets(self.gadgetList[ LISTBGAD_MAKEVISIBLE ],INTEGER_NUMBER)
comp.position:=Gets(self.gadgetList[ LISTBGAD_POSITION ],INTEGER_NUMBER)
comp.virtualWidth:=Gets(self.gadgetList[ LISTBGAD_VIRTUALWIDTH ],INTEGER_NUMBER)
comp.numColumns:=Gets(self.gadgetList[ LISTBGAD_NUMCOLS ],INTEGER_NUMBER)
comp.left:=Gets(self.gadgetList[ LISTBGAD_LEFT ],INTEGER_NUMBER)
comp.spacing:=Gets(self.gadgetList[ LISTBGAD_SPACING ],INTEGER_NUMBER)
comp.selected:=Gets(self.gadgetList[ LISTBGAD_SELECTED ],INTEGER_NUMBER)
comp.disabled:=Gets(self.gadgetList[ LISTBGAD_DISABLED ],CHECKBOX_CHECKED)
comp.readOnly:=Gets(self.gadgetList[ LISTBGAD_READONLY ],CHECKBOX_CHECKED)
comp.showSelected:=Gets(self.gadgetList[ LISTBGAD_SHOWSELECTED ],CHECKBOX_CHECKED)
comp.multiSelect:=Gets(self.gadgetList[ LISTBGAD_MULTISELECT ],CHECKBOX_CHECKED)
comp.separators:=Gets(self.gadgetList[ LISTBGAD_SEPARATOR ],CHECKBOX_CHECKED)
comp.vertSeparators:=Gets(self.gadgetList[ LISTBGAD_VSEPARATOR ],CHECKBOX_CHECKED)
comp.horzSeparators:=Gets(self.gadgetList[ LISTBGAD_HSEPARATOR ],CHECKBOX_CHECKED)
comp.borderless:=Gets(self.gadgetList[ LISTBGAD_BORDERLESS ],CHECKBOX_CHECKED)
comp.columnTitles:=Gets(self.gadgetList[ LISTBGAD_COLUMNTITLES ],CHECKBOX_CHECKED)
comp.autofit:=Gets(self.gadgetList[ LISTBGAD_AUTOFIT ],CHECKBOX_CHECKED)
comp.vertProp:=Gets(self.gadgetList[ LISTBGAD_VPROP ],CHECKBOX_CHECKED)
comp.horzProp:=Gets(self.gadgetList[ LISTBGAD_HPROP ],CHECKBOX_CHECKED)
comp.scrollRaster:=Gets(self.gadgetList[ LISTBGAD_SCROLLRAST ],CHECKBOX_CHECKED)
comp.hierarchical:=Gets(self.gadgetList[ LISTBGAD_HIERARCHICAL ],CHECKBOX_CHECKED)
comp.editable:=Gets(self.gadgetList[ LISTBGAD_EDITABLE ],CHECKBOX_CHECKED)
ENDIF
ENDPROC res=MR_OK
PROC create(count) OF editColumnsForm
DEF gads:PTR TO LONG
DEF i,newLayout
DEF rootLayout
NEW gads[NUM_EDITCOL_GADS]
self.gadgetList:=gads
NEW gads[NUM_EDITCOL_GADS]
self.gadgetActions:=gads
self.count:=count
self.browserlist:=browserNodesA([0])
self.columnInfo:=New(4*SIZEOF columninfo)
self.columnInfo[0].width:=1
self.columnInfo[0].title:='Column Number'
self.columnInfo[0].flags:=CIF_WEIGHTED
self.columnInfo[1].width:=2
self.columnInfo[1].title:='Column Title'
self.columnInfo[1].flags:=CIF_WEIGHTED
self.columnInfo[2].width:=2
self.columnInfo[2].title:='Column Width'
self.columnInfo[2].flags:=CIF_WEIGHTED
self.columnInfo[3].width:=-1
self.columnInfo[3].title:=-1
self.columnInfo[3].flags:=-1
self.windowObj:=WindowObject,
WA_TITLE, 'Set ListBrowser Columns',
WA_LEFT, 0,
WA_TOP, 0,
WA_HEIGHT, 250,
WA_WIDTH, 250,
WA_MINWIDTH, 150,
WA_MAXWIDTH, 8192,
WA_MINHEIGHT, 80,
WA_MAXHEIGHT, 8192,
WA_ACTIVATE, TRUE,
WINDOW_POSITION, WPOS_CENTERSCREEN,
WA_PUBSCREEN, 0,
->WA_CustomScreen, gScreen,
->WINDOW_AppPort, gApp_port,
WA_CLOSEGADGET, TRUE,
WA_DEPTHGADGET, TRUE,
WA_SIZEGADGET, TRUE,
WA_DRAGBAR, TRUE,
WA_IDCMP,IDCMP_GADGETDOWN OR IDCMP_GADGETUP OR IDCMP_CLOSEWINDOW OR 0,
WINDOW_PARENTGROUP, VLayoutObject,
LAYOUT_SPACEOUTER, TRUE,
LAYOUT_DEFERLAYOUT, TRUE,
LAYOUT_ADDCHILD, self.gadgetList[ EDITCOLGADS_LIST ]:=ListBrowserObject,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
GA_ID,EDITCOLGADS_LIST,
LISTBROWSER_COLUMNTITLES, TRUE,
LISTBROWSER_COLUMNINFO, self.columnInfo,
LISTBROWSER_LABELS, self.browserlist,
ListBrowserEnd,
CHILD_WEIGHTEDHEIGHT, 100,
LAYOUT_ADDCHILD, LayoutObject,
LAYOUT_ORIENTATION, LAYOUT_ORIENT_HORIZ,
LAYOUT_ADDCHILD, self.gadgetList[ EDITCOLGADS_COLTITLE ]:=StringObject,
GA_ID, EDITCOLGADS_COLTITLE,
GA_DISABLED,TRUE,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
STRINGA_MAXCHARS, 80,
StringEnd,
CHILD_LABEL, LabelObject,
LABEL_TEXT, 'Column Title',
LabelEnd,
LAYOUT_ADDCHILD, self.gadgetList[ EDITCOLGADS_COLWIDTH ]:=IntegerObject,
GA_ID, EDITCOLGADS_COLWIDTH,
GA_DISABLED,TRUE,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
INTEGER_MINIMUM, 0,
IntegerEnd,
CHILD_LABEL, LabelObject,
LABEL_TEXT, 'Column Width',
LabelEnd,
LAYOUT_ADDCHILD, self.gadgetList[ EDITCOLGADS_SETBTN ]:=ButtonObject,
GA_ID, EDITCOLGADS_SETBTN,
GA_DISABLED,TRUE,
GA_TEXT, 'Set',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,
LayoutEnd,
CHILD_WEIGHTEDHEIGHT, 0,
LAYOUT_ADDCHILD, LayoutObject,
LAYOUT_ORIENTATION, LAYOUT_ORIENT_HORIZ,
LAYOUT_ADDCHILD, self.gadgetList[ EDITCOLGADS_OK ]:=ButtonObject,
GA_ID, EDITCOLGADS_OK,
GA_TEXT, '_OK',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,
LAYOUT_ADDCHILD, self.gadgetList[ EDITCOLGADS_CANCEL ]:=ButtonObject,
GA_ID, EDITCOLGADS_CANCEL,
GA_TEXT, '_Cancel',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,
LayoutEnd,
CHILD_WEIGHTEDHEIGHT, 0,
LayoutEnd,
WindowEnd
self.gadgetActions[EDITCOLGADS_LIST]:={updateSel}
self.gadgetActions[EDITCOLGADS_SETBTN]:={setValues}
self.gadgetActions[EDITCOLGADS_COLTITLE]:={setValues}
self.gadgetActions[EDITCOLGADS_COLWIDTH]:={setValues}
self.gadgetActions[EDITCOLGADS_CANCEL]:=MR_CANCEL
self.gadgetActions[EDITCOLGADS_OK]:=MR_OK
self.selectedNodeNum:=-1
ENDPROC
PROC updateSel(nself,gadget,id,code) OF editColumnsForm
DEF t,n,win,dis
self:=nself
dis:=IF code>=0 THEN FALSE ELSE TRUE
win:=Gets(self.windowObj,WINDOW_WINDOW)
SetGadgetAttrsA(self.gadgetList[ EDITCOLGADS_COLTITLE ],win,0,[GA_DISABLED, dis,TAG_END])
SetGadgetAttrsA(self.gadgetList[ EDITCOLGADS_COLWIDTH ],win,0,[GA_DISABLED, dis,TAG_END])
SetGadgetAttrsA(self.gadgetList[ EDITCOLGADS_SETBTN ],win,0,[GA_DISABLED, dis,TAG_END])
self.selectedNodeNum:=code
GetListBrowserNodeAttrsA (self.nodes.item(code),[LBNA_COLUMN,1,LBNCA_TEXT,{t},LBNA_COLUMN,2,LBNCA_TEXT,{n},TAG_END])
SetGadgetAttrsA(self.gadgetList[ EDITCOLGADS_COLTITLE ],win,0,[STRINGA_TEXTVAL,t,TAG_END])
SetGadgetAttrsA(self.gadgetList[ EDITCOLGADS_COLWIDTH ],win,0,[INTEGER_NUMBER,Val(n),TAG_END])
ENDPROC
PROC setValues(nself,gadget,id,code) OF editColumnsForm
DEF t,n,win
DEF tempStr[100]:STRING
self:=nself
win:=Gets(self.windowObj,WINDOW_WINDOW)
t:=Gets(self.gadgetList[ EDITCOLGADS_COLTITLE ],STRINGA_TEXTVAL)
n:=Gets(self.gadgetList[ EDITCOLGADS_COLWIDTH ],INTEGER_NUMBER)
StringF(tempStr,'\d',n)
SetGadgetAttrsA(self.gadgetList[EDITCOLGADS_LIST],win,0,[LISTBROWSER_LABELS, Not(0), TAG_END])
SetListBrowserNodeAttrsA (self.nodes.item(self.selectedNodeNum),[LBNA_COLUMN,1,LBNCA_COPYTEXT,TRUE,LBNCA_TEXT,t,LBNA_COLUMN,2,LBNCA_COPYTEXT,TRUE,LBNCA_TEXT,tempStr,TAG_END])
SetGadgetAttrsA(self.gadgetList[EDITCOLGADS_LIST],win,0,[LISTBROWSER_LABELS, self.browserlist, TAG_END])
ENDPROC
PROC end() OF editColumnsForm
freeBrowserNodes(self.browserlist)
Dispose(self.columnInfo)
SUPER self.end()
ENDPROC
PROC editColumns(titles:PTR TO stringlist, widths:PTR TO stdlist) OF editColumnsForm
DEF i,res,t,n
DEF tempStr[200]:STRING
DEF colTitle[200]:STRING
DEF colWidth[10]:STRING
DEF nodes:PTR TO stdlist
SetGadgetAttrsA(self.gadgetList[EDITCOLGADS_LIST],0,0,[LISTBROWSER_LABELS, Not(0), TAG_END])
NEW nodes.stdlist(self.count)
self.nodes:=nodes
FOR i:=0 TO self.count-1
StringF(tempStr,'\d',i+1)
IF i<titles.count() THEN StrCopy(colTitle,titles.item(i)) ELSE StringF(colTitle,'Column\d',i+1)
IF i<widths.count() THEN StringF(colWidth,'\d',widths.item(i)) ELSE StrCopy(colWidth,'1')
IF (n:=AllocListBrowserNodeA(3, [LBNA_FLAGS,0, LBNA_COLUMN,0, LBNCA_COPYTEXT, TRUE, LBNCA_TEXT, tempStr, LBNA_COLUMN,1, LBNCA_COPYTEXT, TRUE, LBNCA_TEXT, colTitle,LBNA_COLUMN,2, LBNCA_COPYTEXT, TRUE, LBNCA_TEXT, colWidth,TAG_END]))
AddTail(self.browserlist, n)
ENDIF
nodes.add(n)
ENDFOR
SetGadgetAttrsA(self.gadgetList[EDITCOLGADS_LIST],0,0,[LISTBROWSER_LABELS, self.browserlist, TAG_END])
res:=self.showModal()
IF res=MR_OK
FOR i:=0 TO self.count-1
GetListBrowserNodeAttrsA (nodes.item(i),[LBNA_COLUMN,1,LBNCA_TEXT,{t},LBNA_COLUMN,2,LBNCA_TEXT,{n},TAG_END])
titles.setItem(i,t)
widths.setItem(i,Val(n))
ENDFOR
ENDIF
END nodes
ENDPROC res=MR_OK
PROC browserNodesA(text:PTR TO LONG, colCount) OF listBrowserObject
DEF list:PTR TO lh
DEF node:PTR TO ln
IF (list:=AllocMem(SIZEOF lh,MEMF_PUBLIC))
newList(list)
WHILE( text[] )
node:=AllocListBrowserNodeA( colCount,[LBNCA_TEXT,text[]++,0])
IF(node=FALSE)
freeBrowserNodes( list )
RETURN NIL
ENDIF
AddTail( list, node )
ENDWHILE
ENDIF
ENDPROC list
PROC makeBrowserList(id) OF listBrowserObject
DEF i,res
DEF reactionList=0:PTR TO reactionListObject
DEF findObject:PTR TO reactionListObject
DEF newlist
DEF reactionLists:PTR TO stdlist
reactionLists:=getReactionLists()
FOR i:=0 TO reactionLists.count()-1
findObject:=reactionLists.item(i)
IF findObject.id = id
reactionList:=findObject
ENDIF
ENDFOR
IF reactionList
newlist:=List(reactionList.items.count()+1)
FOR i:=0 TO reactionList.items.count()-1
ListAddItem(newlist,reactionList.items.item(i))
ENDFOR
ELSE
newlist:=List(1)
ENDIF
ListAddItem(newlist,0)
res:=self.browserNodesA(newlist,self.numColumns)
DisposeLink(newlist)
ENDPROC res
EXPORT PROC createPreviewObject(scr) OF listBrowserObject
DEF i
Dispose(self.columnInfo)
self.columnInfo:=New((self.numColumns+1)*SIZEOF columninfo)
FOR i:=0 TO self.numColumns-1
IF self.colWidths.count()>i
self.columnInfo[i].width:=self.colWidths.item(i)
ELSE
self.columnInfo[i].width:=1
ENDIF
IF self.colTitles.count()>i
self.columnInfo[i].title:=self.colTitles.item(i)
ELSE
self.columnInfo[i].title:=''
ENDIF
self.columnInfo[i].flags:=CIF_WEIGHTED
ENDFOR
self.columnInfo[self.numColumns].width:=-1
self.columnInfo[self.numColumns].title:=-1
self.columnInfo[self.numColumns].flags:=-1
IF self.browsernodes THEN freeBrowserNodes( self.browsernodes )
self.previewObject:=ListBrowserObject,
GA_ID, self.id,
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
GA_DISABLED, self.disabled,
GA_READONLY, self.readOnly,
LISTBROWSER_TOP, self.top,
LISTBROWSER_MAKEVISIBLE, self.makeVisible,
LISTBROWSER_POSITION, self.position,
LISTBROWSER_VIRTUALWIDTH, self.virtualWidth,
LISTBROWSER_LEFT, self.left,
LISTBROWSER_SPACING, self.spacing,
LISTBROWSER_SELECTED, self.selected,
LISTBROWSER_SHOWSELECTED, self.showSelected,
LISTBROWSER_MULTISELECT, self.multiSelect,
LISTBROWSER_SEPARATORS, self.separators,
LISTBROWSER_VERTSEPARATORS, self.vertSeparators,
LISTBROWSER_HORIZSEPARATORS, self.horzSeparators,
LISTBROWSER_BORDERLESS, self.borderless,
LISTBROWSER_COLUMNTITLES, self.columnTitles,
LISTBROWSER_AUTOFIT, self.autofit,
LISTBROWSER_VERTICALPROP, self.vertProp,
LISTBROWSER_HORIZONTALPROP, self.horzProp,
LISTBROWSER_SCROLLRASTER, self.scrollRaster,
LISTBROWSER_HIERARCHICAL, self.hierarchical,
LISTBROWSER_EDITABLE, self.editable,
LISTBROWSER_COLUMNINFO, self.columnInfo,
LISTBROWSER_LABELS, self.browsernodes:=self.makeBrowserList(self.listObjectId),
ListBrowserEnd
IF self.previewObject=0 THEN self.previewObject:=self.createErrorObject(scr)
self.makePreviewChildAttrs(0)
ENDPROC
EXPORT PROC create(parent) OF listBrowserObject
DEF colWidths:PTR TO stdlist
DEF colTitles:PTR TO stringlist
self.type:=TYPE_LISTBROWSER
SUPER self.create(parent)
NEW colWidths.stdlist(20)
self.colWidths:=colWidths
NEW colTitles.stringlist(20)
self.colTitles:=colTitles
self.columnInfo:=0
self.listObjectId:=-1
self.top:=0
self.makeVisible:=0
self.position:=0
self.virtualWidth:=0
self.numColumns:=1
self.left:=0
self.spacing:=0
self.selected:=-1
self.disabled:=0
self.readOnly:=0
self.showSelected:=TRUE
self.multiSelect:=0
self.separators:=TRUE
self.vertSeparators:=TRUE
self.horzSeparators:=0
self.borderless:=0
self.columnTitles:=0
self.autofit:=0
self.vertProp:=TRUE
self.horzProp:=0
self.scrollRaster:=TRUE
self.hierarchical:=0
self.editable:=0
self.browsernodes:=0
self.libsused:=[TYPE_LISTBROWSER]
ENDPROC
PROC end() OF listBrowserObject
END self.colWidths
END self.colTitles
Dispose(self.columnInfo)
freeBrowserNodes( self.browsernodes )
SUPER self.end()
ENDPROC
EXPORT PROC editSettings() OF listBrowserObject
DEF editForm:PTR TO listBrowserSettingsForm
DEF res
NEW editForm.create()
res:=editForm.editSettings(self)
END editForm
ENDPROC res
#define makeProp(a,b) 'a',{self.a},b
EXPORT PROC serialiseData() OF listBrowserObject IS
[
makeProp(listObjectId,FIELDTYPE_LONG),
makeProp(top,FIELDTYPE_INT),
makeProp(makeVisible,FIELDTYPE_INT),
makeProp(position,FIELDTYPE_INT),
makeProp(virtualWidth,FIELDTYPE_INT),
makeProp(numColumns,FIELDTYPE_INT),
makeProp(left,FIELDTYPE_INT),
makeProp(spacing,FIELDTYPE_INT),
makeProp(selected,FIELDTYPE_INT),
makeProp(disabled,FIELDTYPE_CHAR),
makeProp(readOnly,FIELDTYPE_CHAR),
makeProp(showSelected,FIELDTYPE_CHAR),
makeProp(multiSelect,FIELDTYPE_CHAR),
makeProp(separators,FIELDTYPE_CHAR),
makeProp(vertSeparators,FIELDTYPE_CHAR),
makeProp(horzSeparators,FIELDTYPE_CHAR),
makeProp(borderless,FIELDTYPE_CHAR),
makeProp(columnTitles,FIELDTYPE_CHAR),
makeProp(autofit,FIELDTYPE_CHAR),
makeProp(vertProp,FIELDTYPE_CHAR),
makeProp(horzProp,FIELDTYPE_CHAR),
makeProp(scrollRaster,FIELDTYPE_CHAR),
makeProp(hierarchical,FIELDTYPE_CHAR),
makeProp(editable,FIELDTYPE_CHAR),
makeProp(colWidths,FIELDTYPE_INTLIST),
makeProp(colTitles,FIELDTYPE_STRLIST)
]
EXPORT PROC genCodeProperties(srcGen:PTR TO srcGen) OF listBrowserObject
DEF tempStr[200]:STRING
srcGen.componentProperty('GA_RelVerify','TRUE',FALSE)
srcGen.componentProperty('GA_TabCycle','TRUE',FALSE)
IF self.disabled THEN srcGen.componentProperty('GA_Disabled','TRUE',FALSE)
IF self.readOnly THEN srcGen.componentProperty('GA_ReadOnly','TRUE',FALSE)
IF self.left THEN srcGen.componentPropertyInt('LISTBROWSER_Left',self.left)
IF self.top THEN srcGen.componentPropertyInt('LISTBROWSER_Top',self.top)
IF self.makeVisible THEN srcGen.componentPropertyInt('LISTBROWSER_MakeVisible',self.makeVisible)
srcGen.componentPropertyInt('LISTBROWSER_Position',self.position)
IF self.virtualWidth THEN srcGen.componentPropertyInt('LISTBROWSER_VirtualWidth',self.virtualWidth)
IF self.spacing THEN srcGen.componentPropertyInt('LISTBROWSER_Spacing',self.spacing)
IF self.selected<>-1 THEN srcGen.componentPropertyInt('LISTBROWSER_Selected',self.selected)
IF self.listObjectId>=0
StringF(tempStr,'labels\d',self.id)