home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / mac / programm / 20815 < prev    next >
Encoding:
Internet Message Format  |  1993-01-06  |  1.8 KB

  1. Path: sparky!uunet!mcsun!uknet!bilpin!news
  2. From: mark@bilpin.co.uk (Mark Allerton)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: How do I make my windows handle a multiple-monitor system?
  5. Message-ID: <1993Jan6.132756.15386@bilpin.co.uk>
  6. Date: 6 Jan 93 13:27:56 GMT
  7. References: <1993Jan5.193034.19490@netcom.com>
  8. Sender: news@bilpin.co.uk (NetNews Administrator)
  9. Reply-To: mark@bilpin.co.uk (Mark Allerton)
  10. Organization: SRL Data
  11. Lines: 39
  12.  
  13. Brian Kendig writes:
  14. ------
  15. The windows in my program work just fine with a single-monitor system,
  16. but they have problems when the user tries to drag or zoom them on a
  17. Macintosh with more than one monitor connected to it.
  18.  
  19. To drag the window, I just set up a drag rect with
  20.  
  21.     dragRect = screenBits.bounds;
  22.     dragRect.left += DRAG_THRESHOLD;
  23.     dragRect.right -= DRAG_THRESHOLD;
  24.     dragRect.bottom -= DRAG_THRESHOLD;
  25.  
  26. then do a DragWindow(whichWindow, theEvent.where, &dragRect). 
  27. etc.
  28. --------
  29.  
  30. How big is DRAG_THRESHOLD?
  31.  
  32. The thing is that (you may already know this) screenBits.bounds
  33. defines the bounds of the *main screen*, rather than the rectangle
  34. that encloses all of the screens (which you can get by looking at
  35. the rgnBBox field of the region returned by GetGrayRgn.)
  36.  
  37. Fortunately for people who wrote thier code before multi-screen
  38. Macs arrived, and to make life easier for everybody, DragWindow
  39. checks to see how close the drag rectangle is to screenBits.bounds,
  40. and if it's close enough, allows the user to drag across all of the
  41. screens. I can't remember offhand what "close" is defined as, but
  42. I think it's within 6 pixels at left, right and bottom (top being
  43. different because it's normally adjusted to allow for the menu 
  44. bar.)
  45.  
  46. So if DRAG_THRESHOLD is too big, you'll end up stuck on the main 
  47. screen...
  48.  
  49.  
  50. Mark Allerton - mark@bilpin.co.uk
  51. SRL Data, but I speak for myself.
  52.