Receiving mouse movements *without activation* in a gadget handleInput(), to draw hovering things.
I though this was straightforward, but it's not, or I am missing something ? I have a private gadget which needs drawing things when mouse moves over it, but before it is clicked. It looks like mouse events starts with clicking inside, then reach HitTest/GM_ACIVATE/GM_HANDLEINPUT. Is there a GA property or something to do that I missed ? Wasn't there the possibility to have buttons that would change aspect at hovering ? That would be the same I need.
Another question to bypass this would be: Is only one gadget meant to be activated at a time ? Can I manage hovering with a gadget that would keep being activated all along ?
... My current B plan is to create a special method for my gadget.
Edit: I hacked this way: receiving mouse coords in main loop with WMHI_MOUSEMOVE, telling if mouse is over my gadget it is activated, even if no click, so it receive mouse events and can draw hovering stuffs.
case WMHI_MOUSEMOVE:
if(CurrentMainWindow &&
(( CurrentMainWindow->Flags & WFLG_WINDOWACTIVE) !=0 )&&
app->canvasGadget)
{
/* trick to allow "hovering" with the canvas, before it is even clicked */
if(testGadgetRect(app->canvasGadget,CurrentMainWindow->MouseX,CurrentMainWindow->MouseY))
{
struct Gadget *canvas = (struct Gadget *)app->canvasGadget;
if((canvas->Activation & GACT_ACTIVEGADGET)==0 )
{
ActivateGadget(canvas,CurrentMainWindow,NULL );
}
}
}
break;