LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!
I have to trap the mousedown event on a datagrid to get the mouse coords.
I have read the LC lesson about the mouseDown on datagrid, but unfortunatly, the mouseDown script is never executed. (Verified with a breakpoint that is never reached)
I also tried this following script in the Behavior Script of the datagrid, but it is never executed too.
local sMouseDistX, sMouseDistY
on mouseDown pMouseBtnNum
put item 1 of the mouseLoc into sMouseDistX
put item 2 of the mouseLoc into sMouseDistY
end mouseDown
After 2h of test & misunderstood, i can't explain why... perhaps someone here known the problem ?
Last edited by synto on Tue Aug 13, 2019 6:21 pm, edited 1 time in total.
I have tried to place the handler in Behavior script and in Group Script, none worked
I have to say that the datagrid is in a group to manage scrolling.
Your script does'nt make any popup.
But i can display a popup in the mouseUp handler in Behavior script.
Hmmm... strange
In the behavior script, I have a MouseUp and MouseDown handlers.
I use Find and Replace on the stack.
MouseUp isn't found, but is working (answer "up" is display)
MouseDown handlers are found in lot of RowTemplate (it's some empty MouseDown handler)
So i delete MouseDown handler from RowTemplate, and zero MouseDown handler are found now.
The handler MouseDown is executed in my Behavior script (answer "down"), but now the MouseUp does'nt display any popup.
Know that you can place a message trap anywhere in the hierarchy, and if you also want to trap it again, higher up in that hierarchy, simply "pass" it.
Thank you for these explanations Craig, i haven't really used "pass" command yet, but the "send" (and "call") is very usefull. I use it for sending my own message, beetween cards for example, or other stuff.
But never to send "system" message, i'm afraid of breaking the LC hierarchy system message, and have unpredictable behavior.
But now, you say it, i will try.