/* RotateAbout.rexx */
/* Copyright 1994 Soft-Logik Publishing Corporation */
/* May not be distributed without Soft-Logik Publishing Corporation's express written permission */
/* $VER: 1.0 alpha 1 */

OPTIONS RESULTS
TRACE OFF

ADDRESS 'PAGESTREAM'

/* Are there any object selected? */
/* get** no way to do this yet
if result=0 then signal CANCEL*/

/* Allocate requester */
allocarexxrequester '"Rotate About Point"' 274 93
reqhandle=result

/* Add gadgets */
addarexxgadget reqhandle EXIT 12 76 70 label "_Ok"
    Okhandle=result
addarexxgadget reqhandle EXIT 194 76 70 label "_Cancel"
    Cancelhandle=result
addarexxgadget reqhandle TEXT 8 8 128 highdata true border none string "'Rotation Amount'"
addarexxgadget reqhandle STRING 12 22 122 label "_Rotate" string "0°"
    rotatehandle=result
addarexxgadget reqhandle STRING 20 36 114 label "_Slant" string "0°"
    slanthandle=result
addarexxgadget reqhandle STRING 20 50 114 label "_Twist" string "0°"
    twisthandle=result
addarexxgadget reqhandle TEXT 146 8 120 highdata true border none string "'Rotation Point'"
addarexxgadget reqhandle STRING 158 22 106 label "_Horz" string '0"'
    horzhandle=result
addarexxgadget reqhandle STRING 158 36 106 label "_Vert" string '0"'
    verthandle=result
addarexxgadget reqhandle CHECKBOX 158 52 106 label "_Center" checked false
    checkhandle=result

/* Show requester */
doarexxrequester reqhandle

/* If Cancel, then exit */
if result=CancelHandle then signal CANCEL

/* Get gadget status */
getarexxgadget reqhandle rotatehandle string
rot=result
getarexxgadget reqhandle slanthandle string
sla=result
getarexxgadget reqhandle twisthandle string
twi=result
getarexxgadget reqhandle horzhandle string
horz=result
getarexxgadget reqhandle verthandle string
vert=result
getarexxgadget reqhandle checkhandle checked
center=result

/* rotate the selected objects */
refresh wait
editobject aboutcenter
if center=1 then editobject about horz vert
if rot~=0 then editobject rotate rot
if sla~=0 then editobject slant sla
if twi~=0 then editobject twist twi
refresh continue

/* Show results in console window */
open('console', 'CON:0/11/640/100/RequesterFeedback/SCREEN PageStream3', 'W')
writeln('console', 'rotate:  'rot)
writeln('console', 'slant: 'sla)
writeln('console', 'twist: 'twi)
writeln('console', 'horz: 'horz)
writeln('console', 'vert: 'vert)
writeln('console', 'center: 'center)

/* pause */
call time('R')
kount=time('E')
do while kount<2
    kount=time('E')
end

/* clean up and exit */
CANCEL:
freearexxrequester reqhandle
exit
return 0
