-
Notifications
You must be signed in to change notification settings - Fork 3
/
rebuild.e
3825 lines (3427 loc) · 121 KB
/
rebuild.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 OSVERSION=37,LARGE
MODULE 'reaction/reaction_macros',
'window','classes/window',
'gadgets/layout','layout',
'reaction/reaction_lib',
'button','gadgets/button',
'bevel',
'space',
'string','checkbox','chooser','label','integer','palette',
'requester','classes/requester',
'images/bevel',
'images/label',
'*bball',
'*textfield',
'penmap',
'bitmap',
'getfile',
'getfont',
'getscreenmode',
'fuelgauge',
'radiobutton',
'clicktab',
'speedbar',
'colorwheel',
'datebrowser',
'getcolor',
'listview',
'sketchboard',
'texteditor',
'virtual',
'scroller','glyph','slider',
'gadtools','libraries/gadtools',
'dos/dos',
'exec',
'icon',
'asl','libraries/asl',
'tools/boopsi',
'workbench/startup',
'workbench/workbench',
'amigalib/boopsi','exec/memory',
'listbrowser','gadgets/listbrowser',
'intuition/intuition','intuition/screens','intuition/imageclass','intuition/gadgetclass','intuition/classusr'
MODULE '*fileStreamer','*stringStreamer','*baseStreamer','*objectPicker','*cSourceGen', '*eSourceGen',
'*sourceGen','*codeGenForm','*listManagerForm','*reactionLists','*dialogs','*libraryVersions',
'*getScreenModeObject','*getFontObject','*getFileObject','*textFieldObject','*drawListObject','*fuelGaugeObject',
'*bevelObject','*listBrowserObject','*clickTabObject','*chooserObject','*radioObject','*menuObject',
'*rexxObject','*reactionListObject','*windowObject','*screenObject','*layoutObject','*paletteObject',
'*scrollerObject','*glyphObject','*spaceObject','*labelObject','*checkboxObject','*buttonObject',
'*stringObject','*integerObject','*stringlist','*reactionObject','*reactionForm','*boingBallObject',
'*penMapObject','*sliderObject','*bitmapObject','*speedBarObject','*colorWheelObject','*dateBrowserObject',
'*getColorObject','*gradSliderObject','*tapeDeckObject','*textEditorObject','*ledObject','*listViewObject',
'*virtualObject','*sketchboardObject','*tabsObject','*requesterObject',
'*requesterItemObject','*codePreviewForm'
#define vernum '1.2.0'
#date verstring '$VER:Rebuild 1.2.0-%Y%m%d%h%n%s'
#ifndef EVO_3_7_0
FATAL 'Rebuild should only be compiled with E-VO Amiga E Compiler v3.7.0 or higher'
#endif
CONST MAX_UNDO_COUNT=50
CONST ROOT_APPLICATION_ITEM=0
CONST ROOT_REXX_ITEM=1
CONST ROOT_REQUESTER_ITEM=2
CONST ROOT_SCREEN_ITEM=3
CONST ROOT_WINDOW_ITEM=4
CONST ROOT_MENU_ITEM=5
CONST ROOT_LAYOUT_ITEM=6
ENUM GAD_COMPONENTLIST,GAD_TEMP_COPYTO, GAD_TEMP_COPYFROM, GAD_TEMP_MOVETO, GAD_TEMP_MOVEFROM, GAD_TEMP_REMOVE, GAD_TEMPLIST, GAD_ADD, GAD_EDIT, GAD_GENMINUS, GAD_GENPLUS, GAD_DELETE, GAD_MOVEUP, GAD_MOVEDOWN,
GAD_LISTS, GAD_CODE, GAD_LOAD, GAD_SAVE, GAD_NEW
CONST GAD_COUNT=GAD_NEW+1
ENUM MENU_PROJECT, MENU_EDIT
CONST MENU_ADD_GADGET_COUNT=29
CONST MENU_ADD_IMAGE_COUNT=8
ENUM LANG_E, LANG_C
CONST MENU_PROJECT_NEW=0
CONST MENU_PROJECT_LOAD=1
CONST MENU_PROJECT_SAVE=2
CONST MENU_PROJECT_SAVEAS=3
CONST MENU_PROJECT_REOPEN=4
CONST MENU_PROJECT_CODEOPTIONS=6
CONST MENU_PROJECT_SAVECODE=7
CONST MENU_PROJECT_SHOWLIBS=9
CONST MENU_PROJECT_ABOUT=11
CONST MENU_PROJECT_QUIT=13
CONST MENU_EDIT_UNDO=0
CONST MENU_EDIT_REDO=1
CONST MENU_EDIT_ADD_GADGET=3
CONST MENU_EDIT_ADD_IMAGE=4
CONST MENU_EDIT_ADD_WINDOW=5
CONST MENU_EDIT_ADD_HLAYOUT=6
CONST MENU_EDIT_ADD_VLAYOUT=7
CONST MENU_EDIT_EDIT=9
CONST MENU_EDIT_DELETE=10
CONST MENU_EDIT_MOVE=12
CONST MENU_EDIT_LISTS=14
CONST MENU_EDIT_BUFFER=16
CONST MENU_EDIT_SHOW_ADD_SETTINGS=17
CONST MENU_EDIT_WARN_ON_DEL=18
CONST MENU_EDIT_SAVE_ICONS=19
CONST MENU_EDIT_PREVIEWCODE=20
CONST MENU_EDIT_PREVIEW=22
CONST MENU_EDIT_MOVEUP=0
CONST MENU_EDIT_MOVEDOWN=1
CONST MENU_EDIT_MOVETOP=2
CONST MENU_EDIT_MOVEBOTTOM=3
CONST MENU_EDIT_MOVELPREV=4
CONST MENU_EDIT_MOVELNEXT=5
CONST MENU_EDIT_MOVEINTOLAYOUT_HORIZ=6
CONST MENU_EDIT_MOVEINTOLAYOUT_VERT=7
CONST FILE_FORMAT_VER=2
OBJECT systemOptions
savePath[256]:ARRAY OF CHAR
showBuffer:CHAR
showSettingsOnAdd:CHAR
warnOnDelete:CHAR
saveProjectIcons:CHAR
previewCode:CHAR
windowTop:INT
windowLeft:INT
windowWidth:INT
windowHeight:INT
codePreviewTop:INT
codePreviewLeft:INT
codePreviewWidth:INT
codePreviewHeight:INT
ENDOBJECT
DEF columninfo[4]:ARRAY OF columninfo
DEF columninfo2[2]:ARRAY OF columninfo
DEF mainWindow=0
DEF mainWindowLayout=0
DEF bufferLayout=0
DEF appPort=0
DEF win:PTR TO window
DEF gMain_Gadgets[GAD_COUNT]:ARRAY OF LONG
DEF objectList=0:PTR TO stdlist
DEF bufferList=0:PTR TO stdlist
DEF selectedComp:PTR TO reactionObject
DEF selectedBuffComp:PTR TO reactionObject
DEF list=0,list2=0
DEF changes=FALSE
DEF menus=0
DEF filename[255]:STRING
DEF windowTitle[200]:STRING
DEF startupfilename[256]:STRING
DEF iconFileName[256]:STRING
DEF tabsbase=0
DEF gradientsliderbase=0
DEF progressbase=0
DEF statusbarbase=0
DEF tapedeckbase=0
DEF textentrybase=0
DEF ledbase=0
DEF smartbitmapbase=0
DEF titlebarbase=0
DEF errorState=0
DEF codeOptions: codeOptions
DEF systemOptions: systemOptions
DEF recentFiles:PTR TO stringlist
DEF undoData:PTR TO stdlist
DEF undoPos=-1
DEF codePreviewForm:PTR TO codePreviewForm
PROC openClasses()
IF (requesterbase:=OpenLibrary('requester.class',0))=NIL THEN Throw("LIB","reqr")
IF (iconbase:=OpenLibrary('icon.library',33))=NIL THEN Throw("LIB","icon")
IF (gadtoolsbase:=OpenLibrary('gadtools.library',0))=NIL THEN Throw("LIB","gadt")
IF (windowbase:=OpenLibrary('window.class',0))=NIL THEN Throw("LIB","win")
IF (listbrowserbase:=OpenLibrary('gadgets/listbrowser.gadget',0))=NIL THEN Throw("LIB","list")
IF (radiobuttonbase:=OpenLibrary('gadgets/radiobutton.gadget',0))=NIL THEN Throw("LIB","rbtn")
IF (clicktabbase:=OpenLibrary('gadgets/clicktab.gadget',0))=NIL THEN Throw("LIB","clkt")
IF (buttonbase:=OpenLibrary('gadgets/button.gadget',0))=NIL THEN Throw("LIB","btn")
IF (layoutbase:=OpenLibrary('gadgets/layout.gadget',0))=NIL THEN Throw("LIB","layo")
IF (stringbase:=OpenLibrary('gadgets/string.gadget',0))=NIL THEN Throw("LIB","strn")
IF (chooserbase:=OpenLibrary('gadgets/chooser.gadget',0))=NIL THEN Throw("LIB","choo")
IF (palettebase:=OpenLibrary('gadgets/palette.gadget',0))=NIL THEN Throw("LIB","pall")
IF (spacebase:=OpenLibrary('gadgets/space.gadget',0))=NIL THEN Throw("LIB","spce")
IF (integerbase:=OpenLibrary('gadgets/integer.gadget',0))=NIL THEN Throw("LIB","intr")
IF (scrollerbase:=OpenLibrary('gadgets/scroller.gadget',0))=NIL THEN Throw("LIB","scrl")
IF (checkboxbase:=OpenLibrary('gadgets/checkbox.gadget',0))=NIL THEN Throw("LIB","chkb")
IF (fuelgaugebase:=OpenLibrary('gadgets/fuelgauge.gadget',0))=NIL THEN Throw("LIB","fuel")
IF (getfilebase:=OpenLibrary('gadgets/getfile.gadget',0))=NIL THEN Throw("LIB","file")
IF (getfontbase:=OpenLibrary('gadgets/getfont.gadget',0))=NIL THEN Throw("LIB","font")
IF (getscreenmodebase:=OpenLibrary('gadgets/getscreenmode.gadget',0))=NIL THEN Throw("LIB","scrn")
IF (sliderbase:=OpenLibrary('gadgets/slider.gadget',0))=NIL THEN Throw("LIB","sldr")
IF (glyphbase:=OpenLibrary('images/glyph.image',0))=NIL THEN Throw("LIB","glyp")
IF (labelbase:=OpenLibrary('images/label.image',0))=NIL THEN Throw("LIB","labl")
IF (bevelbase:=OpenLibrary('images/bevel.image',0))=NIL THEN Throw("LIB","bevl")
IF (drawlistbase:=OpenLibrary('images/drawlist.image',0))=NIL THEN Throw("LIB","draw")
IF (penmapbase:=OpenLibrary('images/penmap.image',0))=NIL THEN Throw("LIB","penm")
IF (bitmapbase:=OpenLibrary('images/bitmap.image',0))=NIL THEN Throw("LIB","bitm")
tabsbase:=OpenLibrary('gadgets/tabs.gadget',0)
speedbarbase:=OpenLibrary('gadgets/speedbar.gadget',0)
textfieldbase:=OpenLibrary('gadgets/textfield.gadget',0)
colorwheelbase:=OpenLibrary('gadgets/colorwheel.gadget',0)
datebrowserbase:=OpenLibrary('gadgets/datebrowser.gadget',0)
getcolorbase:=OpenLibrary('gadgets/getcolor.gadget',0)
gradientsliderbase:=OpenLibrary('gadgets/gradientslider.gadget',0)
listviewbase:=OpenLibrary('gadgets/listview.gadget',0)
progressbase:=OpenLibrary('gadgets/progress.gadget',0)
sketchboardbase:=OpenLibrary('gadgets/sketchboard.gadget',0)
statusbarbase:=OpenLibrary('gadgets/statusbar.gadget',0)
tapedeckbase:=OpenLibrary('gadgets/tapedeck.gadget',0)
texteditorbase:=OpenLibrary('gadgets/texteditor.gadget',0)
virtualbase:=OpenLibrary('gadgets/virtual.gadget',0)
boingballbase:=OpenLibrary('images/boingball.image',0)
ledbase:=OpenLibrary('images/led.image',0)
smartbitmapbase:=OpenLibrary('images/smartbitmap.image',0)
titlebarbase:=OpenLibrary('images/titlebar.image',0)
IF (texteditorbase=NIL) AND (textfieldbase=NIL) THEN Throw("LIB","text")
ENDPROC
PROC closeClasses()
IF iconbase THEN CloseLibrary(iconbase)
IF gadtoolsbase THEN CloseLibrary(gadtoolsbase)
IF listbrowserbase THEN CloseLibrary(listbrowserbase)
IF radiobuttonbase THEN CloseLibrary(radiobuttonbase)
IF clicktabbase THEN CloseLibrary(clicktabbase)
IF buttonbase THEN CloseLibrary(buttonbase)
IF layoutbase THEN CloseLibrary(layoutbase)
IF windowbase THEN CloseLibrary(windowbase)
IF requesterbase THEN CloseLibrary(requesterbase)
IF stringbase THEN CloseLibrary(stringbase)
IF chooserbase THEN CloseLibrary(chooserbase)
IF palettebase THEN CloseLibrary(palettebase)
IF spacebase THEN CloseLibrary(spacebase)
IF integerbase THEN CloseLibrary(integerbase)
IF scrollerbase THEN CloseLibrary(scrollerbase)
IF checkboxbase THEN CloseLibrary(checkboxbase)
IF fuelgaugebase THEN CloseLibrary(fuelgaugebase)
IF getfilebase THEN CloseLibrary(getfilebase)
IF getfontbase THEN CloseLibrary(getfontbase)
IF getscreenmodebase THEN CloseLibrary(getscreenmodebase)
IF sliderbase THEN CloseLibrary(sliderbase)
IF speedbarbase THEN CloseLibrary(speedbarbase)
IF glyphbase THEN CloseLibrary(glyphbase)
IF labelbase THEN CloseLibrary(labelbase)
IF bevelbase THEN CloseLibrary(bevelbase)
IF drawlistbase THEN CloseLibrary(drawlistbase)
IF penmapbase THEN CloseLibrary(penmapbase)
IF bitmapbase THEN CloseLibrary(bitmapbase)
IF tabsbase THEN CloseLibrary(tabsbase)
IF colorwheelbase THEN CloseLibrary(colorwheelbase)
IF datebrowserbase THEN CloseLibrary(datebrowserbase)
IF getcolorbase THEN CloseLibrary(getcolorbase)
IF gradientsliderbase THEN CloseLibrary(gradientsliderbase)
IF listviewbase THEN CloseLibrary(listviewbase)
IF progressbase THEN CloseLibrary(progressbase)
IF sketchboardbase THEN CloseLibrary(sketchboardbase)
IF statusbarbase THEN CloseLibrary(statusbarbase)
IF tapedeckbase THEN CloseLibrary(tapedeckbase)
IF textfieldbase THEN CloseLibrary(textfieldbase)
IF texteditorbase THEN CloseLibrary(texteditorbase)
IF virtualbase THEN CloseLibrary(virtualbase)
IF boingballbase THEN CloseLibrary(boingballbase)
IF ledbase THEN CloseLibrary(ledbase)
IF smartbitmapbase THEN CloseLibrary(smartbitmapbase)
IF titlebarbase THEN CloseLibrary(titlebarbase)
ENDPROC
PROC makeComponentList(comp:PTR TO reactionObject,generation,list, selcomp, newnode:PTR TO LONG)
DEF comp2:PTR TO reactionObject
DEF count,n,i
DEF idStr[10]:STRING
DEF typeStr[15]:STRING
StringF(idStr,'\d',comp.id)
StrCopy(typeStr,comp.getTypeName())
IF (n:=AllocListBrowserNodeA(3,
[LBNA_FLAGS, IF (comp.parent=0) OR (comp.allowChildren()) THEN LBFLG_HASCHILDREN OR (IF comp.expanded THEN LBFLG_SHOWCHILDREN ELSE 0) ELSE 0,
LBNA_USERDATA, comp, LBNA_GENERATION, generation,
LBNA_COLUMN,0, LBNCA_COPYTEXT, TRUE, LBNCA_TEXT, IF StrLen(comp.ident) THEN comp.ident ELSE typeStr,
LBNA_COLUMN,1, LBNCA_COPYTEXT, TRUE, LBNCA_TEXT, typeStr,
LBNA_COLUMN,2, LBNCA_COPYTEXT, TRUE, LBNCA_TEXT, idStr,TAG_END])) THEN AddTail(list, n) ELSE Raise("MEM")
comp.node:=n
IF comp=selcomp THEN newnode[]:=n
IF comp.allowChildren()
FOR i:=0 TO comp.children.count()-1
makeComponentList(comp.children.item(i),generation+1,list, selcomp, newnode)
ENDFOR
ENDIF
ENDPROC
PROC removeMembers(comp:PTR TO reactionObject,window:PTR TO windowObject)
DEF i, parent:PTR TO reactionObject
IF comp
IF comp.parent THEN parent:=comp.parent ELSE parent:=window
FOR i:=0 TO comp.children.count()-1
removeMembers(comp.children.item(i),window)
ENDFOR
IF comp.previewObject
IF parent.addChildTag()=parent.removeChildTag()
Sets(parent.addChildTo(),parent.removeChildTag(), 0)
ELSE
Sets(parent.addChildTo(),parent.removeChildTag(), comp.previewObject)
ENDIF
comp.previewObject:=0
comp.previewChildAttrs:=0
ENDIF
ENDIF
ENDPROC
PROC addMembers(comp:PTR TO reactionObject,window:PTR TO windowObject)
DEF i, parent:PTR TO reactionObject
IF comp
IF comp.parent THEN parent:=comp.parent ELSE parent:=window
comp.createPreviewObject(win.wscreen)
IF (comp.isImage())
SetGadgetAttrsA(parent.addChildTo(),0,0,[parent.addImageTag(), comp.previewObject, TAG_END])
ELSE
SetGadgetAttrsA(parent.addChildTo(),0,0,[parent.addChildTag(), comp.previewObject, TAG_END])
ENDIF
IF comp.previewChildAttrs THEN SetGadgetAttrsA(parent.previewObject,0,0,comp.previewChildAttrs)
FOR i:=0 TO comp.children.count()-1
addMembers(comp.children.item(i),window)
ENDFOR
FOR i:=0 TO comp.children.count()-1
comp.children.item(i)::reactionObject.updatePreviewObject()
ENDFOR
ENDIF
ENDPROC
PROC makeList(selcomp=0)
DEF n,i
DEF newnode=0
DEF depth
DEF comp:PTR TO reactionObject
SetGadgetAttrsA(gMain_Gadgets[GAD_COMPONENTLIST],win,0,[LISTBROWSER_LABELS, Not(0), TAG_END])
IF list THEN freeBrowserNodes( list )
list:=browserNodesA([0])
FOR i:=0 TO objectList.count()-1
IF objectList.item(i)=0
SELECT i
CASE ROOT_APPLICATION_ITEM
IF (n:=AllocListBrowserNodeA(3, [LBNA_FLAGS, LBFLG_HASCHILDREN OR LBFLG_SHOWCHILDREN, LBNA_USERDATA, 0, LBNA_GENERATION, 1, LBNA_COLUMN,0, LBNCA_COPYTEXT, TRUE, LBNCA_TEXT, 'Application Begin', LBNA_COLUMN,1, LBNCA_COPYTEXT, TRUE, LBNCA_TEXT, 'System',LBNA_COLUMN,2, LBNCA_COPYTEXT, TRUE, LBNCA_TEXT, 'N/A',TAG_END])) THEN AddTail(list, n) ELSE Raise("MEM")
CASE ROOT_REXX_ITEM
IF (n:=AllocListBrowserNodeA(3, [LBNA_FLAGS, LBFLG_HASCHILDREN OR LBFLG_SHOWCHILDREN, LBNA_USERDATA, 0, LBNA_GENERATION, 2, LBNA_COLUMN,0, LBNCA_COPYTEXT, TRUE, LBNCA_TEXT, 'Rexx', LBNA_COLUMN,1, LBNCA_COPYTEXT, TRUE, LBNCA_TEXT, 'System',LBNA_COLUMN,2, LBNCA_COPYTEXT, TRUE, LBNCA_TEXT, 'N/A',TAG_END])) THEN AddTail(list, n) ELSE Raise("MEM")
CASE ROOT_REQUESTER_ITEM
IF (n:=AllocListBrowserNodeA(3, [LBNA_FLAGS, LBFLG_HASCHILDREN OR LBFLG_SHOWCHILDREN, LBNA_USERDATA, 0, LBNA_GENERATION, 2, LBNA_COLUMN,0, LBNCA_COPYTEXT, TRUE, LBNCA_TEXT, 'Requesters', LBNA_COLUMN,1, LBNCA_COPYTEXT, TRUE, LBNCA_TEXT, 'System',LBNA_COLUMN,2, LBNCA_COPYTEXT, TRUE, LBNCA_TEXT, 'N/A',TAG_END])) THEN AddTail(list, n) ELSE Raise("MEM")
CASE ROOT_SCREEN_ITEM
IF (n:=AllocListBrowserNodeA(3, [LBNA_FLAGS, LBFLG_HASCHILDREN OR LBFLG_SHOWCHILDREN, LBNA_USERDATA, 0, LBNA_GENERATION, 2, LBNA_COLUMN,0, LBNCA_COPYTEXT, TRUE, LBNCA_TEXT, 'Screen', LBNA_COLUMN,1, LBNCA_COPYTEXT, TRUE, LBNCA_TEXT, 'System',LBNA_COLUMN,2, LBNCA_COPYTEXT, TRUE, LBNCA_TEXT, 'N/A',TAG_END])) THEN AddTail(list, n) ELSE Raise("MEM")
CASE ROOT_WINDOW_ITEM
IF (n:=AllocListBrowserNodeA(3, [LBNA_FLAGS, LBFLG_HASCHILDREN OR LBFLG_SHOWCHILDREN, LBNA_USERDATA, 0, LBNA_GENERATION, 3, LBNA_COLUMN,0, LBNCA_COPYTEXT, TRUE, LBNCA_TEXT, 'Window - Main', LBNA_COLUMN,1, LBNCA_COPYTEXT, TRUE, LBNCA_TEXT, 'System',LBNA_COLUMN,2, LBNCA_COPYTEXT, TRUE, LBNCA_TEXT,'N/A',TAG_END])) THEN AddTail(list, n) ELSE Raise("MEM")
CASE ROOT_MENU_ITEM
IF (n:=AllocListBrowserNodeA(3, [LBNA_FLAGS, LBFLG_HASCHILDREN OR LBFLG_SHOWCHILDREN, LBNA_USERDATA, 0, LBNA_GENERATION, 4, LBNA_COLUMN,0, LBNCA_COPYTEXT, TRUE, LBNCA_TEXT, 'Menu', LBNA_COLUMN,1, LBNCA_COPYTEXT, TRUE, LBNCA_TEXT, 'System',LBNA_COLUMN,2, LBNCA_COPYTEXT, TRUE, LBNCA_TEXT, 'N/A',TAG_END])) THEN AddTail(list, n) ELSE Raise("MEM")
ENDSELECT
ELSE
IF i==[ROOT_REXX_ITEM,ROOT_REQUESTER_ITEM, ROOT_SCREEN_ITEM, ROOT_REQUESTER_ITEM]
depth:=2
ELSE
SELECT Mod(i-ROOT_WINDOW_ITEM,3)
CASE 0 ->Window object
depth:=3
CASE 1 -> Menu object
depth:=4
CASE 2 -> Layout object
depth:=4
ENDSELECT
ENDIF
makeComponentList(objectList.item(i),depth,list,selcomp,{newnode})
/* IF i<ROOT_WINDOW_ITEM
SELECT i
CASE ROOT_REXX_ITEM
makeComponentList(objectList.item(i),2,list,selcomp,{newnode})
CASE ROOT_SCREEN_ITEM
->screen
makeComponentList(objectList.item(i),2,list,selcomp,{newnode})
CASE ROOT_WINDOW_ITEM
->window
makeComponentList(objectList.item(i),3,list,selcomp,{newnode})
ENDSELECT
ELSE
makeComponentList(objectList.item(i),4,list,selcomp,{newnode})
ENDIF*/
ENDIF
ENDFOR
IF (n:=AllocListBrowserNodeA(3, [LBNA_USERDATA, 0, LBNA_GENERATION, 1, LBNA_COLUMN,0, LBNCA_COPYTEXT, TRUE, LBNCA_TEXT, 'Application End', LBNA_COLUMN,1, LBNCA_COPYTEXT, TRUE, LBNCA_TEXT, 'System',LBNA_COLUMN,2, LBNCA_COPYTEXT, TRUE, LBNCA_TEXT, 'N/A',TAG_END])) THEN AddTail(list, n) ELSE Raise("MEM")
-> Reattach the list
SetGadgetAttrsA(gMain_Gadgets[GAD_COMPONENTLIST],win,0,[LISTBROWSER_LABELS,list,0])
IF win
IF newnode
SetGadgetAttrsA(gMain_Gadgets[GAD_COMPONENTLIST],win,0,[LISTBROWSER_SELECTEDNODE, newnode,0])
updateSel(newnode)
ELSE
SetGadgetAttrsA(gMain_Gadgets[GAD_COMPONENTLIST],win,0,[LISTBROWSER_SELECTED, -1,0])
updateSel(0)
ENDIF
ENDIF
ENDPROC
PROC menuCode(menu,item,subitem) IS (subitem<<11) OR ((item << 5) OR menu)
PROC menuDisable(win,menu,item,subitem,flag)
IF flag THEN OffMenu(win,menuCode(menu,item,subitem)) ELSE OnMenu(win,menuCode(menu,item,subitem))
ENDPROC
PROC updateSel(node)
DEF comp=0:PTR TO reactionObject
DEF flags
DEF child:PTR TO reactionObject
DEF dis,idx
DEF check,i,j
DEF dismoveup,dismovedown,disdel
DEF disprevgroup,disnextgroup,dismoveinto
DEF menuItem
DEF type
DEF allowchildren=FALSE
menuDisable(win,MENU_EDIT,MENU_EDIT_UNDO,0,undoPos=0)
menuDisable(win,MENU_EDIT,MENU_EDIT_REDO,0,undoPos>=(undoData.count()-1))
IF node THEN GetListBrowserNodeAttrsA(node,[LBNA_USERDATA,{comp},LBNA_FLAGS,{flags},TAG_END])
IF comp
SetGadgetAttrsA(gMain_Gadgets[GAD_EDIT],win,0,[GA_DISABLED,comp=objectList.item(ROOT_REQUESTER_ITEM),TAG_END])
IF flags AND LBFLG_SHOWCHILDREN THEN comp.expanded ELSE comp.expanded:=FALSE
allowchildren:=(comp.allowChildren()=TRUE) ORELSE ((comp.allowChildren()>0) ANDALSO (comp.children.count()<comp.allowChildren()))
selectedComp:=comp
FOR i:=0 TO 31
FOR j:=0 TO 1
IF ((j=0) AND (i<MENU_ADD_GADGET_COUNT) OR (i<MENU_ADD_IMAGE_COUNT))
menuItem:=ItemAddress(win.menustrip,menuCode(MENU_EDIT,IF j=0 THEN MENU_EDIT_ADD_GADGET ELSE MENU_EDIT_ADD_IMAGE,i))
IF menuItem
type:=GTMENUITEM_USERDATA(menuItem)
IF type<>-1
dis:=((comp.parent=0) AND (allowchildren=FALSE)) OR (comp.type=TYPE_WINDOW) OR
(type==[TYPE_STATUSBAR, TYPE_PAGE, TYPE_PROGRESS, TYPE_TEXTENTRY, TYPE_SMARTBITMAP, TYPE_TITLEBAR])
menuDisable(win,MENU_EDIT,IF j=0 THEN MENU_EDIT_ADD_GADGET ELSE MENU_EDIT_ADD_IMAGE,i,dis)
ENDIF
ENDIF
ENDIF
ENDFOR
ENDFOR
IF comp.parent=0
IF comp.type=TYPE_WINDOW
idx:=findWindowIndex(comp)
dismoveup:=idx=0
dismovedown:=idx=(((objectList.count()-ROOT_WINDOW_ITEM)/3)-1)
disdel:=(objectList.count()=(ROOT_WINDOW_ITEM+3))
dismoveinto:=TRUE
ELSE
dismoveup:=TRUE
dismovedown:=TRUE
disdel:=TRUE
dismoveinto:=TRUE
ENDIF
disprevgroup:=TRUE
disnextgroup:=TRUE
ELSE
dismoveup:=comp.getChildIndex()=0
dismovedown:=comp.getChildIndex()=(comp.parent.children.count()-1)
disdel:=(comp.parent=0)
dismoveinto:=FALSE
IF comp.parent.parent=0
disprevgroup:=TRUE
disnextgroup:=TRUE
ELSE
disprevgroup:=TRUE
FOR i:=0 TO comp.parent.getChildIndex()-1
child:=comp.parent.parent.children.item(i)
IF child.type=TYPE_LAYOUT THEN disprevgroup:=FALSE
ENDFOR
disnextgroup:=TRUE
FOR i:=comp.parent.getChildIndex()+1 TO comp.parent.parent.children.count()-1
child:=comp.parent.parent.children.item(i)
IF child.type=TYPE_LAYOUT THEN disnextgroup:=FALSE
ENDFOR
ENDIF
ENDIF
dis:=(comp.parent=0) AND (allowchildren=FALSE) OR (comp.type=TYPE_WINDOW)
menuDisable(win,MENU_EDIT,MENU_EDIT_EDIT,0,FALSE)
menuDisable(win,MENU_EDIT,MENU_EDIT_ADD_VLAYOUT,0,dis)
menuDisable(win,MENU_EDIT,MENU_EDIT_ADD_HLAYOUT,0,dis)
menuDisable(win,MENU_EDIT,MENU_EDIT_DELETE,0,disdel)
menuDisable(win,MENU_EDIT,MENU_EDIT_MOVE,MENU_EDIT_MOVEUP,dismoveup)
menuDisable(win,MENU_EDIT,MENU_EDIT_MOVE,MENU_EDIT_MOVEDOWN,dismovedown)
menuDisable(win,MENU_EDIT,MENU_EDIT_MOVE,MENU_EDIT_MOVETOP,dismoveup)
menuDisable(win,MENU_EDIT,MENU_EDIT_MOVE,MENU_EDIT_MOVEBOTTOM,dismovedown)
menuDisable(win,MENU_EDIT,MENU_EDIT_MOVE,MENU_EDIT_MOVELPREV,disprevgroup)
menuDisable(win,MENU_EDIT,MENU_EDIT_MOVE,MENU_EDIT_MOVELNEXT,disnextgroup)
menuDisable(win,MENU_EDIT,MENU_EDIT_MOVE,MENU_EDIT_MOVEINTOLAYOUT_VERT,dismoveinto)
menuDisable(win,MENU_EDIT,MENU_EDIT_MOVE,MENU_EDIT_MOVEINTOLAYOUT_HORIZ,dismoveinto)
dis:=(comp.parent=0) AND (allowchildren=FALSE) AND (comp.type<>TYPE_SCREEN) AND (comp.type<>TYPE_WINDOW)
SetGadgetAttrsA(gMain_Gadgets[GAD_ADD],win,0,[GA_DISABLED,dis,TAG_END])
SetGadgetAttrsA(gMain_Gadgets[GAD_GENMINUS],win,0,[GA_DISABLED,Not((comp.parent<>0) ANDALSO (comp.parent.parent<>0)),TAG_END])
IF bufferLayout
SetGadgetAttrsA(gMain_Gadgets[GAD_TEMP_COPYTO],win,0,[GA_DISABLED,(comp.parent=0) AND (comp.type<>TYPE_LAYOUT),TAG_END])
SetGadgetAttrsA(gMain_Gadgets[GAD_TEMP_MOVETO],win,0,[GA_DISABLED,comp.parent=0,TAG_END])
ENDIF
dis:=TRUE
IF comp.parent
idx:=comp.getChildIndex()
IF (idx<(comp.parent.children.count()-1))
child:=comp.parent.children.item(idx+1)
IF (child.allowChildren())
dis:=FALSE
ENDIF
ENDIF
ENDIF
SetGadgetAttrsA(gMain_Gadgets[GAD_GENPLUS],win,0,[GA_DISABLED,dis,TAG_END])
SetGadgetAttrsA(gMain_Gadgets[GAD_DELETE],win,0,[GA_DISABLED,disdel,TAG_END])
SetGadgetAttrsA(gMain_Gadgets[GAD_MOVEUP],win,0,[GA_DISABLED,dismoveup,TAG_END])
SetGadgetAttrsA(gMain_Gadgets[GAD_MOVEDOWN],win,0,[GA_DISABLED,dismovedown,TAG_END])
IF bufferLayout
dis:=(selectedBuffComp=0) OR (allowchildren=FALSE) OR (comp.type==[TYPE_SCREEN,TYPE_WINDOW,TYPE_MENU,TYPE_REXX])
SetGadgetAttrsA(gMain_Gadgets[GAD_TEMP_COPYFROM],win,0,[GA_DISABLED,dis,TAG_END])
SetGadgetAttrsA(gMain_Gadgets[GAD_TEMP_MOVEFROM],win,0,[GA_DISABLED,dis,TAG_END])
ENDIF
ELSE
selectedComp:=0
FOR i:=0 TO 31
FOR j:=0 TO 1
IF ((j=0) AND (i<MENU_ADD_GADGET_COUNT) OR (i<MENU_ADD_IMAGE_COUNT))
menuItem:=ItemAddress(win.menustrip,menuCode(MENU_EDIT,IF j=0 THEN MENU_EDIT_ADD_GADGET ELSE MENU_EDIT_ADD_IMAGE,i))
IF menuItem
type:=GTMENUITEM_USERDATA(menuItem)
IF type<>-1 THEN menuDisable(win,MENU_EDIT,IF j=0 THEN MENU_EDIT_ADD_GADGET ELSE MENU_EDIT_ADD_IMAGE,i,TRUE)
ENDIF
ENDIF
ENDFOR
ENDFOR
menuDisable(win,MENU_EDIT,MENU_EDIT_EDIT,0,TRUE)
menuDisable(win,MENU_EDIT,MENU_EDIT_DELETE,0,TRUE)
menuDisable(win,MENU_EDIT,MENU_EDIT_MOVE,MENU_EDIT_MOVEUP,TRUE)
menuDisable(win,MENU_EDIT,MENU_EDIT_MOVE,MENU_EDIT_MOVEDOWN,TRUE)
menuDisable(win,MENU_EDIT,MENU_EDIT_ADD_VLAYOUT,0,TRUE)
menuDisable(win,MENU_EDIT,MENU_EDIT_ADD_HLAYOUT,0,TRUE)
menuDisable(win,MENU_EDIT,MENU_EDIT_MOVE,MENU_EDIT_MOVETOP,TRUE)
menuDisable(win,MENU_EDIT,MENU_EDIT_MOVE,MENU_EDIT_MOVEBOTTOM,TRUE)
menuDisable(win,MENU_EDIT,MENU_EDIT_MOVE,MENU_EDIT_MOVELPREV,TRUE)
menuDisable(win,MENU_EDIT,MENU_EDIT_MOVE,MENU_EDIT_MOVELNEXT,TRUE)
menuDisable(win,MENU_EDIT,MENU_EDIT_MOVE,MENU_EDIT_MOVEINTOLAYOUT_VERT,TRUE)
menuDisable(win,MENU_EDIT,MENU_EDIT_MOVE,MENU_EDIT_MOVEINTOLAYOUT_HORIZ,TRUE)
menuDisable(win,MENU_PROJECT,MENU_PROJECT_REOPEN,0,recentFiles.count()=0)
SetGadgetAttrsA(gMain_Gadgets[GAD_ADD],win,0,[GA_DISABLED,TRUE,TAG_END])
SetGadgetAttrsA(gMain_Gadgets[GAD_EDIT],win,0,[GA_DISABLED,TRUE,TAG_END])
SetGadgetAttrsA(gMain_Gadgets[GAD_GENMINUS],win,0,[GA_DISABLED,TRUE,TAG_END])
SetGadgetAttrsA(gMain_Gadgets[GAD_GENPLUS],win,0,[GA_DISABLED,TRUE,TAG_END])
SetGadgetAttrsA(gMain_Gadgets[GAD_DELETE],win,0,[GA_DISABLED,TRUE,TAG_END])
SetGadgetAttrsA(gMain_Gadgets[GAD_MOVEUP],win,0,[GA_DISABLED,TRUE,TAG_END])
SetGadgetAttrsA(gMain_Gadgets[GAD_MOVEDOWN],win,0,[GA_DISABLED,TRUE,TAG_END])
IF bufferLayout
SetGadgetAttrsA(gMain_Gadgets[GAD_TEMP_COPYTO],win,0,[GA_DISABLED,TRUE,TAG_END])
SetGadgetAttrsA(gMain_Gadgets[GAD_TEMP_MOVETO],win,0,[GA_DISABLED,TRUE,TAG_END])
SetGadgetAttrsA(gMain_Gadgets[GAD_TEMP_COPYFROM],win,0,[GA_DISABLED,TRUE,TAG_END])
SetGadgetAttrsA(gMain_Gadgets[GAD_TEMP_MOVEFROM],win,0,[GA_DISABLED,TRUE,TAG_END])
ENDIF
ENDIF
ENDPROC
PROC updateBufferSel(win,node)
DEF comp=0:PTR TO reactionObject
DEF dis
IF bufferLayout
IF node THEN GetListBrowserNodeAttrsA(node,[LBNA_USERDATA,{comp},TAG_END])
IF comp AND selectedComp
dis:=(selectedComp.parent=0) AND (selectedComp.allowChildren()=FALSE) AND (selectedComp.type<>TYPE_SCREEN) AND (selectedComp.type<>TYPE_WINDOW)
SetGadgetAttrsA(gMain_Gadgets[GAD_TEMP_COPYFROM],win,0,[GA_DISABLED,dis,TAG_END])
SetGadgetAttrsA(gMain_Gadgets[GAD_TEMP_MOVEFROM],win,0,[GA_DISABLED,dis,TAG_END])
SetGadgetAttrsA(gMain_Gadgets[GAD_TEMP_REMOVE],win,0,[GA_DISABLED,dis,TAG_END])
ELSE
SetGadgetAttrsA(gMain_Gadgets[GAD_TEMP_COPYFROM],win,0,[GA_DISABLED,TRUE,TAG_END])
SetGadgetAttrsA(gMain_Gadgets[GAD_TEMP_MOVEFROM],win,0,[GA_DISABLED,TRUE,TAG_END])
SetGadgetAttrsA(gMain_Gadgets[GAD_TEMP_REMOVE],win,0,[GA_DISABLED,TRUE,TAG_END])
ENDIF
selectedBuffComp:=comp
ELSE
selectedBuffComp:=0
ENDIF
ENDPROC
PROC createBufferGads()
bufferLayout:=LayoutObject,
LAYOUT_ORIENTATION, LAYOUT_ORIENT_VERT,
LAYOUT_ADDCHILD, gMain_Gadgets[GAD_TEMPLIST]:=ListBrowserObject,
GA_ID, GAD_TEMPLIST,
GA_RELVERIFY, TRUE,
LISTBROWSER_POSITION, 0,
LISTBROWSER_SHOWSELECTED, TRUE,
LISTBROWSER_VERTSEPARATORS, TRUE,
LISTBROWSER_SEPARATORS, TRUE,
LISTBROWSER_COLUMNTITLES, TRUE,
LISTBROWSER_COLUMNINFO, columninfo2,
LISTBROWSER_VERTICALPROP, TRUE,
LISTBROWSER_HIERARCHICAL, FALSE,
LISTBROWSER_LABELS, list2,
ListBrowserEnd,
CHILD_WEIGHTEDWIDTH,20,
LAYOUT_ADDCHILD, gMain_Gadgets[GAD_TEMP_COPYTO]:=ButtonObject,
GA_ID, GAD_TEMP_COPYTO,
GA_TEXT, '=>Copy',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,
CHILD_WEIGHTEDHEIGHT,0,
LAYOUT_ADDCHILD, gMain_Gadgets[GAD_TEMP_COPYFROM]:=ButtonObject,
GA_ID, GAD_TEMP_COPYFROM,
GA_TEXT, '<=Copy',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,
CHILD_WEIGHTEDHEIGHT,0,
LAYOUT_ADDCHILD, gMain_Gadgets[GAD_TEMP_MOVETO]:=ButtonObject,
GA_ID, GAD_TEMP_MOVETO,
GA_TEXT, 'Move=>',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,
CHILD_WEIGHTEDHEIGHT,0,
LAYOUT_ADDCHILD, gMain_Gadgets[GAD_TEMP_MOVEFROM]:=ButtonObject,
GA_ID, GAD_TEMP_MOVEFROM,
GA_TEXT, '<=Move',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,
CHILD_WEIGHTEDHEIGHT,0,
LAYOUT_ADDCHILD, gMain_Gadgets[GAD_TEMP_REMOVE]:=ButtonObject,
GA_ID, GAD_TEMP_REMOVE,
GA_TEXT, 'Remove',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,
CHILD_WEIGHTEDHEIGHT,0,
LayoutEnd
ENDPROC
PROC loadIconPrefs()
DEF wb:PTR TO wbstartup, args:PTR TO wbarg
DEF dobj:PTR TO diskobject
DEF s
DEF tempbuf[256]:ARRAY OF CHAR
DEF olddir
IF wbmessage=NIL
StrCopy(startupfilename,arg)
StrCopy(iconFileName,'PROGDIR:Rebuild')
dobj:=GetDiskObject(iconFileName)
ELSE
wb:=wbmessage
args:=wb.arglist
IF wb.numargs>1
NameFromLock(args[1].lock,tempbuf,255)
AddPart(tempbuf,args[1].name,255)
StrCopy(startupfilename,tempbuf)
ENDIF
olddir:=CurrentDir(args[].lock)
StrCopy(iconFileName,args[].name)
dobj:=GetDiskObject(iconFileName)
ENDIF
IF dobj
IF(s:=FindToolType(dobj.tooltypes,'LANG'))
IF (MatchToolValue(s,'C')) THEN codeOptions.langid:=LANG_C ELSE codeOptions.langid:=LANG_E
ENDIF
IF(s:=FindToolType(dobj.tooltypes,'USEIDS'))
IF (MatchToolValue(s,'NO')) OR (MatchToolValue(s,'FALSE')) THEN codeOptions.useids:=FALSE ELSE codeOptions.useids:=TRUE
ENDIF
IF(s:=FindToolType(dobj.tooltypes,'FULLCODE'))
IF (MatchToolValue(s,'NO')) OR (MatchToolValue(s,'FALSE')) THEN codeOptions.fullcode:=FALSE ELSE codeOptions.fullcode:=TRUE
ENDIF
IF(s:=FindToolType(dobj.tooltypes,'CODEPATH'))
AstrCopy(codeOptions.savePath,s,256)
ENDIF
IF(s:=FindToolType(dobj.tooltypes,'USEMACROS'))
IF (MatchToolValue(s,'NO')) OR (MatchToolValue(s,'FALSE')) THEN codeOptions.usemacros:=FALSE ELSE codeOptions.usemacros:=TRUE
ENDIF
IF(s:=FindToolType(dobj.tooltypes,'SHOWBUFFER'))
IF (MatchToolValue(s,'NO')) OR (MatchToolValue(s,'FALSE')) THEN systemOptions.showBuffer:=FALSE ELSE systemOptions.showBuffer:=TRUE
ENDIF
IF(s:=FindToolType(dobj.tooltypes,'SHOWSETTINGS'))
IF (MatchToolValue(s,'NO')) OR (MatchToolValue(s,'FALSE')) THEN systemOptions.showSettingsOnAdd:=FALSE ELSE systemOptions.showSettingsOnAdd:=TRUE
ENDIF
IF(s:=FindToolType(dobj.tooltypes,'WARNONDELETE'))
IF (MatchToolValue(s,'NO')) OR (MatchToolValue(s,'FALSE')) THEN systemOptions.warnOnDelete:=FALSE ELSE systemOptions.warnOnDelete:=TRUE
ENDIF
IF(s:=FindToolType(dobj.tooltypes,'PROJECTICONS'))
IF (MatchToolValue(s,'NO')) OR (MatchToolValue(s,'FALSE')) THEN systemOptions.saveProjectIcons:=FALSE ELSE systemOptions.saveProjectIcons:=TRUE
ENDIF
IF(s:=FindToolType(dobj.tooltypes,'PREVIEWCODE'))
IF (MatchToolValue(s,'NO')) OR (MatchToolValue(s,'FALSE')) THEN systemOptions.previewCode:=FALSE ELSE systemOptions.previewCode:=TRUE
ENDIF
IF(s:=FindToolType(dobj.tooltypes,'SAVEPATH'))
AstrCopy(systemOptions.savePath,s,256)
ENDIF
IF(s:=FindToolType(dobj.tooltypes,'WINDOWLEFT'))
systemOptions.windowLeft:=Val(s)
ENDIF
IF(s:=FindToolType(dobj.tooltypes,'WINDOWTOP'))
systemOptions.windowTop:=Val(s)
ENDIF
IF(s:=FindToolType(dobj.tooltypes,'WINDOWWIDTH'))
systemOptions.windowWidth:=Val(s)
ENDIF
IF(s:=FindToolType(dobj.tooltypes,'WINDOWHEIGHT'))
systemOptions.windowHeight:=Val(s)
ENDIF
IF(s:=FindToolType(dobj.tooltypes,'CODEWINDOWLEFT'))
systemOptions.codePreviewLeft:=Val(s)
ENDIF
IF(s:=FindToolType(dobj.tooltypes,'CODEWINDOWTOP'))
systemOptions.codePreviewTop:=Val(s)
ENDIF
IF(s:=FindToolType(dobj.tooltypes,'CODEWINDOWWIDTH'))
systemOptions.codePreviewWidth:=Val(s)
ENDIF
IF(s:=FindToolType(dobj.tooltypes,'CODEWINDOWHEIGHT'))
systemOptions.codePreviewHeight:=Val(s)
ENDIF
FreeDiskObject(dobj)
ENDIF
ENDPROC
PROC createForm()
appPort:=CreateMsgPort()
list:=browserNodesA([0])
list2:=browserNodesA([0])
columninfo[0].width:=8
columninfo[0].title:='Name'
columninfo[0].flags:=CIF_WEIGHTED
columninfo[1].width:=3
columninfo[1].title:='Type'
columninfo[1].flags:=CIF_WEIGHTED
columninfo[2].width:=2
columninfo[2].title:='ID'
columninfo[2].flags:=CIF_WEIGHTED
columninfo[3].width:=-1
columninfo[3].title:=-1
columninfo[3].flags:=-1
columninfo2[0].width:=1
columninfo2[0].title:='Buffer'
columninfo2[0].flags:=CIF_WEIGHTED
columninfo2[1].width:=-1
columninfo2[1].title:=-1
columninfo2[1].flags:=-1
remakePreviewMenus()
StringF(windowTitle,'ReBuild - Reaction UI Builder (\s)',vernum)
mainWindow:=WindowObject,
WA_TITLE, windowTitle,
WA_LEFT, IF systemOptions.windowLeft=-1 THEN 100 ELSE systemOptions.windowLeft,
WA_TOP, IF systemOptions.windowTop=-1 THEN 100 ELSE systemOptions.windowTop,
WA_HEIGHT, IF systemOptions.windowHeight=-1 THEN 280 ELSE systemOptions.windowHeight,
WA_WIDTH, IF systemOptions.windowWidth=-1 THEN 150 ELSE systemOptions.windowWidth,
WA_MINWIDTH, 150,
WA_MAXWIDTH, 8192,
WA_MINHEIGHT, 80,
WA_MAXHEIGHT, 8192,
WA_PUBSCREEN, 0,
WA_ACTIVATE, TRUE,
IF (systemOptions.windowLeft=-1) AND (systemOptions.windowTop=-1) THEN WINDOW_POSITION ELSE TAG_IGNORE, WPOS_CENTERSCREEN,
->WA_CustomScreen, gScreen,
WINDOW_ICONTITLE, 'Rebuild',
WINDOW_APPPORT, appPort,
WINDOW_APPWINDOW, TRUE,
WINDOW_ICONIFYGADGET, TRUE,
WINDOW_ICON, GetDiskObject(iconFileName),
WA_CLOSEGADGET, TRUE,
WA_DEPTHGADGET, TRUE,
WA_SIZEGADGET, TRUE,
WA_DRAGBAR, TRUE,
->WA_NOCAREREFRESH, TRUE,
WA_IDCMP,IDCMP_GADGETDOWN OR IDCMP_GADGETUP OR IDCMP_CLOSEWINDOW OR IDCMP_MENUPICK OR IDCMP_NEWSIZE,
WINDOW_PARENTGROUP, VLayoutObject,
LAYOUT_DEFERLAYOUT, TRUE,
LAYOUT_SPACEOUTER, TRUE,
LAYOUT_ADDCHILD, mainWindowLayout:=LayoutObject,
LAYOUT_ADDCHILD, gMain_Gadgets[GAD_COMPONENTLIST]:=ListBrowserObject,
GA_ID, GAD_COMPONENTLIST,
GA_RELVERIFY, TRUE,
LISTBROWSER_POSITION, 0,
LISTBROWSER_SHOWSELECTED, TRUE,
LISTBROWSER_COLUMNTITLES, TRUE,
LISTBROWSER_COLUMNINFO, columninfo,
LISTBROWSER_VERTICALPROP, TRUE,
LISTBROWSER_HIERARCHICAL, TRUE,
LISTBROWSER_LABELS, list,
ListBrowserEnd,
LayoutEnd,
LAYOUT_ADDCHILD, LayoutObject,
LAYOUT_ADDCHILD, gMain_Gadgets[GAD_ADD]:=ButtonObject,
GA_ID, GAD_ADD,
GA_TEXT, '_Add',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,
LAYOUT_ADDCHILD, gMain_Gadgets[GAD_EDIT]:=ButtonObject,
GA_ID, GAD_EDIT,
GA_TEXT, '_Edit',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,
LAYOUT_ADDCHILD, gMain_Gadgets[GAD_GENMINUS]:=ButtonObject,
GA_ID, GAD_GENMINUS,
GA_TEXT, 'Gen _-',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,
LAYOUT_ADDCHILD, gMain_Gadgets[GAD_GENPLUS]:=ButtonObject,
GA_ID, GAD_GENPLUS,
GA_TEXT, 'Gen _+',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,
LAYOUT_ADDCHILD, gMain_Gadgets[GAD_DELETE]:=ButtonObject,
GA_ID, GAD_DELETE,
GA_TEXT, '_Delete',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,
LAYOUT_ADDCHILD, gMain_Gadgets[GAD_MOVEUP]:=ButtonObject,
GA_ID, GAD_MOVEUP,
GA_TEXT, '_Up',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,
LAYOUT_ADDCHILD, gMain_Gadgets[GAD_MOVEDOWN]:=ButtonObject,
GA_ID, GAD_MOVEDOWN,
GA_TEXT, 'Do_wn',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,
LAYOUT_ADDCHILD, gMain_Gadgets[GAD_LISTS]:=ButtonObject,
GA_ID, GAD_LISTS,
GA_TEXT, 'L_ists',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,
LAYOUT_ADDCHILD, gMain_Gadgets[GAD_CODE]:=ButtonObject,
GA_ID, GAD_CODE,
GA_TEXT, '_Code',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,
LAYOUT_ADDCHILD, gMain_Gadgets[GAD_LOAD]:=ButtonObject,
GA_ID, GAD_LOAD,
GA_TEXT, '_Open',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,
LAYOUT_ADDCHILD, gMain_Gadgets[GAD_SAVE]:=ButtonObject,
GA_ID, GAD_SAVE,
GA_TEXT, '_Save',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,
LAYOUT_ADDCHILD, gMain_Gadgets[GAD_NEW]:=ButtonObject,
GA_ID, GAD_NEW,
GA_TEXT, '_New',
GA_RELVERIFY, TRUE,
GA_TABCYCLE, TRUE,
ButtonEnd,
LayoutEnd,
CHILD_WEIGHTEDHEIGHT, 0,
LayoutEnd,
WindowEnd
toggleBuffer()
ENDPROC
PROC addObject(parent:PTR TO reactionObject,newobj:PTR TO reactionObject, index=-1)
DEF idx, mainRootLayout
DEF window
IF parent.allowChildren()
idx:=findWindowIndex(parent)
mainRootLayout:=objectList.item(ROOT_LAYOUT_ITEM+(idx*3))
window:=objectList.item(ROOT_WINDOW_ITEM+(idx*3))
removeMembers(mainRootLayout,window)
IF index<>-1
parent.addChildAt(newobj,index)
ELSE
parent.addChild(newobj)
ENDIF
makeList(newobj)
addMembers(mainRootLayout,window)
rethinkPreviews()
ENDIF
ENDPROC
PROC removeObject(child:PTR TO reactionObject)
DEF i,idx, mainRootLayout
DEF comp2:PTR TO reactionObject
DEF window,parent:PTR TO reactionObject
parent:=child.parent
IF parent.allowChildren()
idx:=findWindowIndex(child)
mainRootLayout:=objectList.item(ROOT_LAYOUT_ITEM+(idx*3))
window:=objectList.item(ROOT_WINDOW_ITEM+(idx*3))
removeMembers(mainRootLayout,window)
idx:=child.getChildIndex()
parent.removeChild(child)
END child
makeList()
addMembers(mainRootLayout,window)
rethinkPreviews()
IF (idx<parent.children.count())
comp2:=parent.children.item(idx)
ELSE
comp2:=parent
ENDIF
SetGadgetAttrsA(gMain_Gadgets[GAD_COMPONENTLIST],win,0,[LISTBROWSER_SELECTEDNODE, comp2.node, TAG_END])
updateSel(comp2.node)
ENDIF
ENDPROC
PROC removeWindow(win:PTR TO reactionObject)
DEF idx,comp:PTR TO reactionObject
idx:=findWindowIndex(win)
idx:=(idx*3)
removeMembers(objectList.item(idx+ROOT_LAYOUT_ITEM),objectList.item(idx+ROOT_WINDOW_ITEM))
comp:=objectList.item(idx+ROOT_WINDOW_ITEM)