Subject: Re: Magnify in Viewer
>Hello,
>
>I am relatively new at OpenScript and I need to use the magnify command
>in a viewer. What I want is something like the magnify util. in the
>toolbar that appears in author mode. Does anyone have a copy of this
>script around?? I would really appreciate it if you could either mail
>me it or post it here!
>
I used the script below (from Erik Reitan) to create a magnifier in a
viewer. You could modify it for your purpose.
to handle buttonclick -- name this a buttonClick handler to use a single buttonClick to update
-- the viewer rather than having a continuous update.
loc = sysMousePosition
linkDLL "TB30WIN.DLL"
INT xUnitsFromPixels(INT)
INT yUnitsFromPixels(INT)
end
if isOpen of viewer "mag" = false
open viewer "mag"
end
-- find the center of viewer 'mag'
xCenter = (item 3 of bounds of viewer "mag" - item 1 of bounds of viewer "mag")/4
yCenter = (item 4 of bounds of viewer "mag" - item 2 of bounds of viewer "mag")/4
-- calculate the center in page units
xMouseCenter = item 1 of loc - xUnitsFromPixels(xCenter)
yMouseCenter = item 2 of loc - yUnitsFromPixels(yCenter)
-- magnify the viewer
in viewer "mag"
magnify 2
end
if xMouseCenter > 0 and yMouseCenter > 0
pageScroll of viewer "mag" = xMouseCenter, yMouseCenter
end
show viewer "mag"
currentPage of viewer "mag" = page "test"
show viewer "mag"
end