Cross-platform AlertLoc

FlexibleLearning at aol.com FlexibleLearning at aol.com
Sun Sep 11 08:07:35 EDT 2005


One for your Scrapbook...
 
This now takes care of the Mac menubar (thanks, Sarah!)
 
on preOpenStack
  set the loc of this stack to alertLoc()
end preOpenStack
 
function alertLoc
if "Win32" is in the platform  then
if the mode of this stack is in "1,2" then put 30  into n # Toplevel titleBar 
height
else put 22 into n #  Palette, modeless and modal titlebar height
else
if the mode of this stack is in "1,2" then put 23 into n # Toplevel titleBar  
height
else put 16 into n # Palette, modeless and modal  titlebar height
end if
if the decorations of this stack =""  then put n-n into n
get the windowBoundingRect
put round(  (the width of this stack /2) + ((item 3 of it - item 1 of it) - 
the width of  this stack)/2) + item 1 of it into x
put round( (the height of this  stack /2) + ((item 4 of it - item 2 of it) - 
the height of this stack +n)/3) +  item 2 of it into y
if "win32" is in the platform then return  x,y
else return x,max(44,y) # Accommodate Mac menubar
end  alertLoc
 
 
/H
FLCo
Home of the Scripter's Scrapbook
www.FlexibleLearning.com/ssbk.htm



More information about the Use-livecode mailing list