home *** CD-ROM | disk | FTP | other *** search
/ DTP Toolbox / DTPToolbox.iso / propage4.0 / arexx / boxeswob.pprx < prev    next >
Encoding:
Text File  |  1993-04-29  |  1.7 KB  |  80 lines

  1. /* This Genie sets the box to black and text to white and puts an equal margin all round the box. 
  2. Written by Don Cox  April '93  */
  3.  
  4.  
  5. signal on error
  6. signal on syntax
  7. address command
  8. call SafeEndEdit.rexx()
  9. cr="0a"x
  10.  
  11. call ppm_AutoUpdate(0)
  12. CurrentUnits = ppm_GetUnits()
  13. oldcolor = ppm_GetTextColor()
  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. color   =  "Black"
  34. tcolor  =  "White"
  35.  
  36. size = ppm_GetUserText(6,"Margin in "units)
  37. if size = "" then exit_msg("Aborted by User")
  38. if CurrentUnits = 2 then size = size/10  /* mm to cm */
  39. else if CurrentUnits = 3 then size = size/12  /* points to picas */
  40.  
  41. do i=1 to counter
  42.     box=boxes.i
  43.     call ppm_SetBoxMargins(box,size,size,size,size)
  44.     
  45.     call ppm_SetBoxFrameData(box,color, color, ppm_GetLineWeight(), ppm_GetLinePattern(), 1)
  46.     call ppm_SetBoxFrame(box, 1)
  47.     call ppm_SetBoxTransparent(box, 0)
  48.  
  49.     if upper(word(ppm_GetBoxInfo(box), 1)) ~= TEXT then iterate i
  50.  
  51.     call SafeSetEdit.rexx(box)
  52.     call ppm_SelectBoxText()
  53.     call ppm_SetTextColor(tcolor)
  54.     call SafeEndEdit.rexx()
  55.  
  56.     end
  57.  
  58. call exit_msg()
  59.  
  60. end
  61.  
  62. error:
  63. syntax:
  64.     do
  65.     exit_msg("Genie failed due to error: "errortext(rc))
  66.     end
  67.  
  68. exit_msg:
  69.     do
  70.     parse arg message
  71.     if message ~= "" then
  72.     call ppm_Inform(1,message)
  73.     call ppm_SetTextColor(oldcolor)
  74.     call ppm_SetWireFrame(0)
  75.     call ppm_ClearStatus()
  76.     call ppm_AutoUpdate(1)
  77.     exit
  78.     end
  79.  
  80.