home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / WordProcessors / FINALWRITERUPDATE2,1.DMS / in.adf / FWMacros.lha / GfxShadowBox < prev    next >
Encoding:
Text File  |  1993-07-22  |  3.2 KB  |  98 lines

  1. /* ==================================================== */
  2. /* Final Writer Arexx Macro - SHADOW BOX                */
  3. /* This macro will draw a black shadow box for the      */
  4. /* current selected objects, (except lines and arrows). */
  5. /* by Terry Wright                                      */
  6. /* $VER: GfxShadowBox 3.0 (21.7.93)                     */
  7. /* ==================================================== */
  8. Options Results
  9.  
  10. /* ------------------------------------ */
  11. /* Set parameters to be in ruler units. */
  12. /* ------------------------------------ */
  13. SetMeasure MICROPOINTS
  14.  
  15. /* ------------------------------------------- */
  16. /* These are the offsets for the shadow box    */
  17. /* in micropoints. (720 micropoints = 1 inch)  */
  18. /* ------------------------------------------- */ 
  19. XOffset = 45
  20. YOffset = 45
  21.  
  22. /* ------------------------------------------- */
  23. /* Get the id of the first selected object.    */
  24. /* If there are no objects selected then quit. */
  25. /* ------------------------------------------- */
  26. FirstObject SELECTED
  27. IF ( Result = 0 ) THEN
  28.    EXIT
  29.  
  30. /* ------------------------------------------- */
  31. /* Collect the ids of all the selected objects */
  32. /* ------------------------------------------- */
  33. i = 0
  34. DO WHILE Result ~= 0
  35.    i = i + 1
  36.    ObjId.i = Result
  37.    NextObject ObjId.i SELECTED
  38. END
  39.  
  40. /* --------------------------------------- */
  41. /* Loop through all of our object creating */
  42. /* a shadow box for each one.              */
  43. /* --------------------------------------- */
  44. x = 0
  45. DO WHILE (x < i)
  46.    x = x + 1
  47.    /* ----------------------------------------- */
  48.    /* Find out the type of the object. We don't */
  49.    /* want to draw a shadow for lines or arrows */
  50.    /* or groups.                                */
  51.    /* ----------------------------------------- */
  52.    GetObjectType ObjId.x
  53.    objtype = Result
  54.    IF (objtype ~= 2 & objtype ~= 3 & objtype ~= 8) THEN DO
  55.       /* ---------------------------------- */
  56.       /* Get the coordinates and parameters */
  57.       /* ---------------------------------- */
  58.       GetObjectCoords ObjId.x
  59.       coords = Result
  60.        PARSE VAR coords page left top width height
  61.  
  62.       GetObjectParams ObjId.x TEXTFLOW FLOWDIST
  63.       params = Result
  64.       PARSE VAR params tflow fdist
  65.  
  66.       bevel = ""
  67.       IF ( objtype = 5 ) THEN
  68.          bevel = "BEVEL"
  69.  
  70.       /* ----------------------------- */
  71.       /* Draw the shadow by offsetting */
  72.       /* the left and top values.      */
  73.       /* ----------------------------- */
  74.       left = left + XOffset
  75.       top  = top  + YOffset
  76.  
  77.       IF ( objtype = 6 ) THEN
  78.          DrawOval page left top width height
  79.       ELSE
  80.          DrawBox page left top width height bevel
  81.         shadowId = Result
  82.  
  83.       /* -------------------------------------------------- */
  84.       /* Now Set the object parameters keeping the textflow */
  85.       /* flow distance the same as the original object. Set */
  86.       /* fill to solid, lineweight to none and the colors   */
  87.       /* to black. Then send the new object to the back.    */
  88.       /* -------------------------------------------------- */
  89.       SetObjectParams shadowId TEXTFLOW tflow FLOWDIST fdist LINEWT "None" LINECOLOR "Black" FILL "Solid" FILLCOLOR "Black"
  90.       ObjectToBack shadowId
  91.    END
  92.  
  93. END
  94.  
  95.    SelectObject 0
  96.     Redraw
  97.  
  98.