Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2017-05

RTTI grid with multiple objects ?

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Van Canneyt

Hello,

How to make the RTTI property grid display the properties of a set of TComponents ?

Currently I have: (MyGrid is the property grid)

Var
   I : integer;
   L : TPersistentSelectionList;
begin
   C:=0;
   L:=MyGrid.Selection;
   L.BeginUpdate;
   try
     L.Clear;
     if Not Assigned(ObjectList) then
       exit;
     For I:=0 to ObjectList.Count-1 do
       if ObjectList[i].Selected then
         L.Add(ObjectList[i]);
   finally
     L.EndUpdate;
     Mygrid.RefreshPropertyValues;
   end;
end;

But the grid remains empty, even though I know multiple objects have been attached. I tried various things, but the grid remains empty.

What should I do so the grid actually shows something ?

Michael.

Reply by email

Mattias Gaertner
to Michael Van Canneyt
Show quoted text 25 lines
Hello, How to make the RTTI property grid display the properties of a set of TComponents ? Currently I have: (MyGrid is the property grid) Var I : integer; L : TPersistentSelectionList; begin C:=0; L:=MyGrid.Selection; L.BeginUpdate; try L.Clear; if Not Assigned(ObjectList) then exit; For I:=0 to ObjectList.Count-1 do if ObjectList[i].Selected then L.Add(ObjectList[i]); finally L.EndUpdate; Mygrid.RefreshPropertyValues;

RefreshPropertyValues is for updating the grid, when only property values have changed.
When the list have changed use MyGrid.ReloadTIList.

Mattias

Show quoted text 12 lines
end; end; But the grid remains empty, even though I know multiple objects have been attached. I tried various things, but the grid remains empty. What should I do so the grid actually shows something ? Michael.

Reply by email

Michael Van Canneyt
to Mattias Gaertner
Mattias Gaertner wrote 32 lines
On Sun, 7 May 2017 15:15:29 +0200 (CEST) Michael Van Canneyt via Lazarus wrote: > Hello, > > How to make the RTTI property grid display the properties of a set of > TComponents ? > > Currently I have: (MyGrid is the property grid) > > Var > I : integer; > L : TPersistentSelectionList; > > begin > C:=0; > L:=MyGrid.Selection; > L.BeginUpdate; > try > L.Clear; > if Not Assigned(ObjectList) then > exit; > For I:=0 to ObjectList.Count-1 do > if ObjectList[i].Selected then > L.Add(ObjectList[i]); > finally > L.EndUpdate; > Mygrid.RefreshPropertyValues; RefreshPropertyValues is for updating the grid, when only property values have changed. When the list have changed use MyGrid.ReloadTIList.
fraobjectinspector.pp(197,14) Error: identifier idents no member "ReloadTIList"

instead I tried

     Mygrid.BuildPropertyList(False);

That seems to work ?

Michael.

Reply by email