[futurebasic] Re: [FB] Obtaining size and position of Appearance buttons

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

From: Brian Stevens <brilor@...>
Date: Mon, 12 Jul 2004 21:02:23 -0700
On Jul 12, 2004, at 4:32 PM, Steve Crossman wrote:

> How come not all appearance buttons will generate an event when the 
> mouse is rolled over it?

I can tell you I've fought the same battle and finally built an ON 
EVENT FN to handle mouse button down events before the runtime. Here is 
a partial listing of some code to give you the idea.

It basically looks like:
local FN doEvent
dim ev as ^EventRecord
dim as int i, oldWind, day
dim as WindowRef @ evntWnd, wNum
dim as rect        btnRect
dim as point       mousePt
dim as short       whatPart
dim as str63       ef,buttoncontent
dim as long topItem,lineSelected

ev = event
select ev.what

'case _nullEvt


case _mButDwnEvt
wNum = mouse(_mouseWindow)
select wNum
case _MyWnd

mousePt = ev.where
GlobalToLocal(mousePt)

fn FBGetControlRect(button&(_aStaticEditField), btnRect)
long if fn PtInRect(mousePt, btnRect)
fn doSomething
ev.what = _nullEvt'tells FB runtime not to do anything with this
exit fn
end if