home *** CD-ROM | disk | FTP | other *** search
/ Merciful 3 / Merciful_Release_3.bin / software / f / finalwriter / finalwriterv5.04ukver.lha / FinalWriter_B / FWMacros / GfxNudge_Up < prev    next >
Text File  |  1993-10-25  |  2KB  |  81 lines

  1. /* ================================================= */
  2. /* Move the currently selected objects up by 45      */
  3. /* micropoints.                                      */
  4. /* FinalWriter macro written by Ric Fischer - 7/9/93 */
  5. /* $VER: GfxNudge_Up 3.0 (22.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 up.                          */
  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 (y1 < 46) | (y2 < 46) THEN
  48.          DO
  49.             IF y1 < 46 THEN
  50.                DO
  51.                   y2 = y2 - y1
  52.                   y1 = 0
  53.                END
  54.             ELSE
  55.                IF y2 < 46 THEN
  56.                   DO
  57.                      y1 = y1 - y2
  58.                      y2 = 0
  59.                   END
  60.          END
  61.       ELSE
  62.          DO
  63.             y1 = y1 - 45
  64.             y2 = y2 - 45
  65.          END
  66.   ELSE
  67.       IF (y1 < 46) THEN y1 = 0; ELSE y1 = y1 - 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.