Re: XForms: FL_DBLCLICK never detected

Steve Lamont (spl@szechuan.ucsd.edu)
Fri, 27 Jun 97 06:24:18 PDT

To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> Now, when one clicks on that choice object it shall behave as
> usual. But when s/he doubleclicks on it an externel database
> administration program for this particular table should be
> invoked. Thus I need to know which choice list was clicked and
> thus I need a doubleclick detection.

Is this normal behavior in any other application? I've certainly
never seen anything like it. It doesn't seem intuitive to me.

IMHO, you are unnecessarily overloading the function of an object.

I think I'd just add an extra button next to the choice object to
invoke the administration tool rather than go to the extra effort of
convoluting the choice object.

Another thought:

What you might try doing is using the timed double click algorithm I
suggested (and probably imperfectly implemented) in a preemptive
handler but add a timer callback (using fl_add_timeout) to handle the
case where you want to deploy the menu.

The algorithm might schematically go something like this:

preempt handler

if ( button is down ) then

if ( not within double click timing ) then

start double click timer

add timeout with fl_add_timeout

else

delete timeout
do double click thing

endif

else if ( button is up ) then

delete timeout

endif

return FL_PREEMPT

end preempt handler

timeout handler

if ( button is still down ) then

deploy choice menu

handle choice

endif

end timeout handler

This is just a sketch and is is probably rife with `gotchas' and race
conditions that will cause you to tear your hair out because the will
be difficult to duplicate and/or debug but it should give you the
general idea.

It also occurs to me that you may want to trigger your double click on
the *rising* side of the mouse button transition -- that is, when the
button is up. That may or may not make things easier.

I'm just tossing out random ideas here -- none of this has been tested
other than in the gedanken experiment lab. (And I'm not even sure I
spelled `gedanken' right). :-)

spl
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
Xforms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/