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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

320 Day 9<br />

NOTE<br />

NOTE<br />

If you <strong>in</strong>voke the Object Repository when you already have a project<br />

open, you will see an additional tab <strong>in</strong> the Object Repository. The tab<br />

will have the name of your project on it. Click<strong>in</strong>g on this tab will<br />

display a page that conta<strong>in</strong>s all the objects currently <strong>in</strong> the project. This<br />

allows you to quickly reuse a form or other object by simply select<strong>in</strong>g it<br />

from the Object Repository.<br />

Across the bottom of each page you see three radio buttons. These buttons, labeled Copy,<br />

Inherit, and Use, determ<strong>in</strong>e how the selected object is implemented.<br />

Depend<strong>in</strong>g on the object selected, some (or all) of the radio buttons<br />

may be disabled. For example, all three radio buttons are always grayed<br />

out when the New page is displayed. This is because Copy is the only<br />

option available for objects on this page, so <strong>C++</strong>Builder grays out all<br />

choices and applies the Copy option automatically.<br />

Copy<br />

When you choose the Copy radio button, <strong>C++</strong>Builder creates a copy of the object selected<br />

and places it <strong>in</strong> your application. At that po<strong>in</strong>t you are free to modify the object <strong>in</strong> any way<br />

you choose. The orig<strong>in</strong>al object <strong>in</strong> the Repository is not altered when you make changes to<br />

the new object <strong>in</strong> your application.<br />

To illustrate, let’s say you had an often-used form (a form <strong>in</strong> the traditional sense, not <strong>in</strong> the<br />

<strong>C++</strong>Builder sense) pr<strong>in</strong>ted on paper—a work schedule, for <strong>in</strong>stance. Let’s say that you<br />

wanted to fill <strong>in</strong> that form with schedul<strong>in</strong>g <strong>in</strong>formation. You wouldn’t modify the orig<strong>in</strong>al<br />

form because it would then be unusable for future reuse. Instead, you would put the orig<strong>in</strong>al<br />

form <strong>in</strong> the copy mach<strong>in</strong>e, make a copy, and then return the orig<strong>in</strong>al to some location for<br />

safekeep<strong>in</strong>g. You would then fill out the copy of the form as needed. Mak<strong>in</strong>g a copy of an<br />

object <strong>in</strong> the Repository works <strong>in</strong> exactly the same way. You are free to modify the copy <strong>in</strong><br />

any way you choose while the orig<strong>in</strong>al rema<strong>in</strong>s safely tucked away. Mak<strong>in</strong>g a copy is the safest<br />

method of object usage.

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

Saved successfully!

Ooh no, something went wrong!