home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d9xx / d925 / donsgenies.lha / DonsGenies / FrenchGenies.lha / Rexx / CouleurBoîtesTexte&Marges.pprx < prev    next >
Text File  |  1993-08-03  |  3KB  |  104 lines

  1. /*
  2. @BCouleursBoîtesTexte&Marges @P@IEcrit et © par Don Cox en avril 93
  3. @IN'est pas du Domaine Publique. Tous Droits Réservés.
  4. Traduit et modifié par Fabien Larini le 29/07/93.
  5.  
  6. Ce Génie permet de choisir la couleur de texte, de remplissage, de trait, 
  7. et de donner une valeur identique pour les marges de la boîte. Il
  8. utilise l'épaisseur et le motif de trait courant.
  9. */
  10.  
  11.  
  12. /*BoxesColors&Margins.pprx*/
  13. /* This Genie sets the box and text colours and puts an equal margin all round the box. 
  14. Written by Don Cox  April '93. Not Public Domain. */
  15.  
  16.  
  17. signal on error
  18. signal on syntax
  19. address command
  20. call SafeEndEdit.rexx()
  21. cr="0a"x
  22.  
  23. call ppm_AutoUpdate(0)
  24. CurrentUnits = ppm_GetUnits()
  25. oldcolor = ppm_GetTextColor()
  26.  
  27. select
  28.     when CurrentUnits = 1 then units="inches"
  29.     when CurrentUnits = 2 then units="millimètres"
  30.     otherwise units ="points"
  31.     end
  32.  
  33. counter=0
  34.  
  35. do forever
  36.     box=ppm_ClickOnBox("Clickez dans les Boîtes à Modifier")
  37.     if box=0 then break
  38.     counter=counter+1
  39.     boxes.counter=box
  40.     call ppm_SelectBox(box)
  41. end
  42.  
  43. if counter=0 then exit_msg()
  44.  
  45. colorlist   = ppm_GetColorList()
  46. colorlist   = substr(colorlist, pos('0a'x, colorlist) + 1)
  47.  
  48. color   =  ppm_SelectFromList("Couleur de Remplissage", 25, 18, 0, colorlist)
  49. if color = '' then exit_msg("Annulé")
  50. tcolor  =  ppm_SelectFromList("Couleur de Texte", 25, 18, 0, colorlist)
  51. if tcolor = '' then exit_msg("Annulé")
  52.  
  53. choix = ppm_Inform(2,"Voulez vous un cadre de la même Couleur que la couleur de Remplissage","Non","Oui")
  54. if choix = 1 then
  55.         couleurtrait = color
  56.      else
  57.         couleurtrait = ppm_SelectFromList("Couleur du Trait", 25, 18, 0, colorlist)
  58.         if couleurtrait = '' then exit_msg("Annulé")
  59.  
  60. size = ppm_GetUserText(6,"Marges en "units)
  61. if size = "" then exit_msg("Abandon Utilisateur")
  62. if CurrentUnits = 2 then size = size/10  /* mm to cm */
  63. else if CurrentUnits = 3 then size = size/12  /* points to picas */
  64.  
  65. do i=1 to counter
  66.     box=boxes.i
  67.     call ppm_SetBoxMargins(box,size,size,size,size)
  68.     
  69.     call ppm_SetBoxFrameData(box,couleurtrait, color, ppm_GetLineWeight(), ppm_GetLinePattern(), 1)
  70.     call ppm_SetBoxFrame(box, 1)
  71.     call ppm_SetBoxTransparent(box, 0)
  72.  
  73.     if upper(word(ppm_GetBoxInfo(box), 1)) ~= TEXTE then iterate i
  74.  
  75.     call SafeSetEdit.rexx(box)
  76.     call ppm_SelectBoxText()
  77.     call ppm_SetTextColor(tcolor)
  78.     call SafeEndEdit.rexx()
  79.  
  80.     end
  81.  
  82. call exit_msg()
  83.  
  84. end
  85.  
  86. error:
  87. syntax:
  88.     do
  89.     exit_msg("Arrêt du Génie dû à l'erreur: "errortext(rc)) 
  90.     end
  91.  
  92. exit_msg:
  93.     do
  94.     parse arg message
  95.     if message ~= "" then
  96.     call ppm_Inform(1,message,)
  97.     call ppm_SetTextColor(oldcolor)
  98.     call ppm_SetWireFrame(0)
  99.     call ppm_ClearStatus()
  100.     call ppm_AutoUpdate(1)
  101.     exit
  102.     end
  103.                               
  104.