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

  1. /* */
  2.  
  3. signal on halt
  4. signal on break_c
  5.  
  6. l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  7. if AddLibrary("rexxsupport.library","rxwiz.library")~=0 then exit
  8.  
  9. prg=ProgramName("NOEXT")
  10. progdir=PathPart(ProgramName("FULL"))
  11.  
  12. /**arguments**/
  13. parm.0.value=""
  14. if ~RMH_ReadArgs("PUBSCREEN/K,NOGUI/S") then do
  15.     call PrintFault(IoErr(),prg)
  16.     exit
  17. end
  18.  
  19. s.PubScreen=parm.0.value
  20. s.fallback=1
  21. s.Snapshot=1
  22. s.Iconified=parm.1.flag
  23. s.AppName="hie"
  24. s.AppIcon="disk"
  25. s.AppIconName="Ciao"
  26. s.CxTitle="Title"
  27. s.CxDescr="Descr"
  28. s.CxHotKey="ctrl a"
  29. s.CxFlags="NOTIFY"
  30. s.MasterWin="WIN"
  31. s.AutoIconify=1
  32. s.AutoClose=1
  33. res=OpenSurface(AddPart(progdir,"hie.wizard"),"S")
  34. if res~=0 then call error(res)
  35.  
  36. win.Gads=12
  37. win.NoWindow=1
  38. res=OpenWindow("S","WIN")
  39. if res~=0 then call error(res)
  40.  
  41. list.COLUMNS=2
  42. list.divide=1
  43. list.0.COLUMNS=2
  44. list.0.divide=1
  45. list.1.COLUMNS=2
  46. list.1.divide=1
  47. list.Header="Name|Phone"
  48.  
  49. list.0="Friends";list.0.list=1;list.0.spen=2;list.0.sel=1
  50. list.0.0="Jhon|555214"
  51. list.0.1="Mary|5535478"
  52. list.1="Work";list.1.list=1
  53. list.1.0="Acme|12345"
  54. set.list="LIST"
  55. res=SetWizAttrs("S","WIN","LISTER","SET")
  56. if res~=0 then call error(res)
  57.  
  58. drop win.
  59. win.AppWindow=1
  60. res=OpenWindow("S","WIN")
  61. if res~=0 then call error(res)
  62. ss=SurfaceSignal("S")
  63.  
  64. stop=0
  65. ctrl_c=2**12
  66. do while ~stop
  67.     mask=Wait(or(ss,ctrl_c))
  68.     if and(mask,ctrl_c)~=0 then call break_c
  69.     if and(mask,ss)~=0 then stop=handle("S")
  70. end
  71. call CloseWindow("S","WIN")
  72. call CloseSurface("S")
  73. exit
  74.  
  75. /**************************************************************************/
  76. error:
  77. parse arg code
  78.     if RXWIZERR~="RXWIZERR" then string = GetRxWizString(1001)":" RXWIZERR || d2c(10)
  79.     else string=""
  80.     string= string || GetRxWizString(code) || d2c(10) || GetRxWizString(1002)":" SIGL-1
  81.     call easyrequest(string,"RXWiz")
  82.     exit
  83. /**************************************************************************/
  84. handle: procedure expose globals. strings.
  85. parse arg s
  86.     handle.wait=0
  87.     res=HandleSurface("S","HANDLE")
  88.     do i=0 to handle.imsg-1
  89.         select
  90.             when handle.i.class=="IDCMPUPDATE" then do
  91.                 say "Selected:"handle.i.selected
  92.                 if handle.i.doubleclick=1 then say "doubleclick"
  93.                 if handle.i.TreeClick=1 then say "TreeClick"
  94.             end
  95.             when handle.i.class=="MENUPICK" then select
  96.                 when handle.i.objectID="MQUIT" then return 1
  97.                 when handle.i.objectID="MHIDE" then call IconifySurface("S",1)
  98.                 otherwise nop
  99.             end
  100.             when handle.i.class=="APPWINDOW" then
  101.                 say "APPWINDOW" "Window:"handle.i.window handle.i.objectID handle.i.ailock
  102.             when handle.i.class=="APPICON" then
  103.                 say "APPICON" "Window:"handle.i.window handle.i.objectID handle.i.ailock
  104.             otherwise say handle.i.class
  105.         end
  106.     end
  107.     return 0
  108. /**************************************************************************/
  109. halt:
  110. break_c:
  111.     exit
  112. /**************************************************************************/
  113.