I need a web table with
2)one which has a check box
3)each row can have more than one line
4)each row can have a different background color.
5)variable number of rows.
Is this possible with a webListBox or do I need to roll my own.
Any pointers would be appreciated.
At the moment you’ll need to roll your own.
One way would be to create a WebContainer sub-class that matches your row layout, and then have another WebContainer sub-class that is your new custom listbox. In the new listbox create new instances of the row container with correct data and then use EmbedWithin to add to the listbox.
There’s an example or two bundled with the Xojo IDE that are worth a look, the WebGridContainer project in particular might be useful (Web / Containers / WebGridContainer).
Thanks Ian. That look like a good start. Now I need to be able to figure our the length, in pixel, of the data to figure out the number of lines a string will require.
If you’re going to show text drawn in a canvas (WebPicture) that’s fine, as long as you know the width of the canvas you can work out the height of the drawn text and then re-size the row’s canvas / own height to then draw the text into.
If you generally have a similar amount of text, you can compromise with a standard width height that covers most scenarios and then maybe use ellipses or something to indicate that the text has been truncated if it gets a little long.
You can do all of that except the check box. I just use a clickable + sign in my first column.
Regular fonts provide two characters available to all browsers that maybe could be used for a pseudo check box : ?? (&u25A1) and ? (&u221A).
After more study and testing have decided that a weblistbox will do what I want to do.