Display data objects (controls) in a wxListCtrl style 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
C_Bastian
Earned some good credits
Earned some good credits
Posts: 102
Joined: Thu Sep 29, 2005 3:47 pm

Display data objects (controls) in a wxListCtrl style

Post by C_Bastian »

Hello,

at the moment I have no idea at all how to do this:

I have a list of some kind of data that looks like this:

Code: Select all

struct myDataStruct
{
    int number;
    int value;
    bool istrue;
    int someotherstuff;
}

myDataStruct data[1000]; //must not be 1000, number is not to be relevant

And I have a control that is able to display/modify these pieces of data one by one.

What I want to do:

I want to display a variing number of these controls in a kind of list/grid. Just like e.g. the Windows Explorer shows thumbnails of images in a folder.

These controls have always the same size. That means the number of controls in one line is dependent of the width of the dialog (may vary). I want to have a vertical srollbar to scroll through these controls if there are more controls to be displayed than fit into the dialog.

Difficulty #1: The controls have to be sorted by the number. So if there is another of these controls to be added, the controls with higher numbers must move. This must be rather quick.

Difficulty #2: if this works, the second step would be, to arrange these controls in a grid. That means I want to be able to tell any control "move to 4;7" or something like that. That means, too, I need vertical and horizontal scrollbars. This is not that important at first!

Any ideas?
Sebastian
Last edited by C_Bastian on Thu Jul 26, 2007 6:53 pm, edited 1 time in total.
C_Bastian
Earned some good credits
Earned some good credits
Posts: 102
Joined: Thu Sep 29, 2005 3:47 pm

Post by C_Bastian »

The other way: Is it somehow possible to insert self-build controls into a wxListCtrl?

That would exactly be what I want.
bigpilot
I live to help wx-kind
I live to help wx-kind
Posts: 184
Joined: Tue Sep 19, 2006 8:33 am

Post by bigpilot »

No, it's not possible. But you can do it with a wxGrid. But it will only show in a kind of Report mode, if you know what I mean.
Soon to be world famous ;)
C_Bastian
Earned some good credits
Earned some good credits
Posts: 102
Joined: Thu Sep 29, 2005 3:47 pm

Post by C_Bastian »

To finish this old thread, I found a way to do what I want: I just combines a wxScrolledWindow with a wxGridSizer. Sometimes wxWidgets is too simple to use. :wink:

Sebastian
Programming today is a race between software engineers stirring to build bigger and better idiot-proof programs, and the universe is trying to produce bigger and better idiots. So far, the universe is winning. [Rich Cook]
Post Reply