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.
overiding scroll wheel behavior
Re: overiding scroll wheel behavior
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.
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
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
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?
Re: overiding scroll wheel behavior
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.
Help Me Help You.
Re: overiding scroll wheel behavior
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.
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
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
alright then, I'll just inherit from the class and remove the function.