[futurebasic] Re: Detecting floating window click

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

From: Ken Shmidheiser <kshmidheiser@...>
Date: Sat, 15 Nov 2003 16:02:09 -0500
In this thread, Bernie wrote:

>Thanks also for the suggestion but it only detects the first mouse
>click in the floating window, it needs to react to _every_ click.
>
>After rummaging through the headers I think the answer may be to use on
>event, _mButDwnEvt, fn FindWindow along with ev.what, ev.where, ev.who,
>ev.how, etc.

Bernie,

See if this is closer to what you want. It's very simple, detects 
every click in the floating window, and should keep you away from raw 
events.

Ken

p.s. Watch for e-mail line breaks and lost constant underscores on 
the Associate server

appearance window 1,"Document Window",(0,44)-(640,524),_kDocumentWindowClass
appearance window 2,"Floating Window",(400, 
200)-(700,550),_kFloatingWindowClass

local fn DoFloatingWindow
beep : delay 100 : beep
window output 2
print "You clicked in the Floating Window No. 2"
end fn

local fn DoDocumentWindow
beep
window output 1
print "You clicked in Document Window No. 1"
end fn

local fn DoMouse
dim as long wndID, clickType

long if mouse(_mouseWindow) = 2
clickType = abs ( Mouse(0) )
long if clickType
fn DoFloatingWindow
end if
end if

end fn

local fn DoDialog
dim as long evnt, id

evnt = dialog(0)
id = dialog(evnt)

select case( evnt )
case _wndClose
select( id )
case 1 :  gFBQuit = _zTrue
end select
case _wndClick
select( id )
case 1 : fn DoDocumentWindow
end select
end select

end fn

on dialog fn DoDialog
on mouse  fn DoMouse

do
HandleEvents
until gFBQuit