Page 1 of 1

Anyone know how to make something like an inverted listbox?

Posted: Sun Jul 29, 2018 6:02 pm
by ouch67
So I'm trying to figure out a way to make a wxlistbox or wxListCtrl or any list-ish control that can be inverted so that the top of the control is the bottom.

What I want to do is create two controls full of numbers.

The bottom control is sorted ascending and the smallest number appears on top like a normal wxListbox control.

However the top control is sorted ascending too but the smallest number appear on the bottom of that control.

For the life of me I can't think of a way to implement this on a control that changes size with the window.

Maybe a pic will explain better:

Image

What I'm trying to recreate is the blue and green section.

Anyone know how I can do that? Or how do I go about hacking something like that together?

Re: Anyone know how to make something like an inverted listbox?

Posted: Sun Jul 29, 2018 9:32 pm
by doublemax
Will there be scrollbars?

If not, isn't that just a "normal" list control with the items in reversed order that's always scrolled to the bottom?

Re: Anyone know how to make something like an inverted listbox?

Posted: Mon Jul 30, 2018 2:06 am
by ouch67
But if the control if bigger than the list of items there is a gap at the bottom. And there will be scroll bars yes.

Re: Anyone know how to make something like an inverted listbox?

Posted: Mon Jul 30, 2018 4:50 am
by doublemax
But if the control if bigger than the list of items there is a gap at the bottom.
Then you have to pad the list with empty entries at the beginning.
And there will be scroll bars yes.
Hmm, then the control suddenly makes less sense to me ;)
But then you have to make sure it's always scrolled to the bottom at the beginning. If you want a control that even behaves "normal" from an API point of view (scrollposition 0 => scrolled to the bottom), you'll have to build a custom control.

Re: Anyone know how to make something like an inverted listbox?

Posted: Mon Jul 30, 2018 2:44 pm
by ONEEYEMAN
Hi,
Can you show the control with the scrollbar(s)?

Thank you.