home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / WordProcessors / slt-pgs3.lzx / PageStream3 / Scripts / PictureCalculator.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1997-06-26  |  2.0 KB  |  65 lines

  1. /* $VER: PictureCalculator.rexx 1.0 (25.06.97)
  2.    Copyright 1997 SoftLogik Publishing Corporation
  3.    May not be distributed without SoftLogik Publishing Corporation's express written permission */
  4.  
  5. OPTIONS RESULTS
  6. TRACE OFF
  7.  
  8. /* Make sure rexx support is opened */
  9. IF ~SHOW('L','rexxsupport.library') THEN
  10.    CALL ADDLIB('rexxsupport.library',0,-30)
  11.  
  12. ADDRESS 'PAGESTREAM'
  13.  
  14. /* Check and see if one picture is selected */
  15. getobject type objtype
  16. if objtype~=12 then do
  17.     ADDRESS 'PAGESTREAM'
  18.     allocarexxrequester '"Picture Calculator Error!"' 368 59
  19.     reqhandle=result
  20.     addarexxgadget reqhandle EXIT 286 42 70 label "_Exit"
  21.         Exithandle=result
  22.     addarexxgadget reqhandle TEXT 8 10 352 border none string "'One picture must be selected.'"
  23.     addarexxgadget reqhandle TEXT 8 20 352 border none string "'Select only one picture and try again.'"
  24.     doarexxrequester reqhandle
  25.     freearexxrequester reqhandle
  26.     EXIT
  27. end
  28.  
  29. getpicture position pStem bitmapsize bStem
  30.  
  31. allocarexxrequester '"Picture Calculator v1.0"' 282 85
  32.     hReq=result
  33. addarexxgadget hReq EXIT 12 68 70 label "OK"
  34.     hOkGadget=result
  35. addarexxgadget hReq EXIT 200 68 70 label "Cancel"
  36.     hCancelGadget=result
  37.  
  38. addarexxgadget hReq TEXT 12 10 128 string '"Size (pixels)"' 
  39. addarexxgadget hReq TEXT 164 10 100 string '"Resolution"'
  40.  
  41. addarexxgadget hReq TEXT 64 26 70 label '"Width"' string bStem.w BORDER RECESSED
  42. addarexxgadget hReq TEXT 64 42 70 label '"Height"' string bStem.h BORDER RECESSED
  43.  
  44. addarexxgadget hReq STRING 200 26 70 label '"_XDPI"' string bStem.xdpi
  45.     hXDPI=result
  46. addarexxgadget hReq STRING 200 42 70 label '"_YDPI"' string bStem.ydpi
  47.     hYDPI=result
  48.  
  49. doarexxrequester hReq
  50.     action=result
  51. if action=hCancelGadget then RETURN cancel
  52.  
  53. getarexxgadget hReq hXDPI string
  54.     bStem.xdpi=result
  55.  
  56. getarexxgadget hReq hYDPI string
  57.     bStem.ydpi=result
  58.  
  59. pStem.right = '"'||pStem.left||'+'||(bStem.w / bStem.xdpi)||'i"'
  60. pStem.bottom = '"'||pStem.top||'+'||(bStem.h / bStem.ydpi)||'i"'
  61.  
  62. editpicture position pStem.left pStem.top pStem.right pStem.bottom FRAMELESS
  63.  
  64. freearexxrequester hReq
  65.