[Lazarus] RTTI grid with multiple objects ?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Lazarus] RTTI grid with multiple objects ?

Free Pascal - Lazarus mailing list
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.



--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] RTTI grid with multiple objects ?

Free Pascal - Lazarus mailing list
On Sun, 7 May 2017 15:15:29 +0200 (CEST)
Michael Van Canneyt via Lazarus <[hidden email]> 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.

Mattias


>    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.
>
>
>
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] RTTI grid with multiple objects ?

Free Pascal - Lazarus mailing list


On Sun, 7 May 2017, Mattias Gaertner via Lazarus wrote:

> On Sun, 7 May 2017 15:15:29 +0200 (CEST)
> Michael Van Canneyt via Lazarus <[hidden email]> 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.
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Loading...