Control.MouseWheel() event not working for you?
If you've ever had a reason to try to track the mousewheel, and couldn't seem to get it to fire while using a Window or a Control, that's because neither of these elements are set up to use the mousewheel.
Instead, use something that does, like a ListBox control - size it/color it just like you would for a control, and it will do the job nicely. :) Yes, that's right - the event ListBox inherits from the Control class, doesn't actually work for the Control class. |
Thanks for the tip!
|
Meh, this is hopeless for me, I wanted to use an invisible listbox to catch mouse wheel events, but it won't catch them unless it's in front of everything else, unlike MouseEnter/MouseLeave events. Once in front of everything else, of course, nothing else is getting mouse events. Argh.
|
Quote:
|
Well, I was writing a listbox class more to my liking (never liked those list boxes that store their items, and as a consequence, handle the list structure/order which should be left to the client), mouse events would have to be redirected generically to control trees, and I can see myself rewriting the entire Turbine.UI.* API from that point. :p
As tempting as it might be, I'll just forget about MouseWheel events for the time being, I think :( Edit: Or I might try to use a listbox as a master control for my listbox, that might actually work. |
Alright, I sorted my mouse wheel problem in the following way:
- Using a Turbine.UI.Button as a parent control. - Stealing MouseWheel events from child controls, as in Turbine.UI.Control controls, they *do* get mouse wheel events with a Turbine.UI.Button as parent ... Grabbing events from child controls is inelegant at best and it still doesn't solve the more general problem that child controls (with mouse visibility set to true) prevent their parent controls from receiving any mouse event other than Enter/Hover/Leave (so in my situation, a checkbox within a control within my listbox would prevent scrolling), but as a kludge, it does the trick. |
Quote:
By the way, since I was just on the lotro forums and noticed it, nice job on Bootstrap! Definitely one of the best looking, most advanced in-game plugin managers I've seen :) |
Quote:
Quote:
|
All times are GMT -5. The time now is 12:39 AM. |
vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI