You can start Delphi in several ways:
Right away, you'll see some of the major tools in Delphi's integrated development environment (IDE).
Delphi's development model is based on two-way tools. This means that you can move back and forth between visual design tools and text-based editing. For example, after using the Form Designer to arrange buttons and other elements in a graphical interface, you can immediately view the .DFM file that contains the textual description of your form. You can also manually edit any code generated by Delphi without losing access to the visual programming environment.
From the IDE, all your programming tools are within easy reach. You can manage projects, design graphical interfaces, write code, search databases, compile, test, debug, and browse through class libraries without leaving the IDE.
To learn about organizing and configuring the IDE, see "Customizing the environment."
Delphi's toolbars, located in the main window, provide quick access to frequently used operations and commands. All toolbar operations are duplicated in the drop-down menus.
Many operations have keyboard shortcuts as well as toolbar buttons. When a keyboard shortcut is available, it is always shown next to the command on the drop-down menu.
You can right-click on many tools and icons to display a menu of commands appropriate to the object you are working with. These are called context menus.
The toolbar is also customizable. You can add commands you want to it or move the parts of the toolbar to different locations. For more information, see "Arranging menus and toolbars".
You can name and save desktop arrangements using the Desktop toolbar.
To build an application interface, you place components on a form, set their properties, and code their event handlers.
You can change the way a component appears and behaves in your application by using the Object Inspector. When a component is selected on a form, its properties and events are displayed in the Object Inspector.
Many properties have simple values--such as names of colors, True or False, and integers. For Boolean properties, you can double-click the word to toggle between True and False. Some properties have associated property editors to set more complex values. When you click on such a property value, you'll see an ellipsis.
As you design the user interface for your application, Delphi generates the underlying Pascal code. When you select and modify the properties of forms and components, your changes are automatically reflected in the source files.
You can also add code to your source files directly using the built-in Code editor. The Code editor is a full-featured ASCII editor.
Choose Tools|Editor Options to customize your editing environment. You can set options such as tabbing, key mapping, color, and automatic features.
Forms are a very visible part of most Delphi projects--they are where you design the user interface of an application. Normally, you design forms using Delphi's visual tools, and Delphi stores them forms in form files. Form files (extension .DFM) describe each component in your form, including the values of all persistent properties.
To view a form (.DFM) file in the editor, right-click on the form and select View as Text. Form files can be edited. To return to the pictorial view of your form, right-click and choose View as Form.
You can save form files in either text (the default) or binary format. The Environment Options dialog lets you indicate which format to use for newly created forms.
Search for "form files" in the Help index.
The Code editor has Forward and Back buttons like the ones you've seen on Web browsers. You can use them to navigate through source code. Click the left arrow to return to the last place you were working in your code. Then click the right arrow to move forward again.
Within the Code editor, you can also move between the declaration of a procedure and its implementation by typing Ctrl+Shift+Up (up arrow) or Ctrl+Shift+Down (down arrow).
Search for "Code editor" in the Help index.
When a source file is open in the Code editor, you can use the Code Explorer to see a structured table of contents for the code. The Code Explorer contains a tree diagram showing the types, classes, properties, methods, global variables, and routines defined in your unit. It also shows the other units listed in the uses clause.
Search for "Code Explorer" in the Help index.
Use the Project Manager to organize the form and unit files that make up an application. To display the Project Manager, choose View|Project Manager.
The Project Manager shows you the form, unit, resource, object, library, and other files contained in a project. You can use the Project Manager to add and remove files, and you can open any file by double-clicking it.
You can combine related projects into a single project group. For example, you might use project groups to organize a multi-tiered application or to keep DLLs with executables that use them.
Search for "Project Manager" in the Help index.
As mentioned earlier, the Code Explorer lets you examine a unit in detail. For a broader view of what's available to you in your project, you can use the Project Browser. It displays the object hierarchies, units, and global symbols within your entire project. Choose View|Browser to display the Project Browser.
You can also expand the scope of the Project Browser to include all symbols available in Delphi's VCL object hierarchy. Choose Tools|Environment Options and check All symbols (VCL included) on the Explorer page.
The Project Browser has three tabs that display classes, units, and globals. On the Explorer page of Tools|Environment Options, you can set the scope of the Project Browser and control how source elements are grouped.
Search for "Project Browser" in the Help index.
To-do lists record items that need to be completed for a project. You can add project-wide items to a list by adding them directly to the list, or you can add specific items directly in the source code. Choose View|To-Do list do add or view information associated with a project.
Search for "To-Do Lists" in the Help index.
A data module is a special form that contains nonvisual components. All the components in a data module could be placed on ordinary forms alongside visual controls. But if you plan on reusing groups of database and system objects, or if you want to isolate the parts of your application that handle database connectivity and business rules, data modules provide a convenient organizational tool.
The Data Module Designer makes it easy to create data modules. To create a data module, choose File|New and double-click on Data Module.
Delphi opens an empty data module in the Data Module Designer, displays the unit file for the new module in the Code editor, and adds the module to the current project. When you reopen an existing data module, Delphi displays its components in the Data Module Designer.
Search for "Data Module Designer" or "data module" in the Help index.
The Project Options dialog, accessed by choosing Project|Options, controls compiler and linker switches, some search paths and output directories, project version information, and other settings that are maintained separately for each application. When you make changes in the Project Options dialog, your changes affect only the current project; but if the Default check box is selected, your selections are also saved as the default settings for new projects. (See "Setting default project options".)
The Environment Options dialog, accessed by choosing Tools|Environment Options, controls global IDE settings for all projects. These include many settings that affect the appearance and behavior of the IDE, as well as some search paths and output directories. You'll find more information about some of these options in "Setting tool preferences".
For details about the options on any page of the Project Options or Environment Options dialog, click the Help button on that page. Or search for "Project Options dialog box" or "Environment Options dialog box" in the Help index.
The online Help system provides extensive documentation on the VCL and other parts of Delphi. Here are some of the ways you can display Help:
You can get Help on any part of the development environment, including menu items, dialog boxes, windows, toolbars, and components.
Pressing the Help button in any dialog box also displays context-sensitive online documentation.
Error messages from the compiler and linker appear in a special window below the Code editor. To get Help with compilation errors, select a message from the list and press F1.
Delphi provides various aids to help you write code. The Code Insight tools display context-sensitive pop-up windows in the Code editor.
To configure these tools, choose Tools|Environment Options and click the Code Insight tab.
Class Completion generates skeleton code for classes. Place the cursor anywhere within a class declaration; then press Ctrl+Shift+C, or right-click and select Complete Class at Cursor. Delphi automatically adds private read and write specifiers to the declarations for any properties that require them, then creates skeleton code for all the class's methods. You can also use Class Completion to fill in class declarations for methods you've already implemented.
To configure Class Completion, choose Tools|Environment Options and click the Explorer tab.
Search for "Code Insight" and "Class Completion" in the Help index.
The IDE includes an integrated debugger that helps you locate and fix errors in your code. The debugger lets you control program execution, watch variables, and modify data values while your application is running. You can step through your code line by line, examining the state of the program at each breakpoint.
To use the debugger, you must compile your program with debug information. Choose Project|Options, select the Compiler page, and check Debug Information. Then you can begin a debugging session by running the program from the IDE. To set debugger options, choose Tools|Debugger Options.
Many debugging windows are available, including Breakpoints, Call Stack, Watches, Local Variables, Threads, Modules, CPU, and Event Log. Display them by choosing View|Debug Windows. To learn how to combine debugging windows for more convenient use, see "Docking tool windows".
Once you set up your desktop as you like it for debugging, you can save the settings as the debugging or runtime desktop. This desktop layout will be used whenever you are debugging any application. For details, see "Customizing desktop settings".
Some versions of Delphi support multiprocess and remote debugging of distributed applications from either the client or the server. To turn on remote debugging, choose Run|Parameters, click the Remote tab, and check "Debug Project on remote machine"; then choose Project|Options, click the Linker tab, and check "Include remote debug symbols".
See "Using Delphi" in the Help contents or search for "debugging" in the Help index.
The SQL Explorer (or Database Explorer in some editions of Delphi) lets you work directly with a remote database server during application development. For example, you can create, delete, or restructure tables, and you can import constraints while you are developing a database application.
Choose Database|Explore to open the Explorer; then press F1. Or search for "Database Explorer" in the main Help index.
The Object Repository contains forms, dialog boxes, data modules, wizards, DLLs, sample applications, and other items that can simplify development. Choose File|New to display the New Items dialog when you begin a project. Check the Repository to see if it contains an object that resembles one you want to create.
You can add your own objects to the Repository to facilitate reusing them and sharing them with other developers. Reusing objects lets you build families of applications with common user interfaces and functionality; building on an existing foundation also reduces development time and improves quality. The Object Repository provides a central location for tools that members of a development team can access over a network.
To add objects to the Repository, right-click in the New Items dialog and choose Properties, or choose Tools|Repository from the main menu.
See "Using Delphi" in the Help contents or search for "Object Repository" in the Help index. Also choose File|New and browse in the Object Repository to see the kinds of templates and wizards you can use as starting points for your applications. The objects available to you will depend on the version of Delphi you purchased.
pubsweb@borland.com
Copyright © 1999, Inprise Corporation. All rights reserved.