home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / WordProcessors / pgs-ps36.dms / in.adf / Macros.LHA / PlaceGraphicAt.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1995-08-23  |  1.5 KB  |  59 lines

  1. /* $VER: PlaceGraphicAt.rexx 1.0a (03.24.95)
  2.    Copyright 1995 Soft-Logik Publishing Corporation
  3.    May not be distributed without Soft-Logik Publishing Corporation's express written permission */
  4.  
  5. /* Bugfix 09.09.95 Carsten A. Duske */
  6.  
  7. OPTIONS RESULTS
  8. TRACE OFF
  9.  
  10. /* Make sure rexx support is opened */
  11. IF ~SHOW('L','rexxsupport.library') THEN
  12.   CALL ADDLIB('rexxsupport.library',0,-30)
  13. IF ~SHOW('L','softlogik:libs/slarexxsupport.library') THEN
  14.   CALL ADDLIB('softlogik:libs/slarexxsupport.library', 0, -30)
  15.  
  16. ADDRESS 'PAGESTREAM'
  17.  
  18. /* SELECT THE GRAPHIC */
  19. 'REFRESH WAIT'
  20. 'PLACEGRAPHIC STATUS'
  21. IF rc~=0 THEN SIGNAL CANCEL
  22.  
  23. /* GET THE OBJECT ID AND TYPE */
  24. 'GETOBJECT TYPE OBJTYPE'
  25. objnum = result
  26.  
  27. /* POSITION THE PICTURE */
  28. 'GETREGION COORD MESSAGE "Click or drag to place the picture."'
  29. IF rc=10 THEN DO
  30.   'DELETEOBJECT'
  31.   SIGNAL CANCEL
  32. END
  33.  
  34. boxw = ABS(P2D(coord.x1) - P2D(coord.x2))
  35. boxh = ABS(P2D(coord.y1) - P2D(coord.y2))
  36.  
  37. IF (boxw<0.25) | (boxh<0.25) THEN DO
  38.   IF objtype=12 THEN 'GETPICTURE POSITION PSTEM'
  39.   IF objtype=2 THEN 'GETDRAWING POSITION PSTEM'
  40.   IF objtype=13 THEN 'GETEPS POSITION PSTEM'
  41.   objw = ABS(P2D(pstem.right) - P2D(pstem.left))
  42.   objh = ABS(P2D(pstem.top) - P2D(pstem.bottom))
  43.   coord.x2 = P2D(coord.x1) + objw
  44.   coord.y2 = P2D(coord.y1) + objh
  45. END
  46.  
  47. IF objtype=12 THEN 'EDITPICTURE POSITION' coord.x1 coord.y1 coord.x2 coord.y2
  48. IF objtype=2 THEN 'EDITDRAWING POSITION' coord.x1 coord.y1 coord.x2 coord.y2
  49. IF objtype=13 THEN 'EDITEPS POSITION' coord.x1 coord.y1 coord.x2 coord.y2
  50.  
  51. 'REFRESH CONTINUE'
  52.  
  53. EXIT
  54.  
  55.  
  56. CANCEL:
  57. 'REFRESH CONTINUE'
  58. EXIT
  59.