home *** CD-ROM | disk | FTP | other *** search
/ DTP Toolbox / DTPToolbox.iso / propage4.0 / arexx / marginsallround.pprx < prev    next >
Encoding:
Text File  |  1993-06-22  |  1.1 KB  |  64 lines

  1. /* This Genie puts an equal margin all round a box. 
  2. Written by Don Cox  July '92  */
  3.  
  4.  
  5. trace n
  6.  
  7. signal on error
  8. signal on syntax
  9. address command
  10. call SafeEndEdit.rexx()
  11. cr="0a"x
  12.  
  13. CurrentUnits = ppm_GetUnits()
  14.  
  15. select
  16.     when CurrentUnits = 1 then units="inches"
  17.     when CurrentUnits = 2 then units="millimetres"
  18.     otherwise units ="points"
  19.     end
  20.  
  21. counter=0
  22.  
  23. do forever
  24.     box=ppm_ClickOnBox("Click on boxes to be changed")
  25.     if box=0 then break
  26.     counter=counter+1
  27.     boxes.counter=box
  28.     call ppm_SelectBox(box)
  29. end
  30.  
  31. if counter=0 then exit_msg()
  32.  
  33. size = ppm_GetUserText(6,"Margin in "units)
  34. if size = "" then exit_msg("Aborted by User")
  35. if CurrentUnits = 2 then size = size/10  /* mm to cm */
  36. else if CurrentUnits = 3 then size = size/12  /* points to picas */
  37.  
  38. do i=1 to counter
  39.     box=boxes.i
  40.     call ppm_SetBoxMargins(box,size,size,size,size)
  41.     
  42.     end
  43.  
  44. call exit_msg()
  45.  
  46. end
  47.  
  48. error:
  49. syntax:
  50.     do
  51.     exit_msg("Genie failed due to error: "errortext(rc))
  52.     end
  53.  
  54. exit_msg:
  55.     do
  56.     parse arg message
  57.     if message ~= "" then
  58.     call ppm_Inform(1,message)
  59.     call ppm_ClearStatus()
  60.     call ppm_AutoUpdate(1)
  61.     exit
  62.     end
  63.  
  64.