


This has now changedwith the implementation of RTTI controls.
#FREE PASCAL DATETIME MANUAL#
Manipulating RTTI information requires still a lot of manual coding. The SessionPropertiesproperty of TForm uses this to save and restore the values of selected properties. The RTTI information is not only available in design-time in the compiler, it can also be ac-cessed during run-time using the standard typinfo and rttiutils units. All components descendfrom TPersistent, and have therefore RTTI information. The TPersistent class was compiled with RTTI information. Run-Time Type Information describes allpublished properties and methods of a class: This is the information which gets displayedin the Object Inspector of Lazarus.
#FREE PASCAL DATETIME FREE#
The Free Pascal compiler generates Run-Time Type Information for any descendent of aclass that was compiled with RTTI information. Last and maybe mostimportantly: they can form the basis of a MDA toolchain for Lazarus. Lazarus offers a set of controls which allow to display and set the published prop-erties of any component: these RTTI Controls can be used to create property pages andwizards in the IDE, but they can also be used in real applications.

This will be demonstrated by implementing a (limited) set of MDA components. Last but not least, the RTTI controls provide the beginning for a set of MDA (Model Driven Architecture) controls: they can be used to implement a set of model-aware components for Lazarus.This will be demonstrated by connecting a TCheckBox and TEdit to the ’Filtered’ and ’Filter’ properties of a dataset. For end-user applications, the components can be used to let the user set a pub- lished property of another component.A TPropertyForm form and a TComponentEditor component will be developed to show how it can be used.
#FREE PASCAL DATETIME CODE#
For component developers, these controls can be used to create property editors which need no code to display and set properties of a component.In the remainder of this article 3 possible uses will be discussed of these controls: The most advanced example is a complete grid which displays all properties of a component, just as the object inspector does. Checking or unchecking the checkbox will automatically set the value of the property. For instance a TICheckBox (a RTTI aware checkbox) can be coupled to a Boolean property: the Checked property of the checkbox will reflect the property value. RTTI controls are regular controls, but they can be linked to a published property of a component: the control will then display the value of this property. This has now changed with the implementation of RTTI controls. The SessionProperties property of TForm uses this to save and restore the values of selected properties. The RTTI information is not only available in design-time in the compiler, it can also be ac- cessed during run-time using the standard typinfo and rttiutils units. All components descend from TPersistent, and have therefore RTTI information. Run-Time Type Information describes all published properties and methods of a class: This is the information which gets displayed in the Object Inspector of Lazarus. 1 Introduction The Free Pascal compiler generates Run-Time Type Information for any descendent of a class that was compiled with RTTI information. Last and maybe most importantly: they can form the basis of a MDA toolchain for Lazarus. RTTI controls in Lazarus Michaël Van Canneyt JAbstract Lazarus offers a set of controls which allow to display and set the published prop- erties of any component: these RTTI Controls can be used to create property pages and wizards in the IDE, but they can also be used in real applications.
