[fixed]Mouse wheel in list box

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Reiko
Posts: 105
Joined: Sun Aug 16, 2009 7:06 am
Location: Australia

[fixed]Mouse wheel in list box

Post by Reiko »

This might just be me, but my mouse wheel has never worked in a list box (and therefore the list of a combo box doesn't work either). Atleast not that I can remember. When I move the wheel, the list doesn't move at all.

It was really annoying me just now so I decided to take a look at CGUIListBox.cpp in the engine. I did manage to fix it.

in bool CGUIListBox::OnEvent(const SEvent& event)
in case EET_MOUSE_INPUT_EVENT:
in switch(event.MouseInput.Event)
in case EMIE_MOUSE_WHEEL:

I changed the line:

Code: Select all

ScrollBar->setPos(ScrollBar->getPos() + (s32)event.MouseInput.Wheel*-ItemHeight/2);
to

Code: Select all

ScrollBar->setPos(ScrollBar->getPos() + ((event.MouseInput.Wheel < 0) ? ItemHeight/2 : -ItemHeight/2));
(based on the code for the mouse wheel from CGUIComboBox, which does work)

and it fixed it.

Don't know if it's actually a bug or not, since I assume that if the engine was broken in someway, something as obvious as using the mouse wheel in a list box would've been picked up on before now. If it's working for everyone else, maybe it has something to do with my mouse wheel sensitivity. But yeah this fixed the problem for me so I just thought I would mention it here.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Yeah, it seems only on Linux it's guaranteed to be -1 or -1. I'm a little curious if that's really the case, so maybe you could run a quick test for me. Add a spinbox and check-out how the values change there when you use he mouse wheel.
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
Reiko
Posts: 105
Joined: Sun Aug 16, 2009 7:06 am
Location: Australia

Post by Reiko »

The mouse wheel works on it. It's changing by 0.25 every step.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

OK, fixed in svn release branch 1.7 r3848 - trunk will follow as usual. It had been wrong in a few more elements (listbox, scrollbar, spinbox, table, treeview). For spinbox for example it should have changed by 1.0 as that's the default stepsize.

Thanks for reporting and follow-up.
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
Reiko
Posts: 105
Joined: Sun Aug 16, 2009 7:06 am
Location: Australia

Post by Reiko »

nice to see another thing I found weird in the engine being fixed :)
Post Reply