The Borland C++ Builder IDE
An Integrated Development Environment
Borland C++ Builder offers a practical and easy means of creating computer applications for the Microsoft Windows operating systems. It uses the C++ computer language as its core syntax and programming logic, adhering to ANSI standards with a lot of improvements of customized items of the Win32 library. There are various ways you can launch the program. The most common way consists of clicking.
To create a shortcut on the desktop, in Microsoft Windows higher than Win95, you can click Start -> Programs -> Borland Developer Studio 2006, and right-click C++ Builder. You can click Pin To Start Menu to permanently add it to the Start Menu in the same group with Internet Explorer. You can click Send To -> Desktop (Create Shortcut), which would create a Borland C++ Builder shortcut on the desktop.
An Integrated Development Environment (IDE) is an application that provides a friendly interface for creating computer programs. Borland C++ Builder’s IDE is structurally a classic application. On top, there is a title bar that displays the name of the application and the program currently running. The title bar itself is made of three sections.
The title bar is a horizontal bar that signals the application to the operating system:
The title bar displays the system icon . The system icon is used to identify the application you are using. Almost every application has its own system icon. The system icon holds its own list of actions; for example, it can be used to move, minimize, maximize or close (when double-clicked) a window. These actions are available through a menu that displays when you click the system icon:
The main section of the title bar displays Borland Developer Studio 2006. On the right section of the title bar, there are three system buttons with the following roles:
Under the title bar, the main menu displays its various groups of menu items. To use a menu, you click one of the words and the menu expands.
The About dialog box allows you to get some information about Borland C++ Builder and the operating system. To access the About dialog box, on the main menu, you can click Help -> About Borland C++ Builder ®. Alternatively, on the right side of the main menu, there is a C++ Builder button . If you click the button, the About dialog box would display:
From now on, in this book,
A toolbar is an object made of buttons. These buttons provide the same features you would get from the menu, only faster. Under the menu, the IDE is equipped with various toolbars. To see the list of available toolbars, you can right-click the one under the main menu:
You can move a toolbar from its default position to another area on the screen. To do this, you can click and drag it away. To position the toolbar back or to somewhere else, you can drag its title bar to the desired location
In this book, every toolbar is referred to by its name
A toolbar is equipped with buttons that could be unpredictable. Just looking at one is not obvious. The solution into knowing what a button is used for is to position the mouse on top of it. A tool tip also called a hint will come up and display for a few seconds:
To create q computer application in Borland C++ Builder, you start with a project. A project is a collection of files that, when put together, represent an object that can be executable on other computers that don't have Borland C++ Builder. There are different types of applications you can create and thus different ways to start a project. In this book, we will learn how to create graphical programs, also called Windows applications.
To create a Windows application, on the main menu, you can click File -> New -> VCL Forms Application - C++ Builder:
This action starts a project and displays a rectangular object called a form.
Borland C++ Builder allows you to create an "experimental" application that would disappear when you close Borland C++ Builder. To use such an experimental application, start by creating a project, do whatever you want with it, including adding other items and resources as we will see throughout this book. While using the project, don't save it. If you want to keep everything you have done in a project and continue it another time, you must save the project. Also, if you want to be able to distribute your application to other computers, you must save it.
To save a project, on the main menu, you can click File -> Save All or File -> Save Project As... An alternative is to click the Save All button from the Standard toolbar. When saving a project, you must specify (or create) a folder for the project. You must specify a name for the project and you must name each file used in your application.
A program would not mean much unless it accomplishes the desired purpose. To examine how your development is proceeding, as a beginning programmer, you should regularly ask C++ to show you the result.
There are three ways you can execute a program in Borland C++ Builder. To execute a program, you can press F9. You can also use the main menu where you would click Run -> Run. On the toolbar, you can also click the Run button . Remember that you can do almost anything without, or before, saving a project. This means that you can execute a project even if it has not been saved already.
Besides designing applications, one of your most regular jobs will consist of writing code that directs the computer as to what to do, when, and how to do it. This is done in an appropriate window called the Code Editor.
The Code Editor is a featured text editor adapted for coding purposes. It is programmed to recognize the parts of a program that are recognized by C++ or not. To access the Code Editor, if you have a form opened, you can press F12. The Code Editor manages your jobs by organizing its files into property pages (also called tabs). If your project contains more than one file, you can click the desired tab to access one of the files.
The basic building block of a program is called a C++ file. Whenever you create a new project, the Borland C++ Builder programming environment creates a C++ file called Unit1 while the project is called Project1. If you want, you can change these names by saving the project. A typical code of a form is built from at least two files: a header file and a source file. By default, Borland C++ Builder does not display this file when a project has been created; you have to request it.
To display the header file of the form, you can right-click the source file and click Open Source/Header File. Indeed, this action is used to toggle both displays. Since the source and the header file go in pair (when using classes), they hold the same name but have different extensions:
To change the displaying of the form and its code, on the main menu, you can click View -> Toggle Form/Unit. At any time, for example if the programming environment is displaying something other than the form, to display the form, on the main menu, you can click View -> Forms... This would display the list of forms of the application. You then click the desired form and click OK.
There are two main sources of help available for Borland C++ Builder. The first source of help is provided with the programming environment. This help is mainly electronic. You have access to this help even if you are not designing an application. Everything considered, this is the closest and the highest documentation that the compiler provides. To access C++ Builder help, on the task bar, you can click Start -> (All) Programs -> Borland Developer Studio 2006 -> Documentation.
Another place you can find information is on the Internet. Fortunately, most of that help is free. On the company’s web site, you can access http://bdn.borland.com.
Because a great part of the Borland C++ Builder applications implement the Win32 API, it is very important that you have access to the Microsoft Developer Network documentation. It is available free from http://msdn.microsoft.com and on CD-ROM or DVD.
|Copyright © 2004-2007 Yevol||Next|