home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / mac / programm / 22121 < prev    next >
Encoding:
Text File  |  1993-01-25  |  1.6 KB  |  38 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!gatech!rpi!ghost.dsi.unimi.it!piovanel
  3. From: piovanel@ghost.dsi.unimi.it (marco piovanelli)
  4. Subject: Saving window position
  5. Organization: Computer Science Dep. - Milan University
  6. Date: Mon, 25 Jan 1993 14:09:57 GMT
  7. Message-ID: <1993Jan25.140957.24643@ghost.dsi.unimi.it>
  8. Summary: How do I save window positions without changing a file's modification d
  9. Lines: 27
  10.  
  11. I've decided to implement automatic saving of window positions in my
  12. application.  I've tried to cling as closely as possible to the
  13. guidelines expounded in IM VI (User Interface Guidelines).
  14. However some points remain obscure:
  15.  
  16. 1. IM VI says that if the user opens a document, moves its window around
  17.    and then closes the document without making any changes, my app is
  18.    supposed to save the new window position without asking anything and
  19.    without CHANGING THE FILE'S MODIFICATION DATE.
  20.    I implement this with by doing a PBGetCatInfoSync() when I open
  21.    the document file and a PBSetCatInfoSync() after I modify and close it.
  22.    Is this the recommended way?  Is there an easier way?
  23.  
  24. 2. When a document is opened, I check to see if the saved window
  25.    position makes sense for the current monitor(s).  I have a function
  26.    declared as follows:
  27.  
  28.    FUNCTION WindowInDesktop(VAR windowFrame: Rect): Boolean;
  29.  
  30.    The function returns TRUE if windowFrame is COMPLETELY ENCLOSED
  31.    in the Gray Region.  But other applications (e.g. the Finder and
  32.    StuffIt Lite) restore the window position even if the window frame
  33.    is mostly offscreen.  What is the correct algorithm?
  34.  
  35. Thank you in advance for any suggestion.
  36.  
  37.                     -- marco
  38.