Book Image

Getting Started with Lazarus IDE

By : Roderick Person
1 (1)
Book Image

Getting Started with Lazarus IDE

1 (1)
By: Roderick Person

Overview of this book

A good integrated development environment can be the key to creating and delivering software on time and budget. Having a programming language and a development environment that runs on multiple platforms greatly eases and lessens the time taken on creating cross-platform applications. An IDE that is compatible with a legacy code base allows developers to leverage existing libraries in future applications."Getting Started with Lazarus" is a practical, hands-on guide that provides you with a number of clear step-by-step exercises, which will help you take advantage of the power of the Lazarus IDE and Free Pascal to develop software that can be created for cross-platform use."Getting started with Lazarus" discusses developing software with the open source cross platform integrated development environment and the Free Pascal language. We'll learn how to install Lazarus on various platforms such as Linux and Windows, as well as how to create new projects and convert existing Delphi projects to Lazarus projects by learning the differences between Delphi's Pascal syntax and Free Pascal's Object Pascal using a real world example project. We'll learn how to create custom components for use in Lazarus. We'll also learn the basics of documenting a Lazarus project using the Lazarus Documentation Editor. Finally we will learn that the IDE can be rebuilt using a different widget type, specifically GTK 2. Teach yourself the basics of programming with Lazarus and the open source IDE for the Free Pascal language.
Table of Contents (14 chapters)
Getting Started with the Lazarus IDE
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Preface

Lazarus is an open-source integrated development environment for the Free Pascal compiler. Lazarus provides a code editor with syntax-highlighting, a visual form designer, and the Lazarus Component Library (LCL). Lazarus is very similar to Delphi, making it ideal for Delphi programmers to utilize. Because the LCL is highly compatible with Delphi's VCL, existing Delphi projects can be easily converted to Lazarus projects.

Lazarus is cross-platform and runs on many platforms, including Linux, BSD, and Mac OS X. Lazarus applications can be created on one platform and compiled on other supporting platforms, making it suitable for many programming tasks. Besides graphical user interface and console applications, Lazarus can also support web-based applications, Android, and iOS applications.

What this book covers

Chapter 1, Installing and Configuring the Lazarus Development Environment, explains the installation and configuration of the Lazarus environment on various platforms, such as Windows, Linux, and FreeBSD.

Chapter 2, Getting to Know the Lazarus IDE – a Quick Tour, is an overview of the basics of the Lazarus IDE, such as the code editor, object inspector, and the LCL palette.

Chapter 3, Creating a Hello World Program, provides an overview of the basics of creating a GUI and console application with Lazarus using the traditional Hello World program and expanding on it.

Chapter 4, Converting Delphi, covers converting an existing Delphi project to a Lazarus project using the Delphi conversion wizard, as well as manually converting the project.

Chapter 5, Creating a Lazarus Component, covers the creation of a custom component that can be added to the component palette to be used in a GUI application.

Chapter 6, The Lazarus Documentation Editor, shows the use of LazDE, the tool for documenting a Lazarus source code unit.

Chapter 7, Rebuilding Lazarus with a GTK2 Interface, covers the rebuilding of the Lazarus interface, using one of the many supported widget sets of Lazarus.

What you need for this book

You will need to use one of the supported OS platforms, such as Windows or Linux, and the Lazarus version for that platform. Some of the source code used is available for download where indicated.

Who this book is for

This book is designed for anyone who has used Delphi in the past. It should also be useful for anyone with a basic programming experience that needs a quick overview of using Lazarus.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text are shown as follows: "For 32-bit Debian-based distributions, choose the Lazarus Linux i386 DEB subfolder."

A block of code is set as follows:

program Project1;
{$mode objfpc}{$H+}
uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Classes, SysUtils, CustApp
  { you can add units after this }; 

Any command-line input or output is written as follows:

# gpg –keyserver hkp://pgp.mit.edu:11371 –recv-keys 6A11800F
# gpg -a –export 6A11800F | apt-key add -

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Unless you have a need to change the defaults, just click Next through the installation wizard's dialogs."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.