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