lazarus/components/rtticontrols
mattias 0a891e4ab2 set version to 1.8.0RC1
git-svn-id: trunk@54578 -
2017-04-08 21:53:32 +00:00
..
examples examples: removed obsolete SrcPath 2015-03-02 18:52:45 +00:00
fpdoc
baseicon.png
Makefile set version to 1.8.0RC1 2017-04-08 21:53:32 +00:00
Makefile.compiled IDE,lazbuild: append -Cg on targets linux, freebsd, openbsd, netbsd, solaris, bug #17412 2014-11-18 11:03:29 +00:00
Makefile.fpc IDE+lazbuild+makefiles: on darwin use -gw instead of -g 2015-10-01 18:40:54 +00:00
README.txt
rttictrls.bat
rttictrls.pas Remove extra checks for empty strings together with IsValidIdent. It already handles an empty string. 2016-08-17 10:40:29 +00:00
rttictrls.res
rttictrls.txt
rttigrids.pas rtticontrols: fix fixedcols/fixedrows rttigrid properties, issue #29967 2016-04-08 07:54:52 +00:00
runtimetypeinfocontrols.lpk rtticontrols: clean up 2014-11-18 15:51:08 +00:00
runtimetypeinfocontrols.pas components: less hints 2016-03-01 15:25:02 +00:00
tmultipropertylink.png
ttibutton.png
tticalendar.png
tticheckbox.png
tticheckgroup.png
ttichecklistbox.png
tticolorbutton.png
tticombobox.png
ttiedit.png
ttifloatspinedit.png
ttigrid.png
ttigroupbox.png
ttiimage.png
ttilabel.png
ttilistbox.png
ttimaskedit.png
ttimemo.png
ttiprogressbar.png
ttipropertygrid.png
ttiradiogroup.png
ttispinedit.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;