home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 12 / MA_Cover_12.iso / libs / rxwiz / examples / test.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1999-05-24  |  2.5 KB  |  102 lines

  1. /* just a test example */
  2.  
  3. if ~show("L","rexxsupport.library") then
  4.     if ~addLib("rexxsupport.library",0,-30) then do
  5.         say "can't find rexxsupport.library"
  6.         exit
  7.     end
  8.  
  9. if ~show("L","rmh.library") then
  10.     if ~addLib("rmh.library",0,-30) then do
  11.         say "can't find rmh.library"
  12.         exit
  13.     end
  14.  
  15. if ~show("L","rxwiz.library") then
  16.     if ~addLib("rxwiz.library",0,-30) then do
  17.         say "can't find rxwiz.library"
  18.         exit
  19.     end
  20.  
  21. res=OpenSurface("test.wizard","SURFACE")
  22. if res~=0 then call error(res)
  23.  
  24. win.Gads=15
  25. win.ID=1
  26. res=OpenWindow("SURFACE","WIN")
  27. if res~=0 then call error(res)
  28. ws=WindowSignal("SURFACE","WIN")
  29.  
  30. list.0.list=1
  31. list.0="First List"
  32. list.0.0="First of First"
  33. list.0.1="Second of First"
  34.  
  35. list.1.list=1
  36. list.1.Sel=1
  37. list.1="Second List"
  38. list.1.0="First of Second"
  39. list.1.1="Second of Second"
  40.  
  41. list.2.list=1
  42. list.2="Third empty"
  43.  
  44. list.3="Just a node"
  45.  
  46. set.LIST="LIST"
  47. res=SetWizAttrs("SURFACE","WIN","HIE","SET")
  48. if res~=0 then call error(res)
  49.  
  50. stop=0
  51. do while ~stop
  52.     mask=Wait(ws)
  53.     if and(mask,ws)~=0 then stop=handle("WIN")
  54. end
  55. call CloseWindow("SURFACE","WIN")
  56. call SnapShot("SURFACE")
  57. exit
  58.  
  59. /**************************************************************************/
  60. error:
  61. parse arg code
  62.  
  63.     string=GetRxWizString(code)
  64.     if string=="" then string="(codice sconosciuto: " || code || ")"
  65.     if RXWIZERR~="RXWIZERR" then string = string  "(field:" RXWIZERR || ")"
  66.     say string "(" || "at line" SIGL-1 ||")"
  67.     exit
  68. /**************************************************************************/
  69. handle: procedure expose list.
  70. parse arg o
  71.     handle.wait=0
  72.     res=HandleWindow("SURFACE",o,"HANDLE")
  73.     if res~=0 then call error(res)
  74.     if handle.imsg>0 then
  75.         do i=0 to handle.imsg-1
  76.             select
  77.                 when handle.i.class=="CLOSEWINDOW" then return 1
  78.                 when handle.i.class=="IDCMPUPDATE" then do
  79.                     say "Message from" handle.i.ObjectID":"
  80.                     select
  81.                         when handle.i.ObjectID=="DATE" then do
  82.                             call GetWizAttr("SURFACE","WIN","DATE","DAY","DAY")
  83.                             say "you selected day:" day
  84.                         end
  85.                         when handle.i.ObjectID=="PALETTE" then say "you selected colour:" handle.i.Selected
  86.                         when handle.i.ObjectID=="HIE" then do
  87.                             j=handle.i.coord
  88.                             if handle.i.DoubleClick==1 then
  89.                                 say "You dobleclick on node:" j "=" list.j
  90.                             else say "You selected the node:" j "=" list.j
  91.                         end
  92.                         when handle.i.ObjectID=="STRING" then say "you wrote the string:" handle.i.String
  93.                         otherwise nop
  94.                     end
  95.                     say
  96.                 end
  97.                 otherwise say "Class:" handle.i.class
  98.             end
  99.         end
  100.     return 0
  101. **************************************************************************/
  102.