Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!cs.utexas.edu!ut-emx!chrisj
From: chrisj@ut-emx.UUCP (Chris Johnson)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Centering Dialogs
Message-ID: <6371@ut-emx.UUCP>
Date: 26 Sep 88 22:36:47 GMT
References:  <10132@dartvax.Dartmouth.EDU> <537@uva.UUCP> <2411@uhccux.uhcc.hawaii.edu> <17588@apple.Apple.COM>
Reply-To: chrisj@emx.UUCP (Chris Johnson)
Organization: U.T. Austin Computation Center
Lines: 33

I have my own idea for how dialogs should be centered and since I haven't
seen anything quite like it suggested, here goes:

Center the dialog on the current position of the mouse pointer - almost.
To make this method work, it'll be necessary to check the would-be position
for the window against GrayRgn to make certain that the entire window will
be visible on the screen and to adjust it accordingly.  It would also be
necessary to have dialogs that appear on-top of existing modal dialogs center
themselves relative to the previous modal dialog to avoid "dialog drift" -
in other words if a series of modal dialogs which had their OK buttons in
(for example) the lower left corner of the dialog appeared one after another
then centering them on the mouse coordinates would generally be the same as
centering them on the coordinates of those buttons in the lower left corner and
the resulting series of dialogs would drift down and to the left until the
progression ran into the edge of the screen.

It seems to me that this approach will generally be most convenient for the
user.  It doesn't matter what screen the dialog shows up on, since it will 
always show up in the place most convenient for the user to interact with
it - the place where the mouse is.  If the dialog appears in response to a 
menu selection (and the selection is made with the mouse) the dialog will 
appear at the top of the screen, just beneath the menu bar - the user will
scarcely have to move the mouse to begin interacting with the dialog.  If the
dialog appears in response to an errant click or an invalid edit of some sort
in some obscure corner of a distant screen, the dialog will still be in the 
most convenient possible place for the user - both at what is most likely to
be the center of his attention, and at the place he can most readily get to 
with the mouse.

Anyway, it makes sense to me.

----Chris Johnson