|
09-26-2010, 08:22 PM
|
|
The Undying
|
|
Join Date: Sep 2010
Posts: 207
|
|
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.
Last edited by Digital_Utopia : 09-26-2010 at 08:27 PM.
|
06-13-2011, 02:29 PM
|
The Undying
|
|
Join Date: Apr 2011
Posts: 52
|
|
Thanks for the tip!
|
06-13-2011, 02:58 PM
|
The Undying
|
|
Join Date: Apr 2011
Posts: 52
|
|
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.
|
06-16-2011, 08:44 PM
|
|
The Undying
|
|
Join Date: Sep 2010
Posts: 207
|
|
Quote:
Originally Posted by Equendil
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.
|
Well, I'm not exactly sure what you're trying to do - but keep in mind that you can kinda fake mouse events - as Lua event functions can be called like any other function, and if all else fails - just compare the x,y coords of the mouse pointer to the relative location of the child control.
|
06-17-2011, 11:13 AM
|
The Undying
|
|
Join Date: Apr 2011
Posts: 52
|
|
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.
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.
Last edited by Equendil : 06-17-2011 at 11:17 AM.
|
06-18-2011, 08:12 PM
|
The Undying
|
|
Join Date: Apr 2011
Posts: 52
|
|
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.
|
06-19-2011, 12:18 AM
|
|
The Undying
|
|
Join Date: Sep 2010
Posts: 207
|
|
Quote:
Originally Posted by Equendil
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.
|
To be perfectly honest, how advanced a plugin is, is directly proportional to the number of kludges used within it
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
|
06-20-2011, 12:42 PM
|
The Undying
|
|
Join Date: Apr 2011
Posts: 52
|
|
Quote:
Originally Posted by Digital_Utopia
To be perfectly honest, how advanced a plugin is, is directly proportional to the number of kludges used within it
|
Haha, yeah, there is some truth to that
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
|
Thanks !
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 07:06 PM.
|
|