home *** CD-ROM | disk | FTP | other *** search
/ Merciful 3 / Merciful_Release_3.bin / software / f / finalwriter / finalwriterv5.04ukver.lha / FinalWriter_B / FWMacros / GfxShadowBox < prev    next >
Text File  |  1994-10-03  |  3KB  |  101 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,arrows,arcs, */
  5. /* shapes and group objects).                           */
  6. /* by Terry Wright                                      */
  7. /* $VER: GfxShadowBox 3.1 (3.10.94)                     */
  8. /* © 1994 SoftWood, Inc.                                */
  9. /* Use of this macro is strictly at the user's risk.    */
  10. /* ==================================================== */
  11. Options Results
  12.  
  13. /* ------------------------------------ */
  14. /* Set parameters to be in ruler units. */
  15. /* ------------------------------------ */
  16. SetMeasure MICROPOINTS
  17.  
  18. /* ------------------------------------------- */
  19. /* These are the offsets for the shadow box    */
  20. /* in micropoints. (720 micropoints = 1 inch)  */
  21. /* ------------------------------------------- */
  22. XOffset = 45
  23. YOffset = 45
  24.  
  25. /* ------------------------------------------- */
  26. /* Get the id of the first selected object.    */
  27. /* If there are no objects selected then quit. */
  28. /* ------------------------------------------- */
  29. FirstObject SELECTED
  30. IF ( Result = 0 ) THEN
  31.    EXIT
  32.  
  33. /* ------------------------------------------- */
  34. /* Collect the ids of all the selected objects */
  35. /* ------------------------------------------- */
  36. i = 0
  37. DO WHILE Result ~= 0
  38.    i = i + 1
  39.    ObjId.i = Result
  40.    NextObject ObjId.i SELECTED
  41. END
  42.  
  43. /* ---------------------------------------- */
  44. /* Loop through all of our objects creating */
  45. /* a shadow box for each one.               */
  46. /* ---------------------------------------- */
  47. x = 0
  48. DO WHILE (x < i)
  49.    x = x + 1
  50.    /* ----------------------------------------- */
  51.    /* Find out the type of the object. We don't */
  52.    /* want to draw a shadow for lines, arrows   */
  53.    /* arcs, shapes, or groups.                  */
  54.    /* ----------------------------------------- */
  55.    GetObjectType ObjId.x
  56.    objtype = Result
  57.    IF (objtype ~= 2 & objtype ~= 3 & objtype ~= 8 & objtype ~= 9 & objtype ~= 10) THEN DO
  58.       /* ---------------------------------- */
  59.       /* Get the coordinates and parameters */
  60.       /* ---------------------------------- */
  61.       GetObjectCoords ObjId.x
  62.       coords = Result
  63.        PARSE VAR coords page left top width height
  64.  
  65.       GetObjectParams ObjId.x TEXTFLOW FLOWDIST
  66.       params = Result
  67.       PARSE VAR params tflow fdist
  68.  
  69.       bevel = ""
  70.       IF ( objtype = 5 ) THEN
  71.          bevel = "BEVEL"
  72.  
  73.       /* ----------------------------- */
  74.       /* Draw the shadow by offsetting */
  75.       /* the left and top values.      */
  76.       /* ----------------------------- */
  77.       left = left + XOffset
  78.       top  = top  + YOffset
  79.  
  80.       IF ( objtype = 6 ) THEN
  81.          DrawOval page left top width height
  82.       ELSE
  83.          DrawBox page left top width height bevel
  84.         shadowId = Result
  85.  
  86.       /* -------------------------------------------------- */
  87.       /* Now Set the object parameters keeping the textflow */
  88.       /* flow distance the same as the original object. Set */
  89.       /* fill to solid, lineweight to none and the colors   */
  90.       /* to black. Then send the new object to the back.    */
  91.       /* -------------------------------------------------- */
  92.       SetObjectParams shadowId TEXTFLOW tflow FLOWDIST fdist LINEWT "None" LINECOLOR "Black" FILL "Solid" FILLCOLOR "Black"
  93.       ObjectToBack shadowId
  94.    END
  95.  
  96. END
  97.  
  98.    SelectObject 0
  99.     Redraw
  100.  
  101.