Re: Simulating a Double Click in Facespan
Re: Simulating a Double Click in Facespan
- Subject: Re: Simulating a Double Click in Facespan
- From: Michael Miller <email@hidden>
- Date: Fri, 4 May 2001 23:17:21 -0500
At 10:47 AM +1000 5/5/01, David Lloyd wrote:
>
I'd like an efficient eway of simulating a double click in Facespan. For
>
example I have a label in a window and I want to activate the script within
>
by double clicking on it. (In the true manner of a correct double click -
>
not just a mouse click which can easily be done)
There isn't really a good way. You could write a click handler that
stored the last click time, and if they were close enough together
then consider it a double click. This would completely disregard
user preferences, though, and it doesn't fit the UI guidelines.
-- -- in label "lblSomeText" of window "Example"
-- the number of ticks to consider a double-click
-- (a tick is 1/60 of a second)
property pDoubleClickThreshold : 15
property pLastClickTime : 0
on click theObj at theClickLoc upon thePart option down optDown shift
down sftDown command down cmdDown control down ctlDown ticks theTicks
set lastClick to pLastClickTime
set pLastClickTime to theTicks
if (theTicks - lastClick) < pDoubleClickThreshold
-- Do your thing here, quite possibly continuing the click message.
else
-- Make sure FaceSpan gets the message, since we're not handling it.
continue click theObj at theClickLoc upon thePart option down
optDown shift down sftDown command down cmdDown control down ctlDown
ticks theTicks
end if
end click
You could make a one-item tall listbox or table and give it a
doubleclick item. It'll look funny but it'd take a double click and
follow the user's preferences.
If it'll fit the situation, you might try using the Group text style
to emulate a hyperlink. The various FaceSpan snippets on the ESG
Labs snippets page have them in their about boxes:
http://www.esglabs.com/snippets/
Any of these techniques should be used sparingly. You'll have less
problems if you give your users objects to manipulate that look like
they should be manipulated and follow the standard rules for their
type of object.
Hope this helps,
Mike Miller
ESG Labs
http://www.esglabs.com/