lazarus/components/rtticontrols
mattias 66d9c63226 reload property on write error
git-svn-id: trunk@5693 -
2004-07-18 09:42:14 +00:00
..
examples reload property on write error 2004-07-18 09:42:14 +00:00
lib added README 2004-07-16 21:54:27 +00:00
baseicon.png added RTTI controls 2004-07-16 21:49:00 +00:00
README added usage hints 2004-07-16 22:05:11 +00:00
rttictrls.lrs added RTTI controls 2004-07-16 21:49:00 +00:00
rttictrls.pas reload property on write error 2004-07-18 09:42:14 +00:00
runtimetypeinfocontrols.lpk added RTTI controls 2004-07-16 21:49:00 +00:00
runtimetypeinfocontrols.pas added RTTI controls 2004-07-16 21:49:00 +00:00
ttibutton.xpm added RTTI controls 2004-07-16 21:49:00 +00:00
tticalendar.xpm added RTTI controls 2004-07-16 21:49:00 +00:00
tticheckbox.xpm added RTTI controls 2004-07-16 21:49:00 +00:00
tticheckgroup.xpm added RTTI controls 2004-07-16 21:49:00 +00:00
ttichecklistbox.xpm added RTTI controls 2004-07-16 21:49:00 +00:00
tticombobox.xpm added RTTI controls 2004-07-16 21:49:00 +00:00
ttiedit.xpm added RTTI controls 2004-07-16 21:49:00 +00:00
ttigroupbox.xpm added RTTI controls 2004-07-16 21:49:00 +00:00
ttiimage.xpm added RTTI controls 2004-07-16 21:49:00 +00:00
ttilabel.xpm added RTTI controls 2004-07-16 21:49:00 +00:00
ttilistbox.xpm added RTTI controls 2004-07-16 21:49:00 +00:00
ttimaskedit.xpm added RTTI controls 2004-07-16 21:49:00 +00:00
ttimemo.xpm added RTTI controls 2004-07-16 21:49:00 +00:00
ttipropertygrid.xpm added RTTI controls 2004-07-16 21:49:00 +00:00
ttiradiogroup.xpm added RTTI controls 2004-07-16 21:49:00 +00:00
ttispinedit.xpm added RTTI controls 2004-07-16 21:49:00 +00:00
ttitrackbar.xpm added RTTI controls 2004-07-16 21:49:00 +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 it can edit anything
the Object Inspector can edit. But contrary to the Inspector the RTTI controls
are not limited to TEdit and TComboBox.


Usage:

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
 TIEdit.Link.SetObjectAndProperty(Button1,"Visible");
 
Make sure to unlink, before you destroy the connected TIObject:
 TIEdit.Link.TObject:=nil;
Otherwiese 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.