home *** CD-ROM | disk | FTP | other *** search
- /* $VER: PictureCalculator.rexx 1.0 (25.06.97)
- Copyright 1997 SoftLogik Publishing Corporation
- May not be distributed without SoftLogik Publishing Corporation's express written permission */
-
- OPTIONS RESULTS
- TRACE OFF
-
- /* Make sure rexx support is opened */
- IF ~SHOW('L','rexxsupport.library') THEN
- CALL ADDLIB('rexxsupport.library',0,-30)
-
- ADDRESS 'PAGESTREAM'
-
- /* Check and see if one picture is selected */
- getobject type objtype
- if objtype~=12 then do
- ADDRESS 'PAGESTREAM'
- allocarexxrequester '"Picture Calculator Error!"' 368 59
- reqhandle=result
- addarexxgadget reqhandle EXIT 286 42 70 label "_Exit"
- Exithandle=result
- addarexxgadget reqhandle TEXT 8 10 352 border none string "'One picture must be selected.'"
- addarexxgadget reqhandle TEXT 8 20 352 border none string "'Select only one picture and try again.'"
- doarexxrequester reqhandle
- freearexxrequester reqhandle
- EXIT
- end
-
- getpicture position pStem bitmapsize bStem
-
- allocarexxrequester '"Picture Calculator v1.0"' 282 85
- hReq=result
- addarexxgadget hReq EXIT 12 68 70 label "OK"
- hOkGadget=result
- addarexxgadget hReq EXIT 200 68 70 label "Cancel"
- hCancelGadget=result
-
- addarexxgadget hReq TEXT 12 10 128 string '"Size (pixels)"'
- addarexxgadget hReq TEXT 164 10 100 string '"Resolution"'
-
- addarexxgadget hReq TEXT 64 26 70 label '"Width"' string bStem.w BORDER RECESSED
- addarexxgadget hReq TEXT 64 42 70 label '"Height"' string bStem.h BORDER RECESSED
-
- addarexxgadget hReq STRING 200 26 70 label '"_XDPI"' string bStem.xdpi
- hXDPI=result
- addarexxgadget hReq STRING 200 42 70 label '"_YDPI"' string bStem.ydpi
- hYDPI=result
-
- doarexxrequester hReq
- action=result
- if action=hCancelGadget then RETURN cancel
-
- getarexxgadget hReq hXDPI string
- bStem.xdpi=result
-
- getarexxgadget hReq hYDPI string
- bStem.ydpi=result
-
- pStem.right = '"'||pStem.left||'+'||(bStem.w / bStem.xdpi)||'i"'
- pStem.bottom = '"'||pStem.top||'+'||(bStem.h / bStem.ydpi)||'i"'
-
- editpicture position pStem.left pStem.top pStem.right pStem.bottom FRAMELESS
-
- freearexxrequester hReq
-