Heya
When you use the mouse wheel in a combo box (I mean when you click on it and scroll through the drop down list) it only goes 1 pixel at a time. Same for when you click the up and down buttons on the scroll bar at the side.
However if you press page up/page down, instead of scrolling by 1 pixel, it will scroll by 1 item at a time.
I have kind of a large number of items in my combo box, so it's annoying to only scroll 1 pixel at a time since the natural way to scroll through it is usually with the mouse wheel or the scroll bar, I don't think most users of my program will know about pressing the page up/down buttons.
Anyways, I wondered how I can set the small step (I guess you'd call it) of the open combo box list to the same as the large one. So when I use the mouse wheel or the scroll bar, it will scroll through 1 item at a time instead of 1 pixel.
I did try looking through CGUIComboBox.cpp in the engine source, but I can't seem to find what I need to change. I dunno, maybe I'm missing something obvious though.
[fixed?] Making combo boxes scroll faster
No, sorry, the combobox does use a listbox for that and the listbox does currently use a fixed stepsize (of 10 pixels).
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
ahh a list box. dunno why I didnt think to try checking that out.
ok, so I changed the wheel step from 10 to ItemHeight, and the small step from 1 to ItemHeight. It works like I had wanted it to now.
I am not too sure why 1 pixel was chosen as the default small step, especially when you can't hold the button down to keep scrolling. It sounds weird to me. Like if each text was 20 pixels high, I wouldnt want to click 20 times to see the next item.
Anyways, sorted it out. Thanks man.
ok, so I changed the wheel step from 10 to ItemHeight, and the small step from 1 to ItemHeight. It works like I had wanted it to now.
I am not too sure why 1 pixel was chosen as the default small step, especially when you can't hold the button down to keep scrolling. It sounds weird to me. Like if each text was 20 pixels high, I wouldnt want to click 20 times to see the next item.
Anyways, sorted it out. Thanks man.
Oh - I only tested mouse-scrolling. You are right - 1 pixel for those buttons does not make sense (neither does 10 probably). I've put it on my todo-list (which is overflowing so might take a while until I get to that).
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
OK, in case I won't find time otherwise I did at least set a little better defaults in svn trunk. I did set large only to ItemHeight*2 because it shouldn't depend on size (still better than it was).
But while doing so I found another problem - that the behaviour of the keys depends on whether the focus is on the scrollbar or on the listbox. Not sure right now if that is good/bad, but I found it irritating.
Also I did see some minor bugs (which are because we have no clientRect yet which should have been used in some calculations here instead of absoluteRect) and I also have already some more patches for the listbox which I want to apply some day. So thanks for reporting, it's at least a little better now. And hopefully I find time for a larger update to it in a few weeks/months.
But while doing so I found another problem - that the behaviour of the keys depends on whether the focus is on the scrollbar or on the listbox. Not sure right now if that is good/bad, but I found it irritating.
Also I did see some minor bugs (which are because we have no clientRect yet which should have been used in some calculations here instead of absoluteRect) and I also have already some more patches for the listbox which I want to apply some day. So thanks for reporting, it's at least a little better now. And hopefully I find time for a larger update to it in a few weeks/months.
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
Actually I noticed this too, probably shouldve mentioned it before lol.CuteAlien wrote:But while doing so I found another problem - that the behaviour of the keys depends on whether the focus is on the scrollbar or on the listbox. Not sure right now if that is good/bad, but I found it irritating.
But anyways no problems.
Edit: oh, something else that I thought of is when you click on the combo box to open the list, if you click the little button while the list is open, it will close the list (thats fine) but if you click the other part (with text) the list box will close and then open again. I think that should probably just close the list that is open already too.
I think this is happening because, when the list box loses focus, it closes itself, but because you clicked on the combo box, it opens again. Although it doesn't exactly explain why clicking the button doesn't have this issue. But since the button works, it should be possible to get it to work with the text part too.
It's not really a big deal, but in windows, if you click on a combo box to open it, and then click on it again, it will close it. But in this case for irrlicht, its closing it but reopening again.
Thanks, I hadn't noticed that thing with the text-clicking before. That looks also wrong to me.
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