Mouse on gadget

BlitzMax Forums/MaxGUI Module/Mouse on gadget

ziggy(Posted 2006) [#1]
How can I set the mouse cursor for a specified gadget? I want one of my items to show the 'hand-link' mouse pointer, and I don't see in the docs how to do this.


degac(Posted 2006) [#2]
SetPointer or something like this...I'm at work I'm not sure


ziggy(Posted 2006) [#3]
Yes, but SetPointer is global, not gadget-releated. What if I want a button with a hand cursor? I don't even have a mouseenter - mouseleave control to activate and deactivate the hand pointer...

No ideas? noone?


tonyg(Posted 2006) [#4]
18mins Ziggy... give people a chance!
Tried it with a panel under the button but no good.
Could you save x/y/w/h into an object and check when cursor is in those bounds?


SebHoll(Posted 2006) [#5]
Ziggy: You can place a button on a slightly larger active panel to track where the mouse is and by using the EVENT_MOUSEENTER and EVENT_MOUSELEAVE commands, set the pointer when entering a gadget (or more specifically, its surrounding panel).

Have a look at this example:



A bit of a pain, but it's better than nothing.


Seb


Brucey(Posted 2006) [#6]
The proper solution will be for MaxGUI to generate Enter/Leave /etc events on all gadgets... then you can do what you like.


ziggy(Posted 2006) [#7]
@Brucey: That's exactly the point. Or even han a 'setPointer' directly as a method of a Gadget. Why are there so many system events not being thrown by MaxGui?


Brucey(Posted 2006) [#8]
Perhaps they never got around to adding them.

I know what you mean though. I wanted the pointer to change to a Hand when I moused over a label (which also changed colour), and then back to a pointer when I moused out (also changing the label colour back), to provide a clickable link.


Dreamora(Posted 2006) [#9]
Some of them are never thrown, not?
Quite some of those things work on Windows through tricks in the applications. Z Order modified panels that are created after but shifted behind other gui objects to track mouse data and all those stuff.

Not all of that is a BM problem after all.

The only way to come around it would be a little more actual GUI implementation than the dying WinAPI ... but I don't think we will see a .NET2 / 3 implementation before any pre Vista version of Windows died out