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.

504 Appendix A<br />

Day 5<br />

5. To override a function means to replace a function <strong>in</strong> the base class with a function<br />

<strong>in</strong> your derived class. The new function must have the exact same name, parameters,<br />

and return type to override the base class function.<br />

6. Call the base class function from with<strong>in</strong> the overridden function:<br />

void MyClass::DoIt()<br />

{<br />

BaseClass::DoIt();<br />

// do some other stuff<br />

}<br />

7. An <strong>in</strong>itializer list <strong>in</strong>itializes a class’s data members and calls any base class constructors<br />

prior to the body of the constructor be<strong>in</strong>g entered.<br />

8. Yes. It’s very common.<br />

9. Multiple <strong>in</strong>heritance. Derive the class from two separate base classes.<br />

1. No. Only visual components can be seen at design time.<br />

2. None is best. All have their own strengths and weaknesses.<br />

3. No. VCL objects must be allocated dynamically (us<strong>in</strong>g the new operator).<br />

4. Yes and no. For the most part they are equivalent. S<strong>in</strong>ce VCL is written <strong>in</strong> Object<br />

Pascal, there are no overloaded VCL methods.<br />

5. Yes.<br />

6. TOpenDialog, TSaveDialog, TRegistry, TColorDialog, TTimer, TImageList,<br />

TFontDialog, and many more.<br />

7. Yes. All components are ultimately derived from TComponent, so they all have the<br />

properties found <strong>in</strong> TComponent (such as Name and Owner, for <strong>in</strong>stance).<br />

8. Top, Left, Owner, Parent, Width, Height, and so on.<br />

9. Yes.<br />

10. A canvas. VCL encapsulates device contexts through the TCanvas class.<br />

Day 6<br />

1. Right-click on the toolbar and choose Properties from the toolbar speed menu.<br />

2. Drag them to the toolbar and drop them where you want them.<br />

3. Drag unwanted buttons off the bottom of the toolbar and drop them.

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

Saved successfully!

Ooh no, something went wrong!