Article Preview
Buy Now
FEATURE
From Oops to OOP
How using an object-oriented approach makes programming the ListBox easier and more fun
Issue: 18.2 (March/April 2020)
Author: Markus Winter
Author Bio: Markus is a Molecular Biologist who taught himself REALbasic programming in 2003 to let the computer deal with some exceedingly tedious lab tasks. Some call it lazy, he thinks it smart. He still thinks of himself as an advanced beginner at best.
Article Description: No description available.
Article Length (in bytes): 13,307
Starting Page Number: 43
Article Number: 18204
Related Link(s): None
Excerpt of article text...
There was a recent question on the Xojo forum on how to achieve the look shown in Figure 1 with a ListBox:
There are, of course, two principal solutions to the problem of drawing across columns and rows in a ListBox:
draw the text in each cell (aka row and column) so that it overlaps in such a way as to appear as one continuous line of text that spans columns and/or rows
use just one column and draw the text and fake column and row borders where necessaryI have to confess that I am a big fan of essentially using the ListBox as a Canvas with build-in scrolling that lets you draw whatever you want wherever you want it in a ListBox cell. And the solution offered in the thread works perfectly fine and is exactly what was asked for... but this problem is an ideal example for showing off the benefits that applying OOP concepts can bring to your programming (especially in the long run) and for teaching good coding techniques too, so I couldn't pass up the opportunity to dig a bit deeper.
Doing it the Oops! way
...End of Excerpt. Please purchase the magazine to read the full article.