home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 58 / af058b.adf / PV21.lha / REXX / Tile_PREFS.pvrx < prev    next >
Text File  |  1991-10-08  |  2KB  |  67 lines

  1. /* Tile_PREFS.pvrx---prompts for number of tiles in X and Y
  2.     directions; sets the views to each tile and partial
  3.     plots it.
  4.  
  5.     Suggested "ProVector.pvrx" entry:
  6.  
  7.         'Define "Tile_PREFS       " Tile_PREFS'
  8.     
  9.     Copyright © 1991 by Stylus, Inc.
  10.     Author:  Jeff Blume
  11. */
  12.  
  13. options results
  14.  
  15. /* Obtain exclusive access to ProVector(tm); quit if not possible */
  16. 'Lock'
  17. if rc ~= 0 then exit
  18.  
  19. 'GetStr "Enter # of XTiles, YTiles:" "OK" "Cancel"'
  20. XYTiles = result
  21. if rc ~= 0 | words(XYTiles) ~= 2 then call Error "Didn't give TWO numbers/Canceled"
  22. XTiles = subword(XYTiles,1,1)    /* extract the 2 numbers */
  23. YTiles = subword(XYTiles,2,1)
  24. NumTiles = XTiles * YTiles
  25. CurrPage = 0
  26. 'GetBool "Pause after each page?" "Yes" "No"'
  27. if RC = 0 then Pause = "True"
  28.  
  29. 'GetPageSize' PSize    /* PSize.X1, PSize.Y1, PSize.X2, PSize.Y2 */
  30. TileW = abs(PSize.X1-PSize.X2)/XTiles
  31. TileH = abs(PSize.Y1-PSize.Y2)/YTiles
  32.  
  33. /* Set initial view (tile) height */
  34. View.Y1 = PSize.Y1
  35. View.Y2 = PSize.Y1 + TileH
  36.  
  37. /* Tile in X axis first, to feed continuous tiles */
  38. do i = 1 for YTiles
  39.     /* Set initial view (tile) width */
  40.     View.X1 = PSize.X1
  41.     View.X2 = PSize.X1 + TileW
  42.     do j = 1 for XTiles
  43.         'SetView' View
  44.         'PartialPlot "PV_Drivers/Preferences Advance=True AskUser=False"'
  45.         CurrPage = CurrPage + 1
  46.         if Pause = "True" & CurrPage ~= NumTiles then do
  47.             'Getbool "Continue or Quit?" "OK" "QUIT"'
  48.             if RC ~= 0 then call CleanUp
  49.         end
  50.         View.X1 = View.X2
  51.         View.X2 = View.X2 + TileW
  52.     end                /* end X do */
  53.     View.Y1 = View.Y2
  54.     View.Y2 = View.Y2 + TileH
  55. end                    /* end Y do */
  56.  
  57. CleanUp:
  58.     'SetView' PSize        /* Zoom out to Full View */
  59.     'UnLock'        /* Always be sure to unlock ProVector */
  60.     exit
  61.  
  62. Error:
  63.     arg String
  64.     'GetBool String "Cancel" "Cancel"'
  65.     'UnLock'
  66.     exit
  67.