forgotten commit. disabled until egl is adapted.
[AROS-Contrib.git] / bgui / RexxBGUI / list.rexx
blob809627194d902f8ee61ca63bb3833b5855e30b34
1 /* REXX script for rexxbgui.library: List example */
3 if ~show('l','rexxbgui.library') then do
4 if ~addlib('rexxbgui.library',0,-30) then do
5 exit(20)
6 end
7 else nop
8 end
9 else nop
11 call bguiopen() /* causes error 12 if it did not work */
12 /* supply a second argument for a '0' return code instead of an ARexx
13 error */
15 signal on syntax /* important: bguiclose() MUST be called */
16 signal on halt
17 signal on break_c
19 esc='1B'x
20 lf='0A'x
21 cr='0D'x
22 grspace.narrow=-1
23 grspace.normal=-2
24 grspace.wide=-3
26 lst.count=20
27 do i=0 for lst.count
28 lst.i='Entry' i+1
29 end
31 /* using ARexx feature: ,<newline> is translated to nothing */
32 /* the || are essential - any added space will cause trouble */
33 /* redefining the same ID makes previous buttons unaccessible */
34 /* do not redefine winclose etc. */
36 g=bguivgroup(,
37 bguiinfo(,
38 'info',,'\ec\ebARexx\e-b conversion of \ebList\e-b example',
39 )||bguilayout(LGO_FixMinHeight,1)||,
40 bguihgroup(,
41 bguivgroup(,
42 bguilistview('sslistv',,'LST','D'),
43 ,,'F','Single-select')||,
44 bguivgroup(,
45 bguilistview('mslistv',,'LST','D'),
46 ,,'F','Multi-select'),
47 )||,
48 bguihgroup(,
49 bguivarspace(50)||,
50 bguibutton('quit','_Quit')||,
51 bguivarspace(50),
52 )||bguilayout(LGO_FixMinHeight,1),
53 ,grspace.normal,grspace.normal)
55 call bguiset(obj.mslistv,,LISTV_MultiSelect,1)
57 a=bguiwindow('Listview DragNDrop',g,50,30,,arg(1))
59 if bguiwinopen(a)=0 then bguierror(12)
60 id=0
61 do while bguiwinwaitevent(a,'ID')~=id.winclose
62 select
63 when id=id.winactive then nop
64 when id=id.wininactive then nop
65 when id=id.quit then leave
66 when id=id.winclose then nop
67 otherwise nop
68 end
69 end
70 rc=0
72 syntax:
73 if rc~=0 then say '+++ ['rc']' errortext(rc) 'at line' sigl
74 call bguiclose()
75 exit 0
77 break_c:
78 halt:
79 rc=0
80 say '+++ Break at line' sigl
81 signal syntax