overiding scroll wheel behavior

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
XenoZergNid
Posts: 17
Joined: Sun Oct 13, 2013 1:52 am

overiding scroll wheel behavior

Post by XenoZergNid »

So I have a toolbar(custom built,not the irrlicht one) with a scroll bar. I set up scrolling by setting the position of the scroll bar when the scroll wheel is moved in the OnEvent of the toolbar. But while I'm scrolling it will also scroll over the other elements(I try to scroll down while my mouse is over a ComboBox but the ComboBox takes focus and instead it selects the next element).
I understand I could inherit from all of those class but I was wondering if there was an easier way.
CuteAlien
Admin
Posts: 9971
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: overiding scroll wheel behavior

Post by CuteAlien »

I'm not sure what you mean with "But while I'm scrolling it will also scroll over the other elements".
But when you have a custom scrollbar you can maybe return true when you handled that event, then it won't be passed on. In case that was the problem.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
XenoZergNid
Posts: 17
Joined: Sun Oct 13, 2013 1:52 am

Re: overiding scroll wheel behavior

Post by XenoZergNid »

sorry for not clarifying vary well, I'll simplify it as well as I can. I have a bunch of elements. all of them are children of the toolbar. When you scroll down while the mouse is over a IGUIComboBox it selects the next value returns true before it calls IGUIElement::OnEvent(event). Is it possible to make it not receive the scroll event so the toolbar can? or do I just have to override the IGUIComboBox?
kklouzal
Posts: 343
Joined: Sun Mar 28, 2010 8:14 pm
Location: USA - Arizona

Re: overiding scroll wheel behavior

Post by kklouzal »

All I can think is add a function like "scrollWheelEnabled( bool tEnabled )" if there isn't such a function already. Sorry I can't be of more help.
Dream Big Or Go Home.
Help Me Help You.
CuteAlien
Admin
Posts: 9971
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: overiding scroll wheel behavior

Post by CuteAlien »

Hm, so the problem is that combobox already catches that event. Sorry, I don't think that can be prevented right now.

edit: One - somewhat ugly - way to prevent it might be: Catch the event before it reaches any gui-elements in your user event-receiver. Then check if that combobox is focused and if so then handle the event before it get's passed on to the Irrlicht GUI.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
XenoZergNid
Posts: 17
Joined: Sun Oct 13, 2013 1:52 am

Re: overiding scroll wheel behavior

Post by XenoZergNid »

alright then, I'll just inherit from the class and remove the function.
Post Reply