1. Trap MouseHover in Win32Lib
- Posted by euphoric (admin) Jul 09, 2010
- 1170 views
I would like to trap a MouseHover event, or otherwise figure out when the mouse cursor has stopped over a EuGrid control column so I can show a ToolTip for the currently hovered-over cell. There are many mouse events, but "hover" doesn't seem to be one of them.
Maybe there's an easier/better way to do this. Any ideas?
2. Re: Trap MouseHover in Win32Lib
- Posted by DerekParnell (admin) Jul 10, 2010
- 1029 views
I would like to trap a MouseHover event, or otherwise figure out when the mouse cursor has stopped over a EuGrid control column so I can show a ToolTip for the currently hovered-over cell. There are many mouse events, but "hover" doesn't seem to be one of them.
Maybe there's an easier/better way to do this. Any ideas?
When you set a tooltip hint, you can supply a routine_id instead of some text. Then when Windows goes to display the tooltip, it calls your routine and displays whatever text your routine returns.
This means that you can write a routine that gets the mouse location, calculates which cell that's hovering over and return the text appropriate for that cell. Your routine will receive two parameters; the ID that invoked the tooltip and the maximum length for the tip text.
3. Re: Trap MouseHover in Win32Lib
- Posted by euphoric (admin) Jul 10, 2010
- 979 views
I would like to trap a MouseHover event...
When you set a tooltip hint, you can supply a routine_id instead of some text. Then when Windows goes to display the tooltip, it calls your routine and displays whatever text your routine returns.
This means that you can write a routine that gets the mouse location, calculates which cell that's hovering over and return the text appropriate for that cell. Your routine will receive two parameters; the ID that invoked the tooltip and the maximum length for the tip text.
I tried this route. Two problems:
- It doesn't call the tooltip routine again until the mouse is moved off the control, then back to it. I need to hit it for each stopping point, not just the first. If I hover over column 2, then hover over column 5, the tooltip generated over column 2 remains.
- The routine called by the tooltip feature lets me get the mouse coordinate, but I don't know how to translate that coordinate into a column of the EuGrid.
Any ideas?