lazarus/components/rtticontrols
mattias ee01d36329 fixed saving non loaded property
git-svn-id: trunk@8643 -
2006-01-28 14:42:12 +00:00
..
examples cleanup example rtticontrols grid 2005-10-31 08:35:46 +00:00
lib added README 2004-07-16 21:54:27 +00:00
baseicon.png
Makefile Makefile custom options are now platform independent 2006-01-21 09:46:15 +00:00
Makefile.fpc Makefile custom options are now platform independent 2006-01-21 09:46:15 +00:00
README fixed saving non loaded property 2006-01-28 14:42:12 +00:00
rttictrls.lrs renamed TSpinEdit to TFloatSpinEdit and added new TSpinEdit with integers 2005-09-22 08:59:42 +00:00
rttictrls.pas fixed saving non loaded property 2006-01-28 14:42:12 +00:00
rttigrids.pas reduced debugging output and extended debugging of lcl 2006-01-19 18:36:07 +00:00
runtimetypeinfocontrols.lpk implemented make bigide 2006-01-02 20:39:49 +00:00
runtimetypeinfocontrols.pas implemented compiler options parsed optins with platform independent makros, disabled string highlighting 2006-01-20 13:38:42 +00:00
tmultipropertylink.xpm implemented TMultiPropertyLink 2004-12-13 21:30:21 +00:00
ttibutton.xpm
tticalendar.xpm
tticheckbox.xpm
tticheckgroup.xpm
ttichecklistbox.xpm
tticolorbutton.xpm implemented TMultiPropertyLink 2004-12-13 21:30:21 +00:00
tticombobox.xpm
ttiedit.xpm
ttifloatspinedit.xpm renamed TSpinEdit to TFloatSpinEdit and added new TSpinEdit with integers 2005-09-22 08:59:42 +00:00
ttigrid.xpm registered andadded icon for TTIGrid 2005-01-09 14:11:03 +00:00
ttigroupbox.xpm
ttiimage.xpm
ttilabel.xpm
ttilistbox.xpm
ttimaskedit.xpm
ttimemo.xpm
ttiprogressbar.xpm implemented TTIProgressBar 2005-01-01 18:56:47 +00:00
ttipropertygrid.xpm
ttiradiogroup.xpm
ttispinedit.xpm
ttitrackbar.xpm

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;