>i am trying to get my head around positioning miaw's.

Here's how I do it with a type 5 window--should work for other types as well.

   stageRect = rect(the stageLeft, the stageTop, the stageRight, the 
stageBottom)
   DLOGRect = CenterRectWithin(dlogWindow.sourceRect, stageRect)
   DLOGRect = offset(DLOGRect, 0, -20) -- tweak dlog a little above dead 
center.
   dlogWindow.rect = DLOGRect
   dlogWindow.windowType = dlogWindowType
   dlogWindow.modal = 1
   open dlogWindow

You'll need the following utility handlers, too:

on CenterRectWithin aRect, inRect
   inRectCtr = RectCenter(inRect)
   return CenterRectAround(aRect, inRectCtr)
end

on RectCenter aRect
   if not ilk(aRect, #rect) then
     alert "Non-rectangle passed to RectCenter function."
   end if

   topLeft = point(aRect.left, aRect.top)
   botRight = point(aRect.right, aRect.bottom)

   return topLeft + ((botRight - topLeft)/2)
end

on CenterRectAround aRect, aPoint
   rectCtr = RectCenter(aRect)
   return offset(aRect, aPoint.locH - rectCtr.locH, aPoint.locV - rectCtr.locV)
end




Cordially,

Kerry Thompson


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to