CTable
Author: Bjorn Einhuger
Price: $15 shareware for complete custom control pack
Download:
cafe.realbasic.com (Hotline)

  At the Realbasic café, under the Einhuger software folder, there's an incredibly large number of products. One of the best is the CTable set. At first, it's confusing exactly which item's you're supposed to download (There are at least five of them!), so to be safe, I downloaded them all. After I unstuffed them all, I found out that I only needed one of them, and that every single stuffed file had come with all five classes (this system could be made much better…). However, after I ran the demo project, I got excited. This was a program that did complex listboxes, and allowed you to sort by column. Plus, it could sort numerically and in either direction.

  I quickly read the readme and looked at the documentation (it's in E-Help format, which means you have to download yet another application. Also, there are better help formats out there, like Apple Guide. Personally, I'd have prefered a Simple Text document.). It explained that you had to create a canvas control, an editfield, and a scrollbar. Then, you set the Canvas's super to CTableControl, and made it point to the editfield and scrollbar using its focusControl and VScrollbar properties. Though I found this a bit odd, the manual expained that at this point, that was unavoidable for a class.



An example CTable. Notice how the columns are aligned differently, and they are sorted numerically by age.
  After setting the control up, it was only a simple matter of setting the number of rows and columns, setting the column labels, and adding rows. One of the most annoying things about the Listbox built-in to RB is adding rows to a multiple column listbox. You can use the addrow property for the first column, but then you use the Cell property for the rest. CTable handles it even worse! Even if there's only one column, you still have to use the "SetCell" method, which takes four parameters. This could be improved upon greatly, especially considering that the last parameter is almost always false. (Actually, I have improved upon it. My custom control, CTableExtender, provides some more intuitive ways of working with CTable)

  Anyway, I ran the program, and was pleased to see everything show up. Then, I clicked on a column header (which should sort the list), but nothing happened. I then realized that I had to manually make it sort. This could also be improved on. However, after I finished writing the basic code for the CTable in my test project, it was quite enjoyable. It let me set the justification (left, center, or right) for columns, and even let me set the style (e.g. bold italic) for individual cells.

  Once you finish setting up CTable, this control adds a lot to your projects, and is extremely useful.

 Pros: Powerful table control. Allows string and numeric sorts backwards and forwards.
 Cons: Documentation is in E-Help format. Requires five classes. Some methods less than intuitive.
Rating: 7.0
****