Article Preview
Buy Now
COLUMN
Containing Controls
Creating groups of controls for easy reuse
Issue: 7.1 (November/December 2008)
Author: Marc Zeedar
Author Bio: Marc taught himself programming in high school when he bought his first computer but had no money for software. He's had fun learning ever since.
Article Description: No description available.
Article Length (in bytes): 14,718
Starting Page Number: 38
Article Number: 7114
Resource File(s):
project7114.zip Updated: 2008-11-01 11:53:48
Related Link(s): None
Excerpt of article text...
Being able to reuse code is one of the key precepts of object-oriented programming. It's great to be able to create a subclass of a control like an EditField, for example, and have it do nifty new things right out of the box so you can just drag it to a window to instantly enable all sorts of custom behavior without a single line of new code.
But what if your control is more complicated? Today's modern interfaces often require controls with multiple parts, like a custom canvas linked to scrollbars. That makes easy reuse difficult since you have to move multiple things and keep them linked together. Wouldn't it be great if there was a way to group controls into one new control?
Well there is! That's called a
ContainerControl
. You may not be aware of it or have used it, in part because it's a feature of the Professional Edition. As many beginners use the Standard Edition of REALbasic, I normally hesitate writing about professional-only features, but ContainerControls are so useful and powerful I feel it's a topic worth exploring. Only you can decide if it's a feature worth upgrading to use.
...End of Excerpt. Please purchase the magazine to read the full article.