home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!apple!goofy!mumbo.apple.com!gallant.apple.com!NewsWatcher!user
- From: nerm@apple.com (Dean Yu)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: Saving window position
- Message-ID: <nerm-250193114535@17.202.128.133>
- Date: 25 Jan 93 19:46:26 GMT
- References: <1993Jan25.140957.24643@ghost.dsi.unimi.it>
- Sender: news@gallant.apple.com
- Followup-To: comp.sys.mac.programmer
- Organization: Apple Computer, Inc.
- Lines: 40
-
- In article <1993Jan25.140957.24643@ghost.dsi.unimi.it>,
- piovanel@ghost.dsi.unimi.it (marco piovanelli) wrote:
- >
- > 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?
-
- Well, you could always use GetDateTime()/SetDateTime()... JUST KIDDING!
-
- >
- > 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
-
- The currently favored method is if the user can still get to the title
- bar from where the window currently is, leave it alone.
-
- -- Dean Yu
- Blue Meanie, Negative Ethnic Role Model, etc.
- Apple Computer, Inc.
-