Page 1 of 1

Data Grid and mouseEnter - mouseLeave

Posted: Wed Dec 04, 2013 10:42 am
by D4vidrim
Hi,
I' created a Data Grid and on its script I wrote this code:

Code: Select all

on mouseEnter
   --lock screen
   if the mouseLoc is within the rect of me then
      put the top of me into theTop
      set the height of me to 126
      set the top of me to theTop
   end if
end mouseEnter

on mouseLeave
   --lock screen
   --wait 1 sec
   if the mouseLoc is not within the rect of me then
      put the top of me into theTop
      set the height of me to 19
      set the top of me to theTop
   end if
end mouseLeave
What I'm trying to do is to reduce its height when the mouse is not within the rect of the data grid, my code sometimes does work, but sometimes id doesn't.
For example, if I move too fast the mouse or if I move the mouse on the top of the grid, the mouseLeave message is not delivered (or something else happens...).

Can someone help me, please?

Thank you.

Re: Data Grid and mouseEnter - mouseLeave

Posted: Wed Dec 04, 2013 11:30 am
by jmburnod
Hi D4vidrim

I tested your script and it works for me.
Maybe you can take off the condition "if the mouseLoc"

Which version of LiveCode do you use ?

Best regards
Jean-marc

Re: Data Grid and mouseEnter - mouseLeave

Posted: Wed Dec 04, 2013 11:51 am
by bangkok
I've got the same issue.

When the mouse is leaving at the top of the datagrid... nothing happens.

it works down, right, left (but not all the time, it's not consistent), but by the top never.

I tried LC 6.5, 6.1, 5.5... same results.

*********
Ah ! I just found a pattern !

On the right side of the DG.... increase the size... So there is a blank header between the last column of the DG and the right edge of the DG.
Now... leave by the top.. the script is fired.

So... the script is not fired... when you leave the DG by the top, within a column.

Re: Data Grid and mouseEnter - mouseLeave

Posted: Wed Dec 04, 2013 12:39 pm
by jmburnod
Sorry,
I tried with a table fld.
I've got also strange result with datagrid
the datagrid is shaked when i move from top to down

Re: Data Grid and mouseEnter - mouseLeave

Posted: Wed Dec 04, 2013 2:44 pm
by Klaus
Hi guys,

sorry, no solution, but some explanations :D

Since this is the script of the datagrid group, EVERY singel object will also exectue it, so when moving the mouse
over the datagrid, every control in the datagrid (and there are MANY of them!) will execute mouseenter/mouseleave
or at least try it, unless they do have their own mouseenter/leave scripts!

That's why Jean-Marc is experiencing this "shaking"!
Shake, shake, shake
Shake yout booooooooty! :D


Best

Klaus