trichview.com

trichview.support




Re: read all component


Return to index


Author

Message

Sergey Tkachenko

Posted: 10/28/2002 18:46:36


procedure EnumAllControls(RVData: TCustomRVData);

var i,r,c: Integer;

  aTable: TRVTableItemInfo;

begin

for i:= 0 to RVData.Items.Count-1 do begin

     ItemStyle := RVData.GetItemStyle(i);

     case ItemStyle of

        rvsComponent:

           DoSomethingWithControl(RVData, i);

        rvsTable: begin

          aTable := TRVTableItemInfo(RVData.GetItem(i));

          for r:= 0 to aTable.Rows.Count-1 do

            for c:= 0 to aTable.Rows[r].Count-1 do

              if aTable.Cells[r,c]<>nil then

                EnumAllControls(aTable.Cells[r,c].GetRVData);

          end;

    end;

  end;

end;



>

> Hello,

> to read and find component I do this:

> for i:= 0 to RichViewEdit1.ItemCount-1 do begin

>     ItemStyle := RichViewEdit1.GetItemStyle(i);

>     case ItemStyle of

>        rvsComponent:

>           GetControlInfo(i,false);

>        rvsTable: begin

>          aTable := TRVTableItemInfo(RichViewEdit1.RVData.GetItem(i));

>          for r:= 0 to aTable.Rows.Count-1 do

>            for c:= 0 to aTable.Rows[r].Count-1 do

>              if aTable.Cells[r,c]<>nil then

>                for j:= 0 to aTable.Cells[r,c].GetRVData.Items.Count-1 do

>                begin...

>

> But if in a cell of table, I inserted an another table and in one cell of

> this table, I inserted a component, how to reach it?

>

> Regards.

> Christophe

>

>





Powered by ABC Amber Outlook Express Converter