>How can I do that?, open a MIAW centered?

In your code to open the MIAW:

   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

and the handlers it calls:

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

on CenterRectAround aRect, aPoint
   rectCtr = RectCenter(aRect)
   return offset(aRect, aPoint.locH - rectCtr.locH, aPoint.locV - rectCtr.locV)
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



[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/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