home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d9xx / d925 / donsgenies.lha / DonsGenies / FrenchGenies.lha / Rexx / CopierEtRépéterRelié.pprx < prev    next >
Text File  |  1993-08-03  |  3KB  |  102 lines

  1. /*
  2. @BCopierEtRépéterRelié  @P@ICopyright Gold Disk Inc., Février 1992
  3. Modifié par Don Cox.
  4.  
  5. Ce Genie permet de créer plusieurs copies d'une même boîte en spécifiant la distance et l'angle entre ces différentes copies. Les boîtes sont reliées.
  6. */
  7. cr = '0a'x
  8. address command
  9. call SafeEndEdit.rexx()
  10. units = ppm_GetUnits()
  11. if units = 3 then
  12.     call ppm_SetUnits(1)
  13.  
  14. signal on halt
  15. signal on break_c
  16. signal on break_e
  17. signal on break_d
  18. form    = "Colonnes"cr"Rangées"cr"Gouttière"
  19.  
  20. /* This Genie allows user to duplicate, move and rotate a box
  21.  * in one step
  22.  */
  23.  
  24. box = ppm_ClickOnBox("Cliquez sur la boîte à copier...")
  25. if box = 0 then exit_msg()
  26. dup = 0
  27.  
  28. boxpos  = ppm_GetBoxPosition(box)
  29. cur_x   = word(boxpos, 1 )
  30. cur_y   = word(boxpos, 2 )
  31.  
  32. boxsize = ppm_GetBoxSize(box)
  33. width   = word(boxsize, 1 )
  34. height  = word(boxsize, 2 )
  35.  
  36. if units = 3 then
  37. do
  38.    call ppm_ShowStatus("Position: " || ppm_ConvertUnits(1, 3, cur_x) || ", " || ppm_ConvertUnits(1, 3, cur_y) || " taille: l" || ppm_ConvertUnits(1, 3, width) || ", h" || ppm_ConvertUnits(1, 3, height))
  39.  
  40.    form = "Nombre de copies:1"cr"Distance horizontale:" || ppm_ConvertUnits(1, 3, width)||cr"Distance verticale:" || ppm_ConvertUnits(1, 3, height)||cr"Angle"
  41.  
  42. end
  43. else
  44. do
  45.    call ppm_ShowStatus("Position: "cur_x", "cur_y" taille: l"width", h"height)
  46.    form ="Nombre de copies:1"cr"Distance horizontale:"width||cr"Distance verticale:"height||cr"Angle"
  47. end
  48.  
  49. form = ppm_GetForm("Sélection des options", 8, form)
  50. if form = '' then exit_msg()
  51. parse var form count '0a'x  horizontal '0a'x vertical '0a'x angle
  52.  
  53. if count = '' then count = 1
  54. if horizontal = '' then horizontal = 0
  55. if vertical = '' then vertical = 0
  56. if angle = '' then angle = 0
  57.  
  58. if ~(datatype(count, n) & datatype(horizontal, n) & datatype(vertical, n) & datatype(angle, n)) then exit_msg("Saisie incorrecte")
  59.  
  60. if units = 3 then
  61. do
  62.    horizontal = ppm_ConvertUnits(3, 1, horizontal)
  63.    vertical = ppm_ConvertUnits(3, 1, vertical)
  64. end
  65.  
  66. call ppm_AutoUpdate(0)
  67. rotationangle = angle
  68.  
  69. do i = 1 to count
  70.  
  71.     newbox = ppm_CloneBox(box, horizontal, vertical)
  72.     
  73.     linked = ppm_LinkBox(box,newbox)
  74.  
  75.     if angle ~= 0 then
  76.     do
  77.         call ppm_SetBoxAngle(newbox, rotationangle)
  78.         rotationangle = rotationangle + angle
  79.     end
  80.  
  81.     box = newbox
  82.  
  83. end
  84.  
  85. exit_msg()
  86. break_d:
  87. break_e:
  88. break_c:
  89. halt:
  90.     call exit_msg("Abandon du Genie par l'utilisateur !")
  91.  
  92. exit_msg: procedure  expose units
  93. do
  94.     parse arg message
  95.  
  96.     if message ~= '' then call ppm_Inform(1, message,)
  97.     call ppm_ClearStatus()
  98.    if units = 3 then call ppm_SetUnits(3)
  99.     call ppm_AutoUpdate(1)
  100.     exit
  101. end
  102.