Part of the Samples Website. 8/16/97.

samples.basicStuff.windowFormatter

«Resizes and places the Frontier window following standard rules.
«Used in the Format Windows command in the Table menu.
«http://www.scripting.com/frontier/menus/table.html
on windowFormatter (adrWindow)
on doformat (w)
local (height, width, t, l)
msg (w)
try
edit (w)
target.set (w)
on formatoutline (font, fontsize)
editmenu.setfont (font)
editmenu.setfontsize (fontsize)
op.firstsummit ()
op.fullexpand ()
window.zoom (w)
op.fullcollapse ()
op.expand (1)
if typeof (w^) == scripttype «make glue scripts look more reasonable
if op.countSummits () == 1
op.go (right, 1)
while true
op.expand (1)
if not op.go (down, 1)
break
op.firstsummit ()
case typeof (w^)
outlinetype
formatoutline ("geneva", 12)
scripttype
formatoutline ("geneva", 12)
script.uncompile (w)
menubartype
formatoutline ("chicago", 12)
tabletype
table.go (up, infinity)
editmenu.setfont ("geneva")
editmenu.setfontsize (12)
window.zoom (w)
wptexttype
wp.setSelect (0, 0)
window.scroll (down, infinity)
«window.getPosition (w, @t, @l)
bundle «center the window
local (maxheight = 420, maxwidth = 500)
window.getSize (w, @width, @height)
if height > maxheight
height = maxheight
if width > maxwidth
width = maxwidth
window.setSize (w, width, height)
l = (maxwidth - width) / 2
t = (maxheight - height) / 2
if t < 50
t = 50
if l < 20
l = 50
window.setPosition (w, l, t)
window.update (w)
close (w)
target.clear ()
return (true)
on visit (adr)
if timecreated (adr) [not equal] 0 «the object is displayed in its own window
doformat (adr)
case typeof (adrWindow^)
tabletype
table.visit (adrWindow, @visit)
else
doformat (adrWindow)
filemenu.save ()


This page was last built on Sat, Aug 16, 1997 at 6:42:15 PM. You can download the current set of sample scripts from our FTP site. Dave