Anyone know how to make something like an inverted listbox?

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
ouch67
Earned some good credits
Earned some good credits
Posts: 134
Joined: Sun Mar 23, 2008 12:09 am

Anyone know how to make something like an inverted listbox?

Post by ouch67 » Sun Jul 29, 2018 6:02 pm

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?

User avatar
doublemax
Moderator
Moderator
Posts: 14519
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

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

Post by doublemax » Sun Jul 29, 2018 9:32 pm

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?
Use the source, Luke!

ouch67
Earned some good credits
Earned some good credits
Posts: 134
Joined: Sun Mar 23, 2008 12:09 am

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

Post by ouch67 » Mon Jul 30, 2018 2:06 am

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.

User avatar
doublemax
Moderator
Moderator
Posts: 14519
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

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

Post by doublemax » Mon Jul 30, 2018 4:50 am

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.
Use the source, Luke!

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 3802
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

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

Post by ONEEYEMAN » Mon Jul 30, 2018 2:44 pm

Hi,
Can you show the control with the scrollbar(s)?

Thank you.

Post Reply