Page 1 of 1
Handling mouseText and mouseline events
Posted: Mon Nov 30, 2020 10:22 am
by glenn9
Hi everyone,
If in a field containing various lengths of lines of text the mouseText isn't handleable but a mouseLine is, is it possible to handle both of these commands in the same mouseUp event?
My tries so far seem to have shown me that to handle a mouseText event the listBehavior of the field needs to be 'false', and 'true' for the mouseLine command.
In the same mouseUp event I've tried to set the listBehavior with script to be concordant with the relevent mouseText/Line test but with only limited success.
Just wanted to check if what I'm wanting to achieve is possible??
Thanks,
Glenn
Re: Handling mouseText and mouseline events
Posted: Mon Nov 30, 2020 2:48 pm
by richmond62
All seems fairly straightforward:
Code: Select all
on mouseUp
put the mouseText into fld "Lclicked"
put the mouseLine into fld "Lnum"
end mouseUp
-
-
Re: Handling mouseText and mouseline events
Posted: Mon Nov 30, 2020 2:53 pm
by richmond62
-
Changing the line contents to be of varying lengths seems to make no obvious difference.
Re: Handling mouseText and mouseline events
Posted: Mon Nov 30, 2020 2:59 pm
by Klaus
Hi Glenn,
of coursee you can use mousetext and mouseline in ONE mouseup handler.
BUT an open field (locktext = false) does not receive any MOUSEUP or MOUSEDOWN* messages!
*Only a right mousedown to be able to display a context menu or whatever.
Something like this does work:
Code: Select all
on mousedown tNumber
## Right mousedown
if tNumvber = 3 then
popup btn "some text related menu" at the mouseloc
end if
end mousedown
But NO mouseup handler.
A "mousemove" handler does work however in open fields, no idea if this will help you.
Code: Select all
on mousemove
put the mousetext & CR & the mouseline
end mousemove
So maybe you need to rethink what and how you are doing what you need to.
Best
Klaus
Re: Handling mouseText and mouseline events
Posted: Mon Nov 30, 2020 4:36 pm
by dunbarx
THIS CALLS FOR A KLUDGE!
If your field is editable, put this in the field script:
Code: Select all
on mouseEnter
interrogate
end mouseEnter
on interrogate
if the mouse is down and the mouseLoc is within the rect of me then answer the mouseLine & return & the mousetext
send "interrogate" to me in 1
end interrogate
Works a treat. Have not tested to see if any special escape routes are a good idea.
The one embedded, "...and the mouseLoc is within..." is VERY necessary.
Craig
Re: Handling mouseText and mouseline events
Posted: Mon Nov 30, 2020 5:16 pm
by glenn9
Dear all,
many thanks for the suggestions, I'll gives these a try and see how it goes...
regards,
Glenn
Re: Handling mouseText and mouseline events
Posted: Mon Nov 30, 2020 5:34 pm
by dunbarx
Hi.
Let us know how it goes. My post allows you to click any number of times in the field, each time giving you information. If you want to do this only once, change the handler to:
Code: Select all
on mouseEnter
interrogate
end mouseEnter
on interrogate
if the mouse is down and the mouseLoc is within the rect of me then
answer the mouseLine & return & the mousetext
exit to top
end if
send "interrogate" to me in 1
end interrogate
Craig