disable NOP on AROS.
[AROS-Contrib.git] / bgui / RexxBGUI / conditional.rexx
blobf2df948477402cb9fa8135145249948d6af764ef
1 /* REXX script for rexxbgui.library: conditional notification */
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
25 FixMinSize=bguilayout(LGO_FixMinWidth,1,LGO_FixMinHeight,1)
27 /* using ARexx feature: ,<newline> is translated to nothing */
28 /* the || are essential - any added space will cause trouble */
29 /* redefining the same ID makes previous buttons unaccessible */
30 /* do not redefine winclose etc. */
32 g=bguivgroup(,
33 bguiinfo(,
34 'info',,'\ec\ebRexxBGUI\e-b: conditional notification',
35 )||bguilayout(LGO_FixMinHeight,1)||,
36 bguihgroup(,
37 bguivarspace(50)||,
38 bguivgroup(,
39 bguicheckbox('dismx','_Disable MX object',0)FixMinSize||,
40 bguicheckbox('disi2','D_isable "\eiItem 2\e-i"',0)FixMinSize,
41 )||,
42 bguivarspace(50),
43 )||bguilayout(LGO_FixMinHeight,1)||,
44 bguihgroup(,
45 bguivarspace(50)||,
46 bguimx('mx','_MX object',bguilist('it','Item 1','Item 2'),'R')FixMinSize||,
47 bguivarspace(50),
48 )||bguilayout(LGO_FixMinHeight,1)||,
49 bguihgroup(,
50 bguivarspace(50)||,
51 bguibutton('quit','_Quit')||,
52 bguivarspace(50),
53 )||bguilayout(LGO_FixMinHeight,1),
54 ,grspace.normal,grspace.normal)
56 drop it.
58 call bguiaddmap(obj.dismx,obj.mx,GA_Selected,GA_Disabled)
59 call bguiaddmap(obj.dismx,obj.disi2,GA_Selected,GA_Disabled)
60 call bguiaddcondit(obj.dismx,obj.disi2,GA_Selected,0,GA_Selected,0,TAG_IGNORE,0)
61 call bguiaddcondit(obj.disi2,obj.mx,GA_Selected,0,MX_EnableButton,1,MX_DisableButton,1)
62 call bguiaddcondit(obj.disi2,obj.mx,GA_Selected,0,TAG_IGNORE,0,MX_Active,0)
64 a=bguiwindow('Conditional',g,'-','-',,arg(1),'mouse')
66 if bguiwinopen(a)=0 then bguierror(12)
67 id=0
68 do while bguiwinwaitevent(a,'ID')~=id.winclose
69 select
70 when id=id.winactive then nop
71 when id=id.wininactive then nop
72 when id=id.quit then leave
73 when id=id.winclose then nop
74 otherwise nop
75 end
76 end
77 rc=0
79 syntax:
80 if rc~=0 then say '+++ ['rc']' errortext(rc) 'at line' sigl
81 call bguiclose()
82 exit 0
84 break_c:
85 halt:
86 rc=0
87 say '+++ Break at line' sigl
88 signal syntax