Hi Everybody.
We've come across a few time where we'd like to make a list of various element. For example, one would be a list of rows containing a static text and a text input. Another one would be to have a list where each row would contain a check box, image and static text.. and so on.
Ideally, we'd like to build a sort of framework for this. Not based on ownerdrawn controls (only available under windows? ) but something that would allow us to bring at least some common mechanism to the whole thing.
We started with the idea of using a scrolledwindow containing a gridsizer that would hold all the elements of the list. So far, so good but it seems there is a really wierd thing when you resise the dialog that contains all of it: the scrollwindow content shifts by itself, like if the grid sizer would grow inside the scroll window or something.
Would anybody know what might produce such a behavior ?
Thanks a million
Marc.
custom list classes Topic is solved
- tierra
- Site Admin
- Posts: 1355
- Joined: Sun Aug 29, 2004 7:14 pm
- Location: Salt Lake City, Utah, USA
- Contact:
A friend has written pretty much the exact same type of custom control for a project we work on. We call it a wxFieldListCtrl, and it uses a wxVScrolledWindow instead of a wxScrolledWindow. It can build rows containing any type of controls. We have plans to eventually move it into wxCode, but it's not anywhere near ready... we've been using it for some time now (both with 2.6 and 2.8), but haven't cleaned it up for use on GTK or Mac (it works, but there's no native column header except on Windows). It may be some time before it's broken out, cleaned up, and opened up for public use.
Here's a screenshot:
Anyway, I don't think anyone can help you without both a sample showing the behavior, and the code to look at and/or debug with. I've been really busy the last couple months, and I don't think I'd have the time to look at though.
And since you didn't mention this at all, it helps to know what platform and version of wxWidgets you are using as well.
Here's a screenshot:
Anyway, I don't think anyone can help you without both a sample showing the behavior, and the code to look at and/or debug with. I've been really busy the last couple months, and I don't think I'd have the time to look at though.
And since you didn't mention this at all, it helps to know what platform and version of wxWidgets you are using as well.
great ! this is exactly what I'd like to acheive. I've tried skimming the next, the wx samples or the contrib folder but it doesn't seem there is much about either wxVList or wxVscrolledWindow.
Would it be possible to get some kind of hint on how to use the wxVList's paint message to draw the controls ?
from there I could start building up.
thanks !
Marc
Would it be possible to get some kind of hint on how to use the wxVList's paint message to draw the controls ?
from there I could start building up.
thanks !
Marc
- tierra
- Site Admin
- Posts: 1355
- Joined: Sun Aug 29, 2004 7:14 pm
- Location: Salt Lake City, Utah, USA
- Contact:
wxVScrolledWindow is an official class that's built into 2.6 and 2.8, but I may have given the wrong impression... this doesn't really need to be done with a wxVScrolledWindow, it can be done just fine with a wxScrolledWindow. We just wanted scroll units to correspond to rows.M-.-n wrote:great ! this is exactly what I'd like to acheive. I've tried skimming the next, the wx samples or the contrib folder but it doesn't seem there is much about either wxVList or wxVscrolledWindow.
Our control uses a wxGridBagSizer to layout all rows. It's not very efficient when compared with how wxListCtrl or wxGrid work, but it does the job for stuff that doesn't require more than maybe a few hundred rows (in which case, you wouldn't want to be using controls anyway, and should design your window to work differently).
So in other words, all window/control repainting, layout, and positioning is all handled by wxVScrolledWindow, and wxGridBagSizer automatically.
Anyway, I don't really have much time to walk you through building your own control to do the same. I just wanted to give you some hope that it's possible, and that if you're extremely patient, we will eventually be releasing ours at some point saving you the work (just don't expect that to be anytime soon, and could be anywhere from 1 to 2 years from now).
Re: custom list classes
Hello!
Has wxFieldListCtrl been released yet? I have been searching for it but was not able to find anything. If it was not finished/released, could you please share some source code for inspiration?
Best,
Jan
Has wxFieldListCtrl been released yet? I have been searching for it but was not able to find anything. If it was not finished/released, could you please share some source code for inspiration?
Best,
Jan