home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!bilpin!news
- From: mark@bilpin.co.uk (Mark Allerton)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: How do I make my windows handle a multiple-monitor system?
- Message-ID: <1993Jan6.132756.15386@bilpin.co.uk>
- Date: 6 Jan 93 13:27:56 GMT
- References: <1993Jan5.193034.19490@netcom.com>
- Sender: news@bilpin.co.uk (NetNews Administrator)
- Reply-To: mark@bilpin.co.uk (Mark Allerton)
- Organization: SRL Data
- Lines: 39
-
- Brian Kendig writes:
- ------
- The windows in my program work just fine with a single-monitor system,
- but they have problems when the user tries to drag or zoom them on a
- Macintosh with more than one monitor connected to it.
-
- To drag the window, I just set up a drag rect with
-
- dragRect = screenBits.bounds;
- dragRect.left += DRAG_THRESHOLD;
- dragRect.right -= DRAG_THRESHOLD;
- dragRect.bottom -= DRAG_THRESHOLD;
-
- then do a DragWindow(whichWindow, theEvent.where, &dragRect).
- etc.
- --------
-
- How big is DRAG_THRESHOLD?
-
- The thing is that (you may already know this) screenBits.bounds
- defines the bounds of the *main screen*, rather than the rectangle
- that encloses all of the screens (which you can get by looking at
- the rgnBBox field of the region returned by GetGrayRgn.)
-
- Fortunately for people who wrote thier code before multi-screen
- Macs arrived, and to make life easier for everybody, DragWindow
- checks to see how close the drag rectangle is to screenBits.bounds,
- and if it's close enough, allows the user to drag across all of the
- screens. I can't remember offhand what "close" is defined as, but
- I think it's within 6 pixels at left, right and bottom (top being
- different because it's normally adjusted to allow for the menu
- bar.)
-
- So if DRAG_THRESHOLD is too big, you'll end up stuck on the main
- screen...
-
-
- Mark Allerton - mark@bilpin.co.uk
- SRL Data, but I speak for myself.
-