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.

240 Day 7<br />

Step 3: Creat<strong>in</strong>g the Speedbar Conta<strong>in</strong>er<br />

Now we can add the panel that will serve as the conta<strong>in</strong>er for the speedbar buttons:<br />

1. Choose a Panel component from the Component Palette and place it anywhere on<br />

the form.<br />

NOTE<br />

2. Change the Name property to SpeedBar.<br />

3. Change the Height property to 32.<br />

4. Change the BevelOuter property to bvNone.<br />

5. Clear the Caption property.<br />

6. Change the Align property to alTop. The panel moves to the top, but just underneath<br />

the bevel we placed there earlier.<br />

The last step <strong>in</strong> this sequence illustrates a po<strong>in</strong>t about the Align<br />

property. If you make a component’s Align property alTop, it will move<br />

to the top of the client area or to the bottom edge of the first component<br />

it encounters. This allows you to place several components on the top of<br />

a form and have them adjust automatically as the form is sized.<br />

Step 4: Decorat<strong>in</strong>g the Panel<br />

Now all that’s left to do is add a button or two to the panel:<br />

1. Click on the Additional tab of the Component Palette and choose a SpeedButton<br />

component.<br />

2. Place a speed button on the panel (not on the ma<strong>in</strong> form). Don’t worry about its<br />

exact placement.<br />

3. Change the Name property to FileOpenBtn.<br />

4. Change the Left property to 5.<br />

5. Choose View | Alignment Palette from the ma<strong>in</strong> menu. Click the Center Vertically<br />

<strong>in</strong> W<strong>in</strong>dow button.<br />

6. Locate the Glyph property and double-click the Value column. The Image Editor is<br />

displayed.<br />

7. Click the Load button on the Image Editor. The Load picture dialog box is<br />

displayed. Navigate to the \Images\Buttons subdirectory of <strong>C++</strong>Builder and choose<br />

the fileopen.bmp file. Click OK.

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

Saved successfully!

Ooh no, something went wrong!