Vous êtes sur la page 1sur 2

Chapter 4 Projects

by Felipe Monteiro de Carvalho Lazarus is a development environment for writing any type of application in Pascal, not just GUI applications. Lazarus allows you to create many application types.

Figure 4.1: The File New dialog

The Lazarus menu selection File New presents you with a dialog where you can choose what type of project you want to develop from a wide range of possibilities. Table 4.1 shows the many possible project types that Lazarus offers. Moreover, this list can be extended with other project types by using additional packages either packages included with Lazarus (but not installed by default) or packages you obtain from third parties. Figure 4.1 shows the New dialog which you see after selecting File New from the main menu with the default options offered in a fresh Lazarus installation. Here you can choose from the Module options (perhaps a new form or text file) or from the Project options (perhaps a new application or console program) or indeed any of numerous other possibilities which you can see illustrated above.
Lazarus - the complete guide

233

Chapter 4 Projects

The New dialog's content appears to be fixed, but in fact it can be extended by using the so-called Tools API. This API allows programmers to extend any part of the IDE with the addition of new menu options, properties, and dialogs. Such new functionality comes in the form of additional packages. The New dialog shown in Figure 4.1 offers a structured way to make a selection from the file types and project types outlined in Table 4.1.
Category Entry Module Description

This section includes both items that can be used to start a new project, and also items to add a file to the current project. Pascal Unit A new text file to contain Pascal source code. Form A new window for the current project, including its associated source code. Data Module A new unit designed for containing controls which (unlike TForm) are not visible on screen at run time, only at design time. Frame Frames are parts of windows used to group several controls. Custom program A new program, but not a true application. This option is most often used for creating small test routines. Text A simple text file. FPCUnit Test Case A unit for unit testing. SQL Script file A simple text file for entering SQL scripts. It is possible to inherit windows from the current application. Inherited Item Inherited ComponentCreation of inherited components for extensions. The entries in this section begin the creation of a specific Project type of new project. The current project is first automatically closed. Application Start creation of a new Lazarus GUI application. Program Start creation of a new simple Free Pascal program. Console application An application based on TCustomApplication. The difference from Program is that Program offers fewer options compared to a console application managed by Lazarus. Library Create a DLL (in Windows) or shared object (.so in Unix) rather than a full application. This makes functionality available to other programs in the form of a library. FPCUnit Console Create a new console application for unit testing. Test application FPCUnit Test Create a new GUI application for unit testing. Application Creates a new package as a set of units and components. Package The only entry is Package. Package Create a new package. This entry is empty. Because there are no sub-entries nothing Template can be selected. This is a container for extensions. projects

Table 4.1: The project types that you can start in a default Lazarus installation 234
Lazarus - the complete guide

Vous aimerez peut-être aussi