12.12.2012 Views

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

NOTE<br />

TIP<br />

VCL Components<br />

There may be a time when you need to manage a list of str<strong>in</strong>gs unrelated<br />

to a component. The TStr<strong>in</strong>gList class is provided for exactly<br />

that purpose. This class works just like TStr<strong>in</strong>gs but can be used<br />

outside components.<br />

In reality TStr<strong>in</strong>gs is what is called an abstract base class. An abstract<br />

base class is never used directly, but only serves as a base class from<br />

which to derive other classes. Technically, the L<strong>in</strong>es property of the<br />

Memo component is an <strong>in</strong>stance of the TMemoStr<strong>in</strong>gs class and not an<br />

<strong>in</strong>stance of the TStr<strong>in</strong>gs class as I said <strong>in</strong> this section. I didn’t mean to<br />

lead you astray, but I thought it was best to make this dist<strong>in</strong>ction after<br />

the discussion on TStr<strong>in</strong>gs rather than confuse you with this <strong>in</strong>formation<br />

dur<strong>in</strong>g that discussion.<br />

Standard W<strong>in</strong>dows Control Components<br />

Back <strong>in</strong> the Jurassic age, there was someth<strong>in</strong>g called W<strong>in</strong>dows 3.0. W<strong>in</strong>dows 3.0 gave us<br />

th<strong>in</strong>gs like edit controls (s<strong>in</strong>gle l<strong>in</strong>e and multil<strong>in</strong>e), list boxes, combo boxes, buttons, check<br />

boxes, radio buttons, and static controls. These controls must have been pretty well designed<br />

because they are very prevalent <strong>in</strong> W<strong>in</strong>dows programs today—even consider<strong>in</strong>g all the new<br />

W<strong>in</strong>32 controls.<br />

I’m not go<strong>in</strong>g to go over every W<strong>in</strong>dows control and its correspond<strong>in</strong>g VCL component.<br />

There are a few th<strong>in</strong>gs, though, that you should know regard<strong>in</strong>g the standard components.<br />

Edit Controls<br />

<strong>C++</strong>Builder comes with four edit-control components. The Edit, Memo, and MaskEdit<br />

components are based on the standard W<strong>in</strong>dows edit control. The RichEdit component is<br />

based on the W<strong>in</strong>32 rich edit control, which is not one of the standard W<strong>in</strong>dows controls.<br />

Still, I will discuss RichEdit here because it has many th<strong>in</strong>gs <strong>in</strong> common with the other edit<br />

controls.<br />

287<br />

8

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!