Message Box placement
Ray Horsley
ray at linkitonline.com
Sun Sep 7 12:43:00 EDT 2003
Here's a handler I use for all window placements. Feel free to use it.
Ray Horsley
Developer, LinkIt! Software
________________________________________________________________________
on placeWindow win,placeWhere
put the screenRect into scrRct
if placeWhere = "Center" then
put (item 3 of scrRct - width of window win)/2 into tmpNum
put round(tmpNum) into myTopLeft
put (item 4 of scrRct - height of window win)/2 into tmpNum
put round(tmpNum) into item 2 of myTopLeft
if placeWhere = "CenterHigh" then
subtract 50 from item 2 of myTopLeft
else if placeWhere = "CenterLow" then
add 50 to item 2 of myTopLeft
end if
if win = "Print Tests" and the platform = "MacOS" then put 40 into
item 2 of myTopLeft
set topLeft of window win to myTopLeft
else if placeWhere = "TopLeft" then
if the platform = "MacOS" then
set topLeft of window win to "0,20"
else set topLeft of window win to "0,0"
else if placeWhere = "CenterRight" then
put item 3 of scrRct - width of window win - 5 into myTopLeft
put (item 4 of scrRct - height of window win)/2-3 into tmpNum
put round(tmpNum) into item 2 of myTopLeft
set topLeft of window win to myTopLeft
else if placeWhere = "CenterBottom" then
put (item 3 of scrRct - width of window win)/2 into tmpNum
put round(tmpNum) into myTopLeft
put (item 4 of scrRct - height of window win)-3 into tmpNum
put round(tmpNum) into item 2 of myTopLeft
if the platForm is not "MacOS" then put (item 2 of myTopLeft)-32 into
item 2 of myTopLeft
set topLeft of window win to myTopLeft
else if placeWhere = "CenterTop" then
put (item 3 of scrRct - width of window win)/2 into tmpNum
put round(tmpNum) into myTopLeft
put 42 into item 2 of myTopLeft
set topLeft of window win to myTopLeft
end if
end placeWindow
More information about the metacard
mailing list