home *** CD-ROM | disk | FTP | other *** search
/ Merciful 3 / Merciful_Release_3.bin / software / f / finalwriter / finalwriterv5.03h.dms / finalwriterv5.03h.adf / FWMacros.lha / GfxNudge_Right < prev    next >
Text File  |  1993-10-25  |  2KB  |  81 lines

  1. /* ================================================= */
  2. /* Move the currently selected objects to the right  */
  3. /* by 45 micropoints.                                */
  4. /* FinalWriter macro written by Ric Fischer - 7/9/93 */
  5. /* $VER: GfxNudge_Right 3.0 (21.7.93)                */
  6. /* ================================================= */
  7.  
  8. Options Results
  9.  
  10. I = 0
  11. X = 0
  12.  
  13. /* --------------------------------------- */
  14. /* All measurement will be in micropoints. */
  15. /* --------------------------------------- */
  16. SetMeasure MICROPOINTS
  17.  
  18. /* ------------------------------------------- */
  19. /* Get the id of the first selected object.    */
  20. /* If there are no objects selected then quit. */
  21. /* ------------------------------------------- */
  22. FirstObject SELECTED
  23.  
  24. IF ( Result = 0 ) THEN
  25.    EXIT
  26.  
  27. /* ------------------------------------------- */
  28. /* Collect the ids of all the selected objects */
  29. /* ------------------------------------------- */
  30. DO WHILE Result ~= 0; I = I + 1
  31.    Objects.I = Result
  32.    NextObject Objects.I SELECTED
  33.    END
  34.  
  35. /* ------------------------------------- */
  36. /* Loop through all of our object moving */
  37. /* each one to the left.                 */
  38. /* ------------------------------------- */
  39. DO WHILE X < I; X = X + 1
  40.    GetObjectType Objects.X
  41.    ObjType = Result
  42.    GetObjectCoords Objects.X
  43.    Coords = Result
  44.    PARSE VAR Coords Page x1 y1 x2 y2
  45.  
  46.    IF (ObjType = 2) | (ObjType = 3) THEN
  47.       IF (x1 > 12195) | (x2 > 12195) THEN
  48.          DO
  49.             IF x1 > 12195 THEN
  50.                do
  51.                   x2 = x2 + (12240 - x1)
  52.                   x1 = 12240
  53.                END
  54.             ELSE
  55.                IF x2 > 12195 THEN
  56.                   DO
  57.                      x1 = x1 + (12240 - x2)
  58.                      x2 = 12240
  59.                   END
  60.          END
  61.       ELSE
  62.          DO
  63.             x1 = x1 + 45
  64.             x2 = x2 + 45
  65.          END
  66.   ELSE
  67.       IF (x1 > 12195) THEN x1 = 12240; ELSE x1 = x1 + 45
  68.    SetObjectCoords Objects.X Page x1 y1 x2 y2
  69. END
  70.  
  71. /* ------------------------------- */
  72. /* Reselect all of our objects and */
  73. /* redraw to show our changes.     */
  74. /* ------------------------------- */
  75. X = 0
  76. DO WHILE X < I; X = X + 1
  77.    SelectObject Objects.X MULTIPLE
  78.    End
  79.  
  80. Redraw
  81.