lazarus/components/rtticontrols
2021-10-18 14:32:30 +02:00
..
examples
fpdoc Docs (LazControls, RTTIControls): added missing punctuation in short descriptions, patch by Don, bug #39018 2021-06-18 20:55:37 +00:00
baseicon.png
images-copyright.txt Components: Add copyright notes to all folders to which Roland Hahn has contributed images. 2021-02-24 22:17:51 +00:00
Makefile updated makefiles 2021-10-18 14:32:30 +02:00
Makefile.compiled LazUtils/FreeType: Separate FreeType stuff into its own package 2020-07-14 18:09:17 +00:00
Makefile.fpc LazUtils/FreeType: Separate FreeType stuff into its own package 2020-07-14 18:09:17 +00:00
README.txt
rttictrls.bat
rttictrls.pas
rttictrls.res
rttictrls.txt
rttigrids.pas Components: Use a faster compare method for case-insensitive strings and StringLists. 2021-02-05 11:28:16 +00:00
runtimetypeinfocontrols.lpk
runtimetypeinfocontrols.pas
tmultipropertylink_150.png
tmultipropertylink_200.png
tmultipropertylink.png
ttibutton_150.png
ttibutton_200.png
ttibutton.png
tticalendar_150.png
tticalendar_200.png
tticalendar.png
tticheckbox_150.png
tticheckbox_200.png
tticheckbox.png
tticheckgroup_150.png
tticheckgroup_200.png
tticheckgroup.png
ttichecklistbox_150.png
ttichecklistbox_200.png
ttichecklistbox.png
tticolorbutton_150.png
tticolorbutton_200.png
tticolorbutton.png
tticombobox_150.png
tticombobox_200.png
tticombobox.png
ttiedit_150.png
ttiedit_200.png
ttiedit.png
ttifloatspinedit_150.png
ttifloatspinedit_200.png
ttifloatspinedit.png
ttigrid_150.png
ttigrid_200.png
ttigrid.png
ttigroupbox_150.png
ttigroupbox_200.png
ttigroupbox.png
ttiimage_150.png
ttiimage_200.png
ttiimage.png
ttilabel_150.png
ttilabel_200.png
ttilabel.png
ttilistbox_150.png
ttilistbox_200.png
ttilistbox.png
ttimaskedit_150.png
ttimaskedit_200.png
ttimaskedit.png
ttimemo_150.png
ttimemo_200.png
ttimemo.png
ttiprogressbar_150.png
ttiprogressbar_200.png
ttiprogressbar.png
ttipropertygrid_150.png
ttipropertygrid_200.png
ttipropertygrid.png
ttiradiogroup_150.png
ttiradiogroup_200.png
ttiradiogroup.png
ttispinedit_150.png
ttispinedit_200.png
ttispinedit.png
ttitrackbar_150.png
ttitrackbar_200.png
ttitrackbar.png

RTTI Controls for LCL


What is RTTI?

RTTI stands for the FreePascal Run Time Type Information.
The RTTI controls can be connected to published properties of TPersistant
objects (e.g. any LCL or FCL component). For example you can connect a
TTICheckBox to the Visible property of a TButton.
The IDE uses the RTTI for the Object Inspector and defines a lot of property
editors. The RTTI controls use these property editors, so they can edit anything
the Object Inspector can edit. But contrary to the Inspector the RTTI controls
are not limited to TEdit and TComboBox.


Usage:

Install the package runtimetypeinfocontrols.lpk in the Lazarus IDE. The new
controls will be installed in the new group "RTTI".

Each RTTI control has a property "Link".
There you can set the TIObject and the TIPropertyName.
For example:
 TIEdit.Link.TIObject:=Button1;
 TIEdit.Link.TIPropertyName:="Visible";
Or shorter:
 TIEdit.Link.SetObjectAndProperty(Button1,"Visible");
 
Make sure to unlink before you destroy the connected TIObject:
 TIEdit.Link.TObject:=nil;
Otherwise you can get access violations, when the RTTI control tries to access
it. For TComponent descendents like TButton the unlinking is done automatically.
 

Updating:

The RTTI has no callbacks, so if a property changes, the RTTI control does not
recognize this. You can either call
  TIEdit.Link.LoadFromProperty;
or you can set ploReadOnIdle in TIEdit.Link.Options:
  TIEdit.Link.Options:=TIEdit.Link.Options+[ploReadOnIdle];
Then the RTTI control will call LoadFromProperty everytime the Application gets
idle.

BEWARE:
The on idle update will not load the property, if the control is focused.
You can use this:
    // update focused control
    GetPropertyLinkOfComponent(ActiveControl).LoadFromProperty;