> I have a projector in 800x600 (centred) and when i create the miaw and
> change the screensize
> to 1024x768 the miaw is not on the right place, so i want the Miaw, to
> follow the position of the projector on the screen

Bob,

I use something like this to center a MIAW. The MIAW is usually smaller than 
the stage, but you can probably adapt this:

  dlogWindow = window (dlogPathName)
  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

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
  topLeft = point(aRect.left, aRect.top)
  botRight = point(aRect.right, aRect.bottom)
  
  return topLeft + ((botRight - topLeft)/2)
end


Cordially,

Kerry Thompson

[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