[futurebasic] Re: [FB] [FB^3] Obscure roach

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : July 2001 : Group Archive : Group : All Groups

From: Chris Stasny <staz@...>
Date: Tue, 31 Jul 2001 09:19:11 -0500
Rather than trying to fix the code as written, may I suggest an 
alternative that is shorter and easier?

The top left coordinate of the window is always 0,0. Just set the 
point to that and use LOCALTOGLOBAL. Be sure that the correct port is 
set at the time.


>I'm trying to track down a bug, in my FB^3 Clock program.
>
>I've added an alarms feature, and now the clock window won't remember where
>it was on the screen between launches
>
>Specs:
>FB^3 Release 5 - Rntm Ultralite.INCL
>(the prob was in release 4 as well)
>
>When the app quits, it saves some prefs in a prefs file.
>
>The prefs are stored as a resource.
>when the app launches, it opens the prefs file, gets the prefs rsrc then
>detaches the handle, closes the pref file's resource file, and then uses the
>handle when the apps needs to see how the user wants something done.
>
>
>when the app is quiting, it gets the clock window's portrect, converts it to
>global coords:
>
>/* Save the clock window's current location */
>gPrefsH..clockWndCoords = gClockWndPtr.portRect
>localtoglobal(gPrefsH..clockWndCoords)
>
>This is the 3rd or 4th version of the code above
>
>
>clockWndCoords is defined as:
>
>begin record prefsRec/* Prefs record format */
>dim display12or24hourMode       as int
>dim clockWndCoords                   as point
>dim tallOrWideScreenMode         as int
>dim drawTheTextOnTheleftOrRight as int
>
>dim dayColour  as rgbcolor
>dim niteColour as rgbcolor
>dim textColour as rgbcolor
>end record
>
>dim gPrefsH as handle to prefsRec
>
>
>I've put in debugging code to see what clockWndCoords is after, and there's
>some glitch, because after the LOCALTOGLOBAL clockWndCoords is still 0
>(zero) for both the h & v
>
>Does anyone have a suggestion about what I'm doing wrong ?
>
>The prefs handle appears to be ok, because none of the other prefs are
>damaged...
>
>tia
>
>pete...
>
>
>--
>To unsubscribe, send ANY message to <futurebasic-unsubscribe@...>



Best,

-STAZ  ~)~

800.348.2623 Orders  http://www.stazsoftware.com
228.255.7086 FAX     mailto:staz@...