2004.11.28.Tour of the IDE

类别:Delphi 点击:0 评论:0 推荐:

Tour of the IDE

When you start Delphi 2005, the integrated development environment (IDE) launches and displays several tools and menus. The IDE helps you visually design user interfaces, set object properties, write code, and view and manage your application in various ways. The default IDE desktop layout includes some of the most commonly used tools. You can use the View menu to display or hide certain tools. You can also customize and save the desktop layouts that work best for you. The tools available in the IDE depend on the edition of Delphi 2005 you are using and include the:

    Welcome Page

    Forms

    Designer Surface

    Tool Palette

    Object Inspector

    Object Repository

    Project Manager

    Data Explorer

    Structure View

    History Manager

    Code Editor

The following sections describe each of these tools.

Welcome Page

When you open Delphi 2005, the Welcome Page appears with a number of links to developer resources, such as product-related articles, training, and online Help. As you develop projects, you can quickly access them from the list recent projects at the top of the page. If you close the Welcome Page, you can reopen it by choosing View Welcome Page .

Forms

Typically, a form represents a window or HTML page in a user interface. At design-time, a form is displayed on the Designer surface. You add components from the Tool Palette to a form to create your user interface. Delphi 2005 provides several types of forms, as described in the following sections. Select the form that best suits your application design, whether it’s a Web application that provides business logic functionality over the Web, or a Windows application that provides processing and high-performance content display. To switch between the Designer and Code Editor, click their associated tabs below the IDE. To access forms, choose File New Other.

Windows Forms

Use Windows Forms to build native Windows applications that run in a managed environment. You use the .NET classes to build Windows clients which presents two major advantages—it allows application clients to use features unavailable to browser clients, and it leverages the .NET Framework infrastructure. Windows Forms present a programming model that takes advantage of a unified .NET Framework (for security and dynamic application updates, for instance) and the richness of GUI Windows clients. You use Windows controls, such as buttons, list boxes, and text boxes, to build your Windows applications. To access a Windows Form, choose File New Other Delphi for .NET Projects Windows Forms Application.

ASP.NET Web Forms

Use ASP.NET Web Forms to create applications that can be accessed from any Web browser on any platform. You use the .NET classes to create an ASP.NET Web Forms application. The form consists of the visual representation of the HTML, the actual HTML, and a code-behind file. To access an ASP.NET Web Form, choose File New Other Delphi for .NET Projects ASP.NET Web Application.

VCL Forms

Use VCL Forms to create applications that use VCL.NET components to run in the .NET Framework. You use the Borland Visual Component Library for .NET classes to create a VCL Forms application. VCL Forms are especially useful if you want to port an existing Delphi application containing VCL controls to the .NET environment or if you are already familiar with the VCL and prefer to use it. To access a VCL Forms, choose File New Other Delphi for .NET Projects VCL Forms Application.

HTML Designer

Use the HTML Designer to view and edit ASP.NET Web Forms or HTML pages. This Designer provides a Tag Editor for editing HTML tags alongside the visual representation of the form or page. You can also use the Object Inspector to edit properties of the visible items on the HTML page and to display the properties of any current HTML tag in the Tag Editor. A combo box located above the Tag Editor lets you display and edit SCRIPT tags. To create a new HTML file, choose File New Other Web Documents HTML Page. Designer Surface The Designer surface, or Designer, is displayed automatically when you are using a form. The appearance and functionality of the Designer depends on the type of form you are using. For example, if you are using an ASP.NET Web Form, the Designer will display an HTML tag editor. To access the Designer, click the Design tab at the bottom of the IDE.

Visual Components

Visual components appear on the form at design-time and are visible to the end user at runtime. They include such things as buttons, labels, toolbars, and listboxes.

Nonvisual Components and the Component Tray

Nonvisual components are attached to the form, but they are only visible at design-time; they are not visible to end users at runtime. You can use nonvisual components as a way to reuse groups of database and system objects or isolate the parts of your application that handle database connectivity and business rules. When you add an nonvisual component to a form, they are displayed in the component tray at the bottom of the Designer surface. The component tray lets you distinguish between visual and nonvisual components.

Tool Palette

The Tool Palette contains items to help you develop your application. The items displayed depend on the current view. For example, if you are viewing a form on the Designer, the Tool Palette displays components that are appropriate for that form. You can double-click a control to add it to your form. If you are viewing code in the Code Editor, the Tool Palette displays code snippets that you can add to your code.

Customized Components

In addition to the components that are installed with Delphi 2005, you can add customized or third party components to the Tool Palette and save them in their own category. Component Templates

You can create templates that are made up of one or more components. After arranging components on a form, setting their properties, and writing code for them, you can save them as a component template. Later, by selecting the template from the Tool Palette, you can place the preconfigured components on a form in a single step; all associated properties and event-handling code are added to your project at the same time. You can reposition the components independently, reset their properties, and create or modify event handlers for them just as if you had placed each component in a separate operation.

Object Inspector

The Object Inspector lets you set designtime properties and create event handlers for components. This provides the connection between your application’s visual appearance and the code that makes the application run. The Object Inspector contains two tabs: Properties and Events. Use the Properties tab to change physical attributes of your components. Depending on your selection, some category options let you enter values in a text box while others require you to select values from a drop-down box. For Boolean operations, you toggle between True or False. After you change your components’ physical attributes, you create event handlers that control how the components function. Use the Events tab to specify the event of a specific object you select. If there is an existing event handler, use the drop-down box to select it. By default, some options in the Object Inspector are collapsed. To expand the options, click the plus sign (+) next to the category. Certain nonvisual components, for example, the Borland Data Providers, allow quick access to editors such as the Connection Editor and Command Text Editor. You can access these editors in the Designer Verb area at the bottom of the Object Inspector. To open the editors, point your cursor over the name of the editor until your cursor changes into a hand and the editor turns into a link. Alternatively, you can right-click the nonvisual component, scroll down to its associated editor and select it. Note that not all nonvisual components have associated editors. In addition to editors, this area can also display hyperlinks to show custom component editors, launch a web page and show dialog boxes.

Object Repository

To simplify development, Delphi 2005 offers predesigned templates, forms, and other items that you can easily access and use in your application. The Object Repository is accessible by choosing File New Other . A New Items dialog box appears, displaying the contents of the Object Repository . You can also edit or remove existing objects from the Object Repository by right-clicking the Object Repository to view your editing options.

Inside the Object Repository

The Object Repository contains items that address the types of applications you can develop. It contains templates, forms, and many others items. You can create projects such as class library, control library, console applications, HTML pages, and many others by accessing the available templates.

Object Repository Templates

You can add your own objects to the Object Repository as templates to reuse or share with other developers. Reusing objects lets you build families of applications with common user interfaces and functionality to reduce development time and improve quality.

Project Manager

A project is made up of several application files. The Project Manager lets you view and organize your project files such as forms, executables, assemblies, objects and library files. Within the Project Manager, you can add, remove, and rename files. You can also combine related projects to form project group, which you can compile at the same time.

Add References

You can integrate your legacy COM servers and ActiveX controls into managed applications by adding references to unmanaged DLLs to your project, and then browse the types just as you would with managed assemblies. Choose Project Add Reference to integrate your legacy COM servers or ActiveX controls. Alternatively, right-click the Reference folder in the Project Manager and click Add Reference. You can add other .NET assemblies, COM/ActiveX components, or type libraries using the Add Reference feature.

Copy References to a Local Path

During runtime, assemblies must be in the output path of the project or in the Global Assembly Cache (GAC) for deployment. In the Project Manager, you can right-click an assembly and use the Copy Local setting to copy the reference to the local output path. Follow these guidelines to determine whether a reference must be copied.

    If the reference is to an assembly created in another project, select the Copy Local setting.

    If the assembly is in the GAC, do not select the Copy Local setting.

Add Web References You can quickly add a Web Reference to your client application and access the Web Service you want to use. When you add a Web Reference, you are importing a WSDL document into your client application, which describes a particular Web Service. Once you imported the WSDL document, Delphi 2005 generates all the interfaces and class definitions you need for calling that Web Service. To use the Add Web Reference feature, from your Project Manager, right-click the Web Services node.

Data Explorer

The Data Explorer lets you browse database server-specific schema objects including tables, fields, stored procedure definitions, triggers, and indexes. Using the context menus, you can create and manage database connections. You can also drag and drop data from a data source to most forms to build your database application quickly.

Structure View

The Structure View shows the hierarchy of source code or HTML displayed in the Code Editor, or components displayed on the Designer. When displaying the structure of source code or HTML, you can double-click an item to jump to its declaration or location in the Code Editor. When displaying components, you can double-click a component to select it on the form. If your code contains syntax errors, they are displayed in the Errors folder in the Structure View. You can double-click an error to locate its source in the Code Editor. You can control the content and appearance of the Structure View by choosing Tools Options Environment Options Explorer and changing the settings.

History Manager

The History Manager lets you see and compare versions of a file, including multiple backup versions, saved local changes, and the buffer of unsaved changes for the active file. If the current file is under version control, all types of revisions are available in the History Manager. The History Manager is displayed to the right of the Code tab and contains the following tabbed pages:

   The Contents page displays current and previous versions of the file.

   The Diff page displays differences between selected versions of the file.

   The Info page displays all labels and comments for the active file.

You can use the History Manager toolbar to refresh revision information, revert a selected version to the most current version, and synchronize scrolling between the source viewers in the Contents or Diff pages and the Code Editor.

Code Editor

The Code Editor provides a convenient way to view and modify your source code. It is a full-featured, customizable, ANSI editor that provides refactoring, automatic backups, Code Insight, syntax highlighting, multiple undo capability, context-sensitive Help, and more.

本文地址:http://com.8s8s.com/it/it4576.htm