disable NOP on AROS.
[AROS-Contrib.git] / bgui / RexxBGUI / mclist.rexx
blob4f95685aa44567f45d03c2346cd31b782104c484
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 tab='09'x
23 grspace.narrow=-1
24 grspace.normal=-2
25 grspace.wide=-3
27 lst.count=27
28 lst.0='80%'tab'20%'
29 do i=1 for lst.count
30 lst.i='Entry' i||tab||d2c(i+64)
31 end
33 /* using ARexx feature: ,<newline> is translated to nothing */
34 /* the || are essential - any added space will cause trouble */
35 /* redefining the same ID makes previous buttons unaccessible */
36 /* do not redefine winclose etc. */
38 g=bguivgroup(,
39 bguiinfo(,
40 'info',,'\ec\ebRexxBGUI\e-b: multi-column listviews',
41 )||bguilayout(LGO_FixMinHeight,1)||,
42 bguihgroup(,
43 bguivgroup(,
44 bguilistview('sslistv',,'LST','D',2 80 20)||setlsttoms(),
45 ,,'F','Single-select')||,
46 bguivgroup(,
47 bguilistview('mslistv',,'LST','D',2 90 10),
48 ,,'F','Multi-select'),
49 )||,
50 bguihgroup(,
51 bguivarspace(50)||,
52 bguibutton('quit','_Quit')||,
53 bguivarspace(50),
54 )||bguilayout(LGO_FixMinHeight,1),
55 ,grspace.normal,grspace.normal)
57 call bguiset(obj.mslistv,,LISTV_MultiSelect,1)
59 a=bguiwindow('Listview DragNDrop',g,50,30,,arg(1))
61 if bguiwinopen(a)=0 then bguierror(12)
62 id=0
63 do while bguiwinwaitevent(a,'ID')~=id.winclose
64 select
65 when id=id.winactive then nop
66 when id=id.wininactive then nop
67 when id=id.quit then leave
68 when id=id.winclose then nop
69 otherwise nop
70 end
71 end
72 rc=0
74 syntax:
75 if rc~=0 then say '+++ ['rc']' errortext(rc) 'at line' sigl
76 call bguiclose()
77 exit 0
79 break_c:
80 halt:
81 rc=0
82 say '+++ Break at line' sigl
83 signal syntax
85 setlsttoms:
86 lst.0='90%'tab'10%'
87 return ''