Path: utzoo!attcan!uunet!ndsuvax!nopuklic From: nopuklic@ndsuvax.UUCP (Blayne Puklich) Newsgroups: comp.sys.mac.programmer Subject: Re: Centering Dialogs Message-ID: <1320@ndsuvax.UUCP> Date: 20 Sep 88 02:32:24 GMT References:Reply-To: nopuklic@ndsuvax.UUCP (Blayne Puklich) Organization: North Dakota State University Fargo, ND Lines: 49 In article rj0z+@andrew.cmu.edu (Robert George Johnston, Jr.) writes: > > Centering alert and dialog boxes is relative straight forward >on a single screen system, but what do you do when there are two or >more screens connected to the system? I tried to find some mention >of how this should be handled in IM, but did not. > There are several ways this could be done: (1) Center over >ScreenBits.Bounds, which would probably put the dialog between screens. >(2) Always center on the main screen (the one with the menu bar). (3) >Try to locate the screen with the frontmost window, and center on it. >(4) Center the dialog on the screen that the cursor is currently >pointing on. > The problem is that I only have one screen, and want my programs >to work correctly on bigger systems. I have already implemented the >fourth (4) method. Anyone think that it should be done differently or >have any other methods? > > Rob Johnston. IM volume V says that one should use the global GrayRgn (on page 121) for pinning and such. However, I think you're right that it should be centered on the screen where the cursor is. That would sure help the user out somewhat since less mouse travel would be required. On the other hand, it might be more appropriate to center the dialog on the screen where the menu bar is, since the user needs to use the menu bar to make a dialog appear generally. That would mean the cursor would be on the screen with the menu bar, and would alleviate your problem of which screen to center on. This would be meaningless, of course, if your application brought dialogs up for button/icon hits in any window on another screen. What may be the actual solution might depend on where the dialog gets invoked from. If it is a result of a menu command, I'd think that it would be more appropriate to center it where the menu bar was. If it was the result of a button hit, center it where the button is. Of course this is my own strange and sometimes wrong inter- pretation of the problem, but I think it makes sense. Hope this helps fuel discussion, because this may become a problem for some of us in the future. ||+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++|| || Blayne Puklich nopuklic@plains.NoDak.edu || || NDSU Student ACM NU087763@NDSUVM1.bitnet || || Chairperson North Dakota State University, Fargo, ND || || || || "Everyone should have a Corvette, I think." || || NOTE: If nopuklic@plains.NoDak.edu bounces, revert to || || nopuklic@ndsuvax.BITNET. || ||-------------------------------------------------------------------------||