disable NOP on AROS.
[AROS-Contrib.git] / bgui / RexxBGUI / testpages.rexx
blob7e81567ab6fbb7ac521f0b7845d0877e26866a54
1 /* REXX script for rexxbgui.library: switch pages with tabs */
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 bguimx('switcher',,bguilist('pnames','Single-Select','Multi-Select'),'T')||bguilayout(LGO_FixMinHeight,1)||,
41 bguipages('pages',,
42 bguivgroup(,
43 bguiinfo('infss',,'\ecSingle-Select Drag-n-Drop'lf'Listview object.')||bguilayout(LGO_FixMinHeight,1)||,
44 bguilistview('sslistv',,'LST','D'),
45 )||,
46 bguivgroup(,
47 bguiinfo('infss',,'\ecMulti-Select Drag-n-Drop'lf'Listview object.')||bguilayout(LGO_FixMinHeight,1)||,
48 bguilistview('mslistv',,'LST','D'),
50 )||,
51 bguihgroup(,
52 bguivarspace(50)||,
53 bguibutton('quit','_Quit')||,
54 bguivarspace(50),
55 )||bguilayout(LGO_FixMinHeight,1),
56 ,grspace.normal,grspace.normal)
58 drop pnames.
60 call bguiset(obj.mslistv,,LISTV_MultiSelect,1)
61 call bguiaddmap(obj.switcher,obj.pages,MX_Active,PAGE_Active)
63 a=bguiwindow('Listview DragNDrop',g,30,30,,arg(1))
65 call bguiset(obj.switcher,,BT_Key,'09'x)
67 if bguiwinopen(a)=0 then bguierror(12)
69 id=0
70 do while bguiwinwaitevent(a,'ID')~=id.winclose
71 select
72 when id=id.winactive then nop
73 when id=id.wininactive then nop
74 when id=id.quit then leave
75 when id=id.winclose then nop
76 otherwise nop
77 end
78 end
79 rc=0
81 syntax:
82 if rc~=0 then say '+++ ['rc']' errortext(rc) 'at line' sigl
83 call bguiclose()
84 exit 0
86 break_c:
87 halt:
88 rc=0
89 say '+++ Break at line' sigl
90 signal syntax