home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 4 / CDPD_IV.bin / fish / 911-930 / ff925 / donsgenies / frenchgenies.lha / Rexx / ZoomSurBoîte.pprx < prev   
Text File  |  1993-08-03  |  954b  |  38 lines

  1. /*
  2. @BZoomSurBoîte @P @I Ecrit et © par Don Cox en juillet 1993
  3. @IN'est pas du Domaine Publique. Tous Droits Réservés.
  4. Traduit par Fabien Larini le 02/08/93.
  5.  
  6. Ce Génie zoom sur la boîte active de telle sorte qu'elle remplisse l'écran.
  7. NE MARCHE PAS SI IL N'Y A PAS DE BOITE ACTIVE.
  8. */
  9.  
  10.  
  11. /* ZoomToBox */
  12. /*
  13. Zoom in or out so that the currently active box approximately fills the screen. Fails if there is no active box.
  14. Written by Don Cox, July 93. Not Public Domain.
  15. */
  16.  
  17. trace n
  18.  
  19. address command
  20.  
  21. where = ppm_GetBoxPosition()
  22. xpos = word(where,1)
  23. ypos = word(where,2)
  24. howbig = ppm_GetBoxSize()
  25. width = word(howbig,1)
  26. height = word(howbig,2)
  27. widthmag = 1950/width /* 1950 is an arbitrary figure - edit it if you want to get different results */
  28. heightmag = 1750/height  /* likewise 1750  */
  29. mag = min(widthmag,heightmag)
  30. mag = trunc(mag)
  31. if mag>400 then mag = 400
  32. if mag<10 then mag = 10
  33. call ppm_SetMagMode(mag)
  34. call ppm_SetPagePosition(xpos,ypos)
  35.  
  36. exit
  37.  
  38.