Which control for huge changing list ? Topic is solved

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
Maeglix
Experienced Solver
Experienced Solver
Posts: 74
Joined: Thu Nov 17, 2016 8:07 am

Which control for huge changing list ?

Post by Maeglix »

Hi !

I am looking ofr the right widget to use. I explain my case:

- I have a huge amount of items (currently, it is between 10k and 30k max but in theory it could be unlimited).
- I display information of those items in a list (currently a wxGrid).
- This items displayed in a list can change very often in function of some filters etc.. For example, i can chose to display in the list only the items which are visible on a map (that's the only link between the map and the list, i have a function that, for a given item, return if it is visible on the map or not).
- The users can can change the list columns.

My question is: As i saw there is many list control, which one should i use to optimize the performance ?

I don't know if my explanation was clear so don't hesitate if you have any question.

Thanks for your help.
Last edited by Maeglix on Mon Jul 03, 2017 12:03 pm, edited 1 time in total.
User avatar
doublemax
Moderator
Moderator
Posts: 19160
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Which control for huge changing list ?

Post by doublemax »

If you only need to display data ( no inline editing ), use a virtual(!) wxListCtrl.
Use the source, Luke!
Maeglix
Experienced Solver
Experienced Solver
Posts: 74
Joined: Thu Nov 17, 2016 8:07 am

Re: Which control for huge changing list ?

Post by Maeglix »

No the users can't modify the displayed info. The only thing they can do (i forgot to say it, i edit the first message) is changing the column.
User avatar
doublemax
Moderator
Moderator
Posts: 19160
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Which control for huge changing list ?

Post by doublemax »

That's ok. In a virtual wxListCtrl, you only tell the control how may columns and entries it has and you override one method (OnGetItemText) to provide the content for each "cell". All data management lies on your side.
Use the source, Luke!
Maeglix
Experienced Solver
Experienced Solver
Posts: 74
Joined: Thu Nov 17, 2016 8:07 am

Re: Which control for huge changing list ?

Post by Maeglix »

Ok thank you ! Is there any sample of a virtual listBox ?
User avatar
doublemax
Moderator
Moderator
Posts: 19160
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Which control for huge changing list ?

Post by doublemax »

In the "listctrl" sample.
Use the source, Luke!
Anil8753
Experienced Solver
Experienced Solver
Posts: 93
Joined: Sat Jan 16, 2016 5:57 am
Location: India

Re: Which control for huge changing list ?

Post by Anil8753 »

wxDataViewCtrl, I found it is a nice control for this kind of requirement. Additional it provides the inline editing as well, of course, you do not need it.
Provide the flexibility to customise the look and feel by custom renderers.
User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2409
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania

Re: Which control for huge changing list ?

Post by evstevemd »

Anil8753 wrote:wxDataViewCtrl, I found it is a nice control for this kind of requirement. Additional it provides the inline editing as well, of course, you do not need it.
Provide the flexibility to customise the look and feel by custom renderers.
It's nice indeed but only if he is going to limit data and page them. Putting "unlimited" rows will make it awful slow..!
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
Anil8753
Experienced Solver
Experienced Solver
Posts: 93
Joined: Sat Jan 16, 2016 5:57 am
Location: India

Re: Which control for huge changing list ?

Post by Anil8753 »

evstevemd wrote:
Anil8753 wrote:wxDataViewCtrl, I found it is a nice control for this kind of requirement. Additional it provides the inline editing as well, of course, you do not need it.
Provide the flexibility to customise the look and feel by custom renderers.
It's nice indeed but only if he is going to limit data and page them. Putting "unlimited" rows will make it awful slow..!

wxDataViewCtrl is efficient in handling thousands of items. It has a GetData function, there you need to feed the requested data. Your data may reside in in-memory structure/database or regular database.

It requests and renders the visible items only.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Which control for huge changing list ?

Post by ONEEYEMAN »

Hi,
It's nice indeed but only if he is going to limit data and page them. Putting "unlimited" rows will make it awful slow..!
...especially on GTK+!

Thank you.
Maeglix
Experienced Solver
Experienced Solver
Posts: 74
Joined: Thu Nov 17, 2016 8:07 am

Re: Which control for huge changing list ?

Post by Maeglix »

Thanks you guys ! I hadn't the time to try all those solutions and the one given by doublemax works.
Post Reply