home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 15 / AACD15.ISO / AACD / Programming / BGUI / Examples / ARexx / testver3.rexx < prev   
Encoding:
OS/2 REXX Batch file  |  2000-05-09  |  2.4 KB  |  88 lines

  1. /* REXX test script for rexxbgui.library */
  2.  
  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
  10.  
  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 */
  14.  
  15. signal on syntax /* important: bguiclose() MUST be called */
  16. signal on halt
  17. signal on break_c
  18.  
  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.  
  26. call bguilist('cycent','Entry #1','Entry #2','Entry #3','Entry #4',,
  27.     'Entry #5')
  28.  
  29. /* using ARexx feature: ,<newline> is translated to nothing */
  30. /* the || are essential - any added space will cause trouble */
  31. /* redefining the same ID makes previous buttons unaccessible */
  32. /* do not redefine winclose etc. */
  33.  
  34. g=bguivgroup(,
  35.     bguiinfo('inf',,esc'cRexxBGUI 3.0 new features')||,
  36.     bguihseparator('Versions')||bguilayout(LGO_FixMinHeight,1)||,
  37.     bguiinfo('ver','BGUI',bguiversion())||,
  38.     bguiinfo('rver','RexxBGUI',bguirexxversion())||,
  39.     bguiinteger('vertest','_Test BGUI version 41.')||bguilayout(LGO_FixMinHeight,1)||,
  40.     bguihseparator('Vertical separator')||bguilayout(LGO_FixMinHeight,1)||,
  41.     bguihgroup(,
  42.         bguibutton('noop1','_Some button')||,
  43.         bguivseparator()||bguilayout(LGO_FixMinWidth,1)||,
  44.         bguibutton('noop2','_Another button'),
  45.     )||,
  46.     bguihseparator('Cycle gadgets')||bguilayout(LGO_FixMinHeight,1)||,
  47.     bguicycle('cyc1','_Normal','cycent','N')||bguilayout(LGO_FixMinHeight,1)||,
  48.     bguicycle('cyc2','_Forced popup','cycent','P')||bguilayout(LGO_FixMinHeight,1)||,
  49.     bguihseparator()||bguilayout(LGO_FixMinHeight,1)||,
  50.     bguihgroup(,
  51.         bguivarspace(50)||,
  52.         bguibutton('quit','_Quit')||,
  53.         bguivarspace(50),
  54.     )||bguilayout(LGO_FixMinHeight,1),
  55. ,grspace.normal,grspace.normal)
  56.  
  57. a=bguiwindow('RexxBGUI 3.0 new features',g,50,'-0',,arg(1))
  58.  
  59. if bguiwinopen(a)=0 then bguierror(12)
  60.  
  61. id=0
  62. do while bguiwinwaitevent(a,'ID')~=id.winclose
  63.     select
  64.         when id=id.quit then leave
  65.         when id=id.winclose then nop
  66.         when id=id.vertest then do
  67.             rev=bguiget(obj.vertest,STRINGA_LongVal)
  68.             if bguiversion(41,rev) then,
  69.                 call bguireq('At least version 41.'rev 'of BGUI.','*_OK',,a)
  70.             else,
  71.                 call bguireq('Version 41.'rev 'of BGUI not available.','*_OK',,a)
  72.         end
  73.         otherwise
  74.     end
  75. end
  76. rc=0
  77.  
  78. syntax:
  79. if rc~=0 then say '+++ ['rc']' errortext(rc) 'at line' sigl
  80. call bguiclose()
  81. exit 0
  82.  
  83. break_c:
  84. halt:
  85. rc=0
  86. say '+++ Break at line' sigl
  87. signal syntax
  88.