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.

TIP<br />

Creat<strong>in</strong>g Applications <strong>in</strong> <strong>C++</strong>Builder<br />

You can use the Select Directory dialog box to create a directory as well<br />

as to select a directory. Click the Browse button to display the Select<br />

Directory dialog box. Enter the path for the directory you want to<br />

create and then click OK or press Enter. <strong>C++</strong>Builder will prompt you<br />

to create the new directory if the directory you entered does not exist.<br />

The bottom half of this page gives you three additional options. If you are creat<strong>in</strong>g an MDI<br />

application, click <strong>in</strong> the check box marked Create MDI Application. (MDI applications were<br />

discussed on Day 6, “The <strong>C++</strong>Builder IDE Explored: Projects and Forms.”) The rema<strong>in</strong><strong>in</strong>g<br />

two check boxes allow you to implement a status bar and h<strong>in</strong>t text for your components.<br />

When you are sure you have made all the choices for your new application, click the Next<br />

button. <strong>C++</strong>Builder creates the application based on the options you specified. <strong>C++</strong>Builder<br />

writes as much code as possible for the application. This doesn’t amount to a lot of code, but<br />

some of the basic code is already written for you. For example, if you chose a File menu, the<br />

FileOpenClick() handler has been written and looks like this:<br />

void __fastcall TMa<strong>in</strong>Form::FileOpen(TObject *Sender)<br />

{<br />

if (OpenDialog->Execute())<br />

{<br />

//-- Add code to open OpenDialog.FileName --<br />

}<br />

}<br />

The code to execute the File Open dialog box is <strong>in</strong> place; you only have to write the code that<br />

actually deals with the returned filename.<br />

TIP<br />

After you create an Application Wizard project, you can choose<br />

Project | Save To Repository to save the project for later use. This will<br />

save you the trouble of go<strong>in</strong>g through the Application Wizard to create<br />

your basic application. You might want to add an About box before<br />

sav<strong>in</strong>g the project to the Repository.<br />

Us<strong>in</strong>g the wizards is fast and easy. You will still need to write the program, of course, but<br />

<strong>C++</strong>Builder gives you a head start by sav<strong>in</strong>g you from the tedium of creat<strong>in</strong>g the basic<br />

application elements. As RAD-friendly as <strong>C++</strong>Builder is overall, the wizards simplify th<strong>in</strong>gs<br />

even more. The <strong>C++</strong>Builder wizards are sort of like RAD on RAD!<br />

335<br />

9

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

Saved successfully!

Ooh no, something went wrong!