home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #2 / Amiga Plus CD - 2004 - No. 02.iso / AmigaPlus / Tools / Development / RxMUI / Examples / MysticView.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2004-01-31  |  3.1 KB  |  113 lines

  1. /* Mystiview power */
  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","rxmui.library")~=0 then exit
  8.  
  9. call ProgDir()
  10.  
  11. parm.0.value="PROGDIR:Pics/Trek"
  12. if ~RMHReadArgs("FILE") then do
  13.     call PrintFault()
  14.     exit
  15. end
  16.  
  17. call RxMUIOpt("debugmode showerr")
  18.  
  19. call CreateApp(parm.0.value)
  20. call HandleApp
  21. /* never reached */
  22. /***********************************************************************/
  23. HandleApp: procedure
  24.  
  25.     ctrl_c=2**12
  26.     do forever
  27.         call NewHandle("app","h",ctrl_c)
  28.         if and(h.signals,ctrl_c)>0 then exit
  29.         select
  30.             when h.event="QUIT" then exit
  31.             otherwise interpret h.event
  32.         end
  33.     end
  34.     /* never reached */
  35. /***********************************************************************/
  36. err: procedure expose sigl rxmuierror
  37. parse arg res
  38. say sigl "["res"]"
  39.     say getrxmuistring(res) "in line" sigl-1 rxmuierror
  40.     exit
  41. /***********************************************************************/
  42. CreateApp: procedure
  43. parse arg file
  44.  
  45.     app.Title="MysticViewExample"
  46.     app.Version="$VER: MysticViewExample 1.0 (12.10.2000)"
  47.     app.Copyright="©2000, alfie"
  48.     app.Author="alfie"
  49.     app.Description="MysticViewExample"
  50.     app.Base="RXMUIEXAMPLE"
  51.     app.SubWindow="win"
  52.      win.ID="MAIN"
  53.      win.Title="MysticViewExample"
  54.      win.Contents="MGROUP"
  55.  
  56.       mgroup.0="mv"
  57.        mv.class="MysticView"
  58.        mv.Frame           = "virtual"
  59.        mv.FileName      = file
  60.        mv.BACKCOLOUR    = '00e143'x
  61.        mv.DisplayMode   = "IGNOREASPECT"
  62.        mv.ShowArrows    = 1
  63.        mv.ShowCursor    = 1
  64.        mv.MouseDrag     = 1
  65.        mv.RefreshMode   = "NONE"
  66.        mv.StaticPalette = 1
  67.        mv.Text          = FilePart(file)
  68.        mv.SHOWPIP       = 1
  69.        mv.DisplayMode   = "IGNOREASPECT"
  70.  
  71.       mgroup.1="zg"
  72.        zg.class="group"
  73.        zg.horiz=1
  74.        zg.Frame="Group"
  75.        zg.FrameTitle="Zoom"
  76.        zg.samesize=1
  77.         zg.0=button("zoomin","Zoom _In")
  78.         zg.1=button("zoomout","Zoom _Out")
  79.         zg.2=button("resetzoom","_Reset")
  80.  
  81.       mgroup.2="rg"
  82.        rg.class="group"
  83.        rg.horiz=1
  84.        rg.Frame="Group"
  85.        rg.FrameTitle="Rotate"
  86.        rg.samesize=1
  87.         rg.0=button("rotl","Rotate _Left")
  88.         rg.1=button("rotr","Rotate _Right")
  89.         rg.2=button("resetrot","_Reset")
  90.  
  91.     res=NewObj("APPLICATION","APP")
  92.     if res~=0 then call err(res)
  93.  
  94.     call Notify("win","CloseRequest",1,"app","ReturnID","quit")
  95.  
  96.     call Notify("zoomout","Pressed",0,"mv","set","ZoomOutRelative",16384)
  97.     call Notify("zoomin","Pressed",0,"mv","set","ZoomInRelative",16384)
  98.     call Notify("resetzoom","Pressed",0,"mv","set","ResetZoom",0)
  99.  
  100.     call Notify("rotl","Pressed",0,"mv","set","RotateLeftRelative",5461)
  101.     call Notify("rotr","Pressed",0,"mv","set","RotateRightRelative",5461)
  102.     call Notify("resetrot","Pressed",0,"mv","set","ResetRotate",0)
  103.  
  104.     call set("win","open",1)
  105.  
  106.     return
  107. /***********************************************************************/
  108. halt:
  109. break_c:
  110.     exit
  111. /**************************************************************************/
  112.  
  113.