[futurebasic] Re: [FB] Window frame size

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

From: Chris Stasny <staz@...>
Date: Fri, 20 Apr 2001 08:54:30 -0500
>Hi,
>
>I'm trying to figure out how, other than trial and error, I can get the
>sized of a window's frame and title, outside of my content area.
>
>The Window statement sets the rect of the content area, but if I want to
>fill (or nearly fill) the screen with a window without having its title
>or edges bleeding offscreen, how do I calculate the size to specify?
>
>I know about deducting {_mbarHeight} from the screen rect, but that
>doesn't tell me anything about the window's title bar and frame.
>
>TIA,
>  0"0
>  =J= a  y


If you are using system 8.5 or newer, there are calls that handle this.

1) Include the new toolbox calls with INCLUDE "Tlbx 8.5 Window Mgr.Incl"
2) Make a call to GETWINDOWBOUNDS to get the info you need.

This program demonstrates:
INCLUDE "Tlbx 8.5 Window Mgr.Incl"

WINDOW 1
DIM structRect as rect
DIM contentRect as rect
DIM wPtr as ^cWindowRecord
DIM err as OSStatus

// GET the WINDOW pointer
GET WINDOW 1,wPtr


err = FN GetWindowBounds(wPtr,_kWindowStructureRgn,structRect )
err = FN GetWindowBounds(wPtr,_kWindowContentRgn  ,contentRect)

PRINT "Dim"   , "Structure"         , "Content"
PRINT "Top"   , structRect.top      , contentRect.top
PRINT "Left"  , structRect.left     , contentRect.left
PRINT "Bottom", structRect.bottom   , contentRect.bottom
PRINT "Right" , structRect.right    , contentRect.right

PRINT
PRINT "Click to continue"

DO
UNTIL FN BUTTON



Best,

-STAZ  ~)~

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