[futurebasic] Re: [FB] Getting tab rects

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 2003 : Group Archive : Group : All Groups

From: Robert Purves <robert.purves@...>
Date: Sun, 5 Oct 2003 17:02:32 +1300
On Sunday, October 5, 2003, at 07:51  AM, Bernie Wylde wrote:

> We can get a control rect with   fn 
> FBGetControlRect(button&(ctrlID),r)   but any ideas how I can get 
> individual tab rects of a tab control?


FBGetControlRect is just a kludge wrapper for the real function 
GetControlBounds which you can call directly:
   GetControlBounds( button&( ctrlID ), @r )

Assuming that the tab control has embedded controls whose Rects you 
want, do something like this:

dim as ControlRef  c, @ cSub
dim as short       index, @ count
dim as Rect        r

c = button&( tabBtnID )
long if ( fn CountSubcontrols( c, @count ) == _noErr )
  index = 1
  while ( index <= count )
   long if ( fn GetIndexedSubcontrol( c, index, @cSub ) == _noErr )
     GetControlBounds( cSub, @r )
    //...do something with the Rect r
   end if
   index++
  wend
end if


Robert P.