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
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
15 signal on syntax /* important: bguiclose() MUST be called */
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. */
34 'info',,'\ec\ebRexxBGUI\e-b: conditional notification',
35 )||bguilayout
(LGO_FixMinHeight
,1)||,
39 bguicheckbox
('dismx','_Disable MX object',0)FixMinSize
||,
40 bguicheckbox
('disi2','D_isable "\eiItem 2\e-i"',0)FixMinSize
,
43 )||bguilayout
(LGO_FixMinHeight
,1)||,
46 bguimx
('mx','_MX object',bguilist
('it','Item 1','Item 2'),'R')FixMinSize
||,
48 )||bguilayout
(LGO_FixMinHeight
,1)||,
51 bguibutton
('quit','_Quit')||,
53 )||bguilayout
(LGO_FixMinHeight
,1),
54 ,grspace
.normal
,grspace
.normal
)
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)
68 do while bguiwinwaitevent
(a
,'ID')~
=id
.winclose
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
80 if rc~
=0 then say '+++ ['rc']' errortext(rc) 'at line' sigl
87 say '+++ Break at line' sigl