home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d9xx / d925 / donsgenies.lha / DonsGenies / FrenchGenies.lha / Rexx / GuidesTirésDeLaBoîte.pprx < prev    next >
Text File  |  1993-08-03  |  2KB  |  92 lines

  1. /*
  2. @BGuidesTirésDeLaBoîte @P @I Ecrit et © par Don Cox en Février 1993
  3. @IN'est pas du Domaine Publique. Tous Droits Réservés.
  4. Traduit par Fabien Larini le 30/07/93.
  5.     
  6. Ce Génie utilise la position d'une boîte pour positionner la grille, en
  7. activant l'alignement sur grille. Le résulat ressemble à des guides
  8. verticaux ou horizontaux passant par la boîte. Les boîtes ayant un angle
  9. de rotation ne sont pas positionnées correctement. Il sauve les anciennes
  10. dimensions afin de pouvoir les réutiliser grâce au Génie "RestoreGrille"
  11. */
  12.  
  13.  
  14. /*GrifPositionFromBox*/
  15. /* This Genie sets up a grid to match the position of a box, with snap 
  16. enabled. If either a side or the top is selected, the result resembles a 
  17. snap-to guide line. Note that when you move a box only the left or top side
  18. will snap, and rotated boxes do not snap properly. Ctrl-S switches snap on 
  19. and off.
  20. Written by Don Cox  © Feb 93. Not public domain. All rights reserved. */
  21.  
  22.  
  23. signal on error
  24. signal on syntax
  25. address command
  26. call SafeEndEdit.rexx()
  27. call ppm_AutoUpdate(0)
  28. cr="0a"x
  29.  
  30. trace n
  31. currentunits = ppm_GetUnits()
  32. box     = ppm_ClickOnBox("Clickez dans la Boîte pour les Dimensions.")
  33. if box  = 0 then exit_msg("Pas de Boîte Sélectionnée")
  34. gsize = ppm_GetGridSize()
  35. gwidth = word(gsize,1)
  36. gheight = word(gsize,2)
  37.  
  38. call ppm_SaveText("ram:gridsize",gsize)
  39. size = ppm_GetBoxSize(box)
  40. width = word(size,1)
  41. height = word(size,2)
  42. where = ppm_GetBoxPosition(box)
  43. xpos = word(where,1)
  44. ypos = word(where,2)
  45. if xpos>2 then do
  46.     xnum = xpos%2.0
  47.     xspacing = xpos/xnum
  48.     end
  49. if ypos>2 then do
  50.     ynum = ypos%2.0
  51.     yspacing = ypos/ynum
  52.     end
  53.  
  54. choice = ppm_Inform(3,"Choix du Bord de la Boîte pour la mise en place de la Grille","Droit","Supérieur","Gauche")
  55. select
  56.     when choice = 0 then do
  57.         if (xpos+width)>2 then do
  58.             xnum = (xpos+width)%2
  59.             xspacing = (xpos+width)/xnum
  60.             end
  61.         call ppm_SetGridSize(xspacing,0.01)
  62.         end
  63.     when choice = 1 then call ppm_SetGridSize(0.01,yspacing)
  64.     otherwise call ppm_SetGridSize(xspacing,0.01)
  65.     end
  66.  
  67.  
  68. call ppm_SetGrid(1)
  69.  
  70. call ppm_SetGridSnap(1)
  71.  
  72. call exit_msg()
  73.  
  74. end
  75.  
  76. error:
  77. syntax:
  78.     do
  79.     exit_msg("Arrêt du Génie dû à l'erreur: "errortext(rc))
  80.     end
  81.  
  82. exit_msg:
  83.     do
  84.     parse arg message
  85.     if message ~= "" then
  86.     call ppm_Inform(1,message,)
  87.     call ppm_ClearStatus()
  88.     call ppm_AutoUpdate(1)
  89.     exit
  90.     end
  91.  
  92.