home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 2: PC / frozenfish_august_1995.bin / bbs / d09xx / d0925.lha / DonsGenies / FrenchGenies.lha / Rexx / CentreBoîtesSurPage.pprx < prev    next >
Text File  |  1993-08-03  |  2KB  |  94 lines

  1. /*
  2. @BCentreBoεtesSurPage @P @I Ecrit et ⌐ par Don Cox en ao√t 1993
  3. @IN'est pas du Domaine Publique. Tous Droits RΘservΘs.
  4. Traduit par Fabien Larini le 29/07/93.
  5.  
  6. Ce GΘnie centre les boεtes sur la page, par rapport α l'axe vertical 
  7. seulement.                    
  8. */
  9.  
  10. /*BoxesCentreOnPage*/
  11. /* This Genie centres the boxes on the page, from left to right only (not
  12. top-to-bottom).
  13. Written by Don Cox  Aug 92. Not Public Domain. All rights reserved. 
  14. Copyright but freely usable for non-commercial purposes. */
  15.  
  16. trace n
  17. signal on error
  18. signal on syntax
  19. address command
  20. call SafeEndEdit.rexx()
  21. call ppm_AutoUpdate(0)
  22. cr="0a"x
  23.  
  24. cpage = ppm_CurrentPage()
  25. counter=0
  26.  
  27. choice = ppm_Inform(2,"Quelles Boεtes","Toutes","SΘlection")
  28.  
  29. select
  30. when choice = 1 then do
  31.     do forever
  32.         box=ppm_ClickOnBox("Clickez dans les Boεtes α Centrer")
  33.         if box=0 then break
  34.         counter=counter+1
  35.         boxes.counter=box
  36.         call ppm_SelectBox(box)
  37.         end
  38.     end
  39.  
  40. when choice = 0 then do
  41.     boxes.1 = ppm_PageFirstBox()
  42.     box = boxes.1
  43.     totalboxes = ppm_NumBoxes(cpage)
  44.     counter = totalboxes
  45.     do i=2 to totalboxes
  46.         box = ppm_PageNextBox(box)
  47.         boxes.i = box
  48.         end
  49.     end
  50.  
  51. otherwise exit_msg()
  52. end
  53.  
  54. if counter=0 then exit_msg("Pas de Boεte SΘlectionnΘe")
  55. currentunits=ppm_GetUnits()
  56. call ppm_SetUnits(2)
  57.  
  58. pagewidth = word(ppm_GetPageSize(),1)
  59.  
  60. call ppm_ShowStatus("Centrage des Boεtes ...")
  61. do i=1 to counter
  62.     box=boxes.i
  63.  
  64.     Ypos = word(ppm_GetBoxPosition(box),2)
  65.     width = word(ppm_GetBoxSize(box),1)
  66.     Xpos = (pagewidth-width)/2
  67.     call ppm_SetBoxPosition(box,Xpos,Ypos)
  68.  
  69.     end
  70.  
  71. call ppm_SetUnits(currentunits)
  72.  
  73. call exit_msg()
  74. end
  75.  
  76.  
  77.  
  78. error:
  79. syntax:
  80.     do
  81.     exit_msg("ArrΩt du GΘnie d√ α l'erreur: "errortext(rc))
  82.     end
  83.  
  84. exit_msg:
  85.     do
  86.     parse arg message
  87.     if message ~= "" then
  88.     call ppm_Inform(1,message,)
  89.     call ppm_ClearStatus()
  90.     call ppm_AutoUpdate(1)
  91.     exit
  92.     end
  93.  
  94.