qs.pdf

(1308 KB) Pobierz
Quick Start
Quick Start
Borland ®
C++Builder 6
for Windows
Borland Software Corporation
100 Enterprise Way, Scotts Valley, CA 95066-3249
111507495.001.png
Refer to the DEPLOY document located in the root directory of your C++Builder 6 product for a complete list of files
that you can distribute in accordance with the C++Builder License Statement and Limited Warranty.
Borland may have patents and/or pending patent applications covering subject matter in this document. The
furnishing of this document does not give you any license to these patents. Please refer to the product CD or the
About dialog box for the list of applicable patents.
C OPYRIGHT © 1983–2002 Borland Software Corporation. All rights reserved. All Borland brand and product names
are trademarks or registered trademarks of Borland Software Corporation in the United States and other countries.
All other marks are the property of their respective owners.
Printed in the U.S.A.
CPE1360WW21000 6E2R0102
0203040506-9 8 7654321
D3
Contents
Chapter 1
Introduction 1-1
What is C++Builder? . . . . . . . . . . . . . . . 1-1
Registering C++Builder . . . . . . . . . . . . . . 1-2
Finding information . . . . . . . . . . . . . . . . 1-3
Online Help . . . . . . . . . . . . . . . . . . . 1-3
F1 Help . . . . . . . . . . . . . . . . . . . . . 1-4
Printed documentation . . . . . . . . . . . . . . 1-6
Developer support services and
Web site . . . . . . . . . . . . . . . . . . . . . . 1-6
Typographic conventions . . . . . . . . . . . . . 1-6
Database applications. . . . . . . . . . . . . 3-10
BDE Administrator . . . . . . . . . . . . 3-11
SQL Explorer (Database
Explorer) . . . . . . . . . . . . . . . . . 3-11
Database Desktop . . . . . . . . . . . . . 3-11
Data Dictionary . . . . . . . . . . . . . . 3-12
Custom components . . . . . . . . . . . . . 3-12
DLLs . . . . . . . . . . . . . . . . . . . . . . 3-12
COM and ActiveX . . . . . . . . . . . . . . . 3-12
Type libraries . . . . . . . . . . . . . . . . 3-13
Chapter 4
Creating a text editor—a tutorial 4-1
Starting a new application . . . . . . . . . . . . . 4-1
Setting property values. . . . . . . . . . . . . . . 4-2
Adding components to the form . . . . . . . . . 4-3
Adding support for a menu and
a toolbar . . . . . . . . . . . . . . . . . . . . . . 4-6
Action Manager editor and
Action List editor differences. . . . . . . . . 4-6
Adding menu and toolbar images
(Enterprise and Professional). . . . . . . . . 4-7
Adding actions to the Action Manager
(Enterprise and Professional). . . . . . . . . 4-8
Adding standard actions (Enterprise
and Professional) . . . . . . . . . . . . . . 4-11
Adding a menu (Enterprise
and Professional) . . . . . . . . . . . . . . 4-12
Adding a toolbar (Enterprise
and Professional) . . . . . . . . . . . . . . 4-13
Adding an image list and images
(Personal edition) . . . . . . . . . . . . . . 4-13
Adding actions to the action list
(Personal edition) . . . . . . . . . . . . . . 4-15
Adding standard actions to the action
list (Personal edition) . . . . . . . . . . . . 4-17
Adding a menu (Personal edition) . . . . . 4-18
Adding a toolbar (Personal edition). . . . . 4-20
Clearing the text area (all editions) . . . . . . . 4-22
Writing event handlers . . . . . . . . . . . . . . 4-22
Creating an event handler for the
New command. . . . . . . . . . . . . . . . 4-23
Creating an event handler for the
Open command . . . . . . . . . . . . . . . 4-25
Creating an event handler for the
Save command . . . . . . . . . . . . . . . . 4-27
Chapter 2
A tour of the environment 2-1
Starting C++Builder . . . . . . . . . . . . . . . . 2-1
The IDE . . . . . . . . . . . . . . . . . . . . . . . 2-1
The menus and toolbars. . . . . . . . . . . . . . 2-3
The Component Palette, Form Designer,
and Object Inspector . . . . . . . . . . . . . . . 2-4
The Object TreeView . . . . . . . . . . . . . . . . 2-4
The Object Repository . . . . . . . . . . . . . . . 2-5
The Code Editor . . . . . . . . . . . . . . . . . . 2-6
Code Insight . . . . . . . . . . . . . . . . . 2-6
Code Browsing . . . . . . . . . . . . . . . 2-7
The Diagram page . . . . . . . . . . . . . . . 2-7
Viewing form code . . . . . . . . . . . . . . . 2-9
The ClassExplorer . . . . . . . . . . . . . . . . . 2-9
The Project Manager . . . . . . . . . . . . . . . . 2-9
To-do lists . . . . . . . . . . . . . . . . . . . . . . 2-10
Chapter 3
Programming with C++Builder 3-1
Creating a project . . . . . . . . . . . . . . . . . 3-1
Adding data modules . . . . . . . . . . . . . 3-2
Building the user interface . . . . . . . . . . . . 3-2
Placing components on a form . . . . . . . . 3-2
Setting component properties. . . . . . . . . 3-4
Writing code . . . . . . . . . . . . . . . . . . . . 3-5
Writing event handlers . . . . . . . . . . . . 3-5
Using the VCL and CLX libraries. . . . . . . 3-6
Compiling and debugging projects . . . . . . . 3-7
Deploying applications . . . . . . . . . . . . . . 3-8
Internationalizing applications . . . . . . . . . . 3-8
Types of projects . . . . . . . . . . . . . . . . . . 3-9
CLX applications . . . . . . . . . . . . . . . . 3-9
Web server applications . . . . . . . . . . . . 3-9
iii
111507495.002.png
Creating an event handler for the
Save As command . . . . . . . . . . . . . . 4-27
Creating a Help file . . . . . . . . . . . . . . . . 4-29
Creating an event handler for the
Help Contents command . . . . . . . . . . 4-30
Creating an event handler for the
Help Index command . . . . . . . . . . . . 4-30
Creating an About box . . . . . . . . . . . . . . 4-31
Completing your application . . . . . . . . . . . 4-33
Writing the Update Now! command
event handler. . . . . . . . . . . . . . . . . 5-13
Writing the Exit command event
handler . . . . . . . . . . . . . . . . . . . . 5-13
Writing the FormClose event
handler . . . . . . . . . . . . . . . . . . . . 5-14
Chapter 6
Customizing the desktop 6-1
Organizing your work area . . . . . . . . . . . . 6-1
Arranging menus and toolbars . . . . . . . . 6-1
Docking tool windows . . . . . . . . . . . . . 6-2
Saving desktop layouts . . . . . . . . . . . . . 6-4
Customizing the Component palette . . . . . . . 6-5
Arranging the Component palette. . . . . . . 6-5
Creating component templates . . . . . . . . 6-5
Installing component packages . . . . . . . . 6-6
Using frames . . . . . . . . . . . . . . . . . 6-7
Adding ActiveX controls . . . . . . . . . . 6-8
Setting project options . . . . . . . . . . . . . . . 6-8
Setting default project options . . . . . . . . . 6-8
Specifying project and form templates
as the default. . . . . . . . . . . . . . . . . . . . 6-8
Adding templates to the Object
Repository . . . . . . . . . . . . . . . . . . . 6-9
Setting tool preferences. . . . . . . . . . . . . . 6-10
Customizing the Form Designer. . . . . . . 6-10
Customizing the Code Editor . . . . . . . . 6-11
Chapter 5
Creating a CLX database
application—atutorial 5-1
Overview of database architecture . . . . . . . . 5-1
Creating a new CLX application . . . . . . . . . 5-2
Setting up data access components . . . . . . . 5-2
Setting up the database connection. . . . . . 5-3
Setting up the unidirectional dataset . . . . . 5-5
Setting up the provider, client dataset,
and data source . . . . . . . . . . . . . . . . 5-5
Designing the user interface . . . . . . . . . . . 5-6
Creating the grid and navigation
bar . . . . . . . . . . . . . . . . . . . . . . . 5-6
Adding support for a menu . . . . . . . . . . 5-8
Adding a menu . . . . . . . . . . . . . . . . . 5-9
Adding a button . . . . . . . . . . . . . . . . 5-11
Displaying a title and an image . . . . . . . . . 5-11
Writing an event handler . . . . . . . . . . . . . 5-13
Index
I-1
iv
1
Chapter1
Introduction
This Quick Start provides an overview of the C++Builder development environment
to get you started using the product right away. It also tells you where to look for
details about the tools and features available in C++Builder.
Chapter 2, “A tour of the environment” describes the main tools on the C++Builder
desktop, or integrated desktop environment (IDE). Chapter 3, “Programming with
C++Builder” explains how you use some of these tools to create an application.
Chapter 4, “Creating a text editor—a tutorial” takes you step by step through a
tutorial to write a program for a text editor. Chapter 5, “Creating a CLX database
application—a tutorial” walks you through the creation of a database application.
Chapter 6, “Customizing the desktop” describes how you can customize the
C++Builder IDE for your development needs.
What is C++Builder?
C++Builder is an object-oriented, visual programming environment for rapid
application development (RAD). Using C++Builder, you can create highly efficient
applications for Microsoft Windows XP, Microsoft Windows 2000 and Microsoft
Windows 98 with a minimum of manual coding. C++Builder provides all the tools
you need to develop, test, and deploy applications, including a large library of
reusable components, a suite of design tools, application and form templates, and
programming wizards.
Introduction 1-1
Chapter
111507495.003.png
Zgłoś jeśli naruszono regulamin