ComboBox::clearDropDownList() leaves empty list items

NickM

21-05-2008 07:06:07

Sorry if this has already been addressed and I've missed it or if it's just me being stupid (wouldn't be the first time)

I'm trying to remove all the list items from a ComboBox in order to remake a new set of list items based on what is selected in a seperate ComboBox list, it all works fine except when I try to clear the items using ComboBox::clearDropDownList()
It removes the actual text but seems to leave empty list items, so when I add my new set of items I have to scroll down past all the empty items before I find the new ones.

Thanks for any help.
Nick.

kungfoomasta

21-05-2008 18:08:44

I looked at the code and couldn't see anything that sticks out. clearDropDownList clears all items in the list, and when inserting a new item, it determines the next y position of the item by (mItems.size() * itemHeight). In order to dig further I'll need to repro this and debug it to see why the items are incorrectly placed.

I'm rewriting a lot of widgets with the new rendering system, where clipping is handled for me. This will affect scrolling, and make everything a lot more simple. I have a feeling scrolling may somehow be manipulating the position of newly added list items, in your scenario.

NickM

21-05-2008 20:11:39

Thanks for replying, I think you are right, if I call ComboBox::getNumberOfItems() it returns the correct number of items, but the amount of space allocated includes all the previous items too.

kungfoomasta

21-05-2008 20:53:51

I'm working hard on the next release. I can't set any dates, but I put in a few hours every day and progress is good. Hope you can hold off until then!

NickM

21-05-2008 22:24:49

I much appreciate the work you are doing, I've loads of stuff to work on so there's no rush with getting this sorted. :D