home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 2: PC / frozenfish_august_1995.bin / bbs / d09xx / d0925.lha / DonsGenies / FrenchGenies.lha / Rexx / BoîtesAvantArrière.pprx < prev    next >
Text File  |  1993-08-07  |  4KB  |  134 lines

  1. /*@BBoεtesAvantArriΦres @P @I Ecrit et ⌐ par Don Cox en Ao√t 1992
  2. @IN'est pas du Domaine Publique. Tous Droits RΘservΘs.
  3. Traduit et modifiΘ par Fabien Larini le 22/07/93.
  4.  
  5. Ce GΘnie permet de placer une ou plusieurs boεtes dans un ordre descendant
  6. de profondeur.
  7. */
  8.  
  9.  
  10. /* Boxes Front to Back
  11. Select boxes by name or number and rearrange them from front to back in order. Useful in complex layouts where there are several boxes on top of each other.
  12. You will be given a list of boxes, and asked to double-click on the names in order from front to back. You can click on Cancel at any time to finish the process.
  13. Written by Don Cox ⌐ Aug 92   */
  14.  
  15. trace n
  16. signal on error
  17. signal on syntax
  18. call ppm_AutoUpdate(0)
  19. cr = "0a"x
  20.  
  21. address command
  22. call SafeEndEdit.rexx()
  23.  
  24. call ppm_ShowStatus("Liste les Boεtes ...")
  25. thispage = ppm_CurrentPage()
  26. totalboxes = ppm_NumBoxes(thispage)
  27. list = ""
  28. numberlist = ""
  29. box = ppm_PageFirstBox(thispage)
  30. do i = 1 to totalboxes
  31.     number = right(ppm_BoxNum(box),3," ")
  32.     numberlist = numberlist" "number
  33.     info = ppm_GetBoxInfo(box)
  34.     boxtype = word(info,1)
  35.     boxname = ppm_GetBoxName(box)
  36.     select
  37.         when upper(boxtype) = "TEXTE" then do
  38.             boxtext = ppm_GetBoxText(box,0)
  39.             shorttext = substr(boxtext,1,15)
  40.             if boxname = "" then boxname = shorttext
  41.             end
  42.         when upper(boxtype) = "BITMAP" then do
  43.             filename = word(info,5)
  44.             filename = substr(filename, lastpos("/",filename)+1)
  45.             if boxname = "" then boxname = filename
  46.             end
  47.         when upper(boxtype) = "EPSF" then do
  48.             filename = word(info,3)
  49.             filename = substr(filename, lastpos("/",filename)+1)
  50.             if boxname = "" then boxname = filename
  51.             end
  52.         when upper(boxtype) = "CLIP" then do
  53.             objects = "Clip, "||word(info,2)||" objets"
  54.             if boxname = "" then boxname = objects
  55.             end
  56.         when upper(boxtype) = "VECTORIS╔" then do
  57.             objects = "Aegis, "||word(info,2)||" objets"
  58.             if word(info,2)=1 then objects = "Aegis, 1 objet"
  59.             if boxname = "" then boxname = objects
  60.             end
  61.         when upper(boxtype) = "VIDE" then do
  62.             if boxname = "" then boxname = "Vide"
  63.             end
  64.         otherwise boxname = "Unknown type of box"
  65.     end
  66.     boxtype = substr(boxtype,1,1)
  67.     list = list||number" "boxname||cr
  68.     box = ppm_PageNextBox(box)
  69.     end
  70.  
  71. call ppm_ClearStatus()
  72. form = ""
  73. series = ""
  74.     box = ppm_SelectFromList("Choix de la Boεte au dessus",34,18,0,list)
  75.     if box = "" then exit_msg("Abandon Utilisateur")
  76.     series = series||" "||word(box,1)
  77.     form = box||":1"||"0a"x
  78.  
  79. do i = 2 to totalboxes
  80.     box = ppm_SelectFromList("Choix de la Boεte Suivante",34,18,0,list)
  81.     if box = "" then break
  82.     series = series||" "||word(box,1)
  83.     form = form||box":"||i||"0a"x
  84.     end
  85.  
  86. form = delstr(form,length(form),1)
  87.  
  88. accept = ppm_GetForm("Etes vous d'accord ?",3,form)
  89. if accept = "" then exit_msg("Abandon Utilisateur")
  90.  
  91. newnumbers = numberlist
  92. numselected = words(series)
  93. do i=1 to numselected
  94.     this = word(series,i)
  95.     do w = 1 to words(numberlist)
  96.         that = word(numberlist,w)
  97.         chars = length(that)
  98.         pad = left("XXXXXX",chars)
  99.         pad = " "pad" "
  100.         position = wordindex(newnumbers,w)+(chars-1) /* debug Aug. 93 */
  101.         if this = that then do
  102.             newnumbers = insert(pad,newnumbers,position)
  103.             newnumbers = delword(newnumbers,w,1)
  104.             leave w
  105.             end
  106.         end
  107.     end
  108. newnumbers = compress(newnumbers,"X")
  109.  
  110. series = series||" "||newnumbers /* stick the unselected boxes on the end of the list */
  111.  
  112. do until series = ""
  113.     parse var series box series
  114.     call ppm_BoxToBack(box)
  115.     end
  116.  
  117. exit_msg()
  118.  
  119. error:
  120. syntax:
  121.     do
  122.     exit_msg("ArrΩt du GΘnie d√ α l'erreur : "errortext(rc))
  123.     end
  124.  
  125. exit_msg:
  126.     do
  127.     parse arg message
  128.     if message ~= "" then
  129.     call ppm_Inform(1,message,)
  130.     call ppm_ClearStatus()
  131.     call ppm_AutoUpdate(1)
  132.     exit
  133.     end
  134.