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