Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Getting Started with Lazarus IDE

You're reading from  Getting Started with Lazarus IDE

Product type Book
Published in Feb 2013
Publisher Packt
ISBN-13 9781782163404
Pages 116 pages
Edition 1st Edition
Languages
Author (1):
Roderick Person Roderick Person
Profile icon Roderick Person

Adding properties


Properties of a component that you would like to have visible in the Object Inspector window must be declared as published. Properties are attributes that determine an object's status and behavior. A property is a name that is mapped to read and write methods or access data directly. This means, when you read or write a property, you are accessing a field or calling a method of the object. For example, let us add a FileName property to TMessageLog , which is the name of the file that messages will be written to. The actual field of the object that will store this data will be named fFileName.

To the TMessageLog private declaration section, add:

  fFileName: String;

To the TMessagLog published declaration section, add:

  property FileName: String read fFileName write fFileName;

With these changes, when the packages are compiled and installed, the property FileName will be visible in the Object Inspector window when the TMessageLog declaration is added to a form in a project....

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}