home *** CD-ROM | disk | FTP | other *** search
- /* Scales the current page proportionally.
- AREXX script by Greg Nies, Centaur Development.
- */
-
- address 'OpalPaint_Rexx'
-
- options Results
-
- SaveSetUp
-
- /* Ask for scale type */
-
- AskInt 1 3 1 "Choose scaling method:\n1 = Percentage 2 = Scale to width 3 = Scale to height.\nAll methods will scale proportionally."
- If RC = 5 Then EXIT
- ScaleMethod = Result
-
- /* Proportional gadget scaling */
-
- If ScaleMethod = 1 Then Do
- PageSize
- parse var result Width Height
- AskProp 0 100 50 "Current page size is "Width" x"Height".\nSelect scale percentage."
- If RC = 5 Then EXIT
- ScaleFactor = (Result/100) /* Set scale percentage */
- NewWidth = Trunc(Width*ScaleFactor)
- NewHeight = Trunc(Height*ScaleFactor)
- AskBool "New page size will be "NewWidth" x "NewHeight"."
- If Result = 0 Then EXIT
- PageSize NewWidth NewHeight
- RestoreSetUp
- EXIT
- End
-
- /* Scale by reference to width */
-
- If ScaleMethod = 2 Then Do
- PageSize
- parse var result Width Height
- AskInt 1 Width Width "Current page size is "Width" x"Height".\nEnter new page width.\n(Height will be scaled proportionally.)"
- If RC = 5 Then EXIT
- NewWidth = Result
- ScaleFactor = (Result/Width) /* Set height scale percentage */
- NewHeight = Trunc(Height*ScaleFactor)
- AskBool "New page size will be "NewWidth" x "NewHeight"."
- If Result = 0 Then EXIT
- PageSize NewWidth NewHeight
- RestoreSetUp
- EXIT
- End
-
- /* Scale by reference to height */
-
- If ScaleMethod = 3 Then Do
- PageSize
- parse var result Width Height
- AskInt 1 Height Height "Current page size is "Width" x"Height".\nEnter new page height.\n(Width will be scaled proportionally.)"
- If RC = 5 Then EXIT
- NewHeight = Result
- ScaleFactor = (Result/Height) /* Set width scale percentage */
- NewWidth = Trunc(Width*ScaleFactor)
- AskBool "New page size will be "NewWidth" x "NewHeight"."
- If Result = 0 Then EXIT
- PageSize NewWidth NewHeight
- RestoreSetUp
- EXIT
- End
-
- RestoreSetUp
- EXIT
-