home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / WordProcessors / PAGESTREAM3,0-1.DMS / in.adf / Macros.LHA / ReplaceGraphic.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1994-08-31  |  2.5 KB  |  60 lines

  1. /* ReplaceGraphic.rexx */
  2. /* Copyright 1994 Soft-Logik Publishing Corporation */
  3. /* May not be distributed without Soft-Logik Publishing Corporation's express written permission */
  4. /* $VER: 1.0 */
  5.  
  6. OPTIONS RESULTS
  7. TRACE OFF
  8.  
  9. /* Make sure rexx support is opened */
  10. IF ~SHOW('L','rexxsupport.library') THEN
  11.    CALL ADDLIB('rexxsupport.library',0,-30)
  12.  
  13. ADDRESS 'PAGESTREAM'
  14.  
  15. /* Check and see if a box or graphic is selected */
  16. 'getobject type objtype'
  17. objnum=result
  18. /* object types: 12:picture, 5:box, 2:drawing, 13:eps */
  19. if objtype=12 | objtype=5 | objtype=2 | objtype=13 then do
  20.     'refresh wait'
  21.     if objtype=12 then getpicture position pstem rotation rstem about rstem contentoffset cstem contentscale cstem frame fflag constrain cflag print pflag
  22.     if objtype=5 then getbox position pstem rotation rstem about rstem constrain cflag print pflag
  23.     if objtype=2 then getdrawing position pstem rotation rstem about rstem contentoffset cstem contentscale cstem frame fflag constrain cflag print pflag
  24.     if objtype=13 then geteps position pstem rotation rstem about rstem contentoffset cstem contentscale cstem frame fflag constrain cflag print pflag
  25.     gettextwrap region wmode wrap wtype standoff wstem objectid objnum
  26.     placegraphic status
  27.     if rc~=0 then signal cancel
  28.     'getobject type nobjtype'
  29.     nobjnum=result
  30.     pstring=position' 'pstem.left' 'pstem.top' 'pstem.right' 'pstem.bottom' skew 'rstem.slant' 'rstem.twist
  31.     if fflag=ON then pstring=pstring' framed contentoffset 'cstem.x' 'cstem.y' contentscale 'cstem.h' 'cstem.v
  32.     if rstem.mode=POINT then pstring=pstring' about 'rstem.x' 'rstem.y
  33.     if cflag=ON then pstring=pstring' constrain'
  34.     if pflag=OFF then pstring=pstring' noprint'
  35.     if nobjtype=12 then 'editpicture 'pstring
  36.     if nobjtype=2 then 'editdrawing 'pstring
  37.     if nobjtype=13 then 'editeps 'pstring
  38.     if wtype~=NOWRAP then settextwrap wmode wtype standoff wstem.x wstem.y
  39.     deleteobject objectid objnum
  40.     selectobject objectid nobjnum
  41.     'refresh continue'
  42. end
  43. else do
  44.     allocarexxrequester '"Replace Graphic Error!"' 540 61
  45.     reqhandle=result
  46.     addarexxgadget reqhandle EXIT 235 44 70 label "_Exit"
  47.         Exithandle=result
  48.     addarexxgadget reqhandle TEXT 8 10 520 border none string "'A box or graphic must be selected to replace with a new graphic.'"
  49.     addarexxgadget reqhandle TEXT 8 22 520 border none string "'Select one box or graphic and choose Replace Graphic again.'"
  50.     doarexxrequester reqhandle
  51.     freearexxrequester reqhandle
  52.     EXIT
  53. end
  54. EXIT
  55.  
  56. CANCEL:
  57. selectobject objectid objnum
  58. 'refresh continue'
  59. EXIT
  60.