lazarus/components/rtticontrols
mattias 6b6ad2d929 IDE+LCL: made LCL a normal package
git-svn-id: trunk@29210 -
2011-01-27 12:56:07 +00:00
..
examples updated components/README.txt 2009-06-09 06:49:29 +00:00
fpdoc rtti controls: started docs 2008-08-05 21:22:24 +00:00
lib
baseicon.png
Makefile IDE+LCL: made LCL a normal package 2011-01-27 12:56:07 +00:00
Makefile.compiled IDE+LCL: made LCL a normal package 2011-01-27 12:56:07 +00:00
Makefile.fpc IDE+LCL: made LCL a normal package 2011-01-27 12:56:07 +00:00
README.txt
rttictrls.bat rtti controls: 2007-11-30 02:03:13 +00:00
rttictrls.lrs update of component images from Bee and Wile64 2007-12-20 08:10:48 +00:00
rttictrls.pas rtticontrols: published TTIComboBox AutoComplete and AutoCompleteText 2009-04-07 12:45:29 +00:00
rttictrls.txt rtti controls: 2007-11-30 02:03:13 +00:00
rttigrids.pas rtti controls: don't crash when we place TTIGrid on form 2009-04-04 16:38:37 +00:00
runtimetypeinfocontrols.lpk IDE+LCL: made LCL a normal package 2011-01-27 12:56:07 +00:00
runtimetypeinfocontrols.pas components: return correct file case for packages units 2010-07-14 15:52:03 +00:00
tmultipropertylink.png update of component images from Bee and Wile64 2007-12-20 08:10:48 +00:00
ttibutton.png new component images from Bee 2007-12-19 09:51:28 +00:00
tticalendar.png new component images from Bee 2007-12-19 09:51:28 +00:00
tticheckbox.png new component images from Bee 2007-12-19 09:51:28 +00:00
tticheckgroup.png new component images from Bee 2007-12-19 09:51:28 +00:00
ttichecklistbox.png new component images from Bee 2007-12-19 09:51:28 +00:00
tticolorbutton.png new component images from Bee 2007-12-19 09:51:28 +00:00
tticombobox.png new component images from Bee 2007-12-19 09:51:28 +00:00
ttiedit.png update of component images from Bee and Wile64 2007-12-20 08:10:48 +00:00
ttifloatspinedit.png new component images from Bee 2007-12-19 09:51:28 +00:00
ttigrid.png new component images from Bee 2007-12-19 09:51:28 +00:00
ttigroupbox.png new component images from Bee 2007-12-19 09:51:28 +00:00
ttiimage.png new component images from Bee 2007-12-19 09:51:28 +00:00
ttilabel.png update of component images from Bee and Wile64 2007-12-20 08:10:48 +00:00
ttilistbox.png update of component images from Bee and Wile64 2007-12-20 08:10:48 +00:00
ttimaskedit.png new component images from Bee 2007-12-19 09:51:28 +00:00
ttimemo.png new component images from Bee 2007-12-19 09:51:28 +00:00
ttiprogressbar.png new component images from Bee 2007-12-19 09:51:28 +00:00
ttipropertygrid.png new component images from Bee 2007-12-19 09:51:28 +00:00
ttiradiogroup.png new component images from Bee 2007-12-19 09:51:28 +00:00
ttispinedit.png new component images from Bee 2007-12-19 09:51:28 +00:00
ttitrackbar.png new component images from Bee 2007-12-19 09:51:28 +00:00

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;