Page 1 of 1

Table Inside a Table

Posted: Wed Sep 28, 2005 2:27 pm
by Joel Cuyos
The code below works fine if the table in question is located directly on the Editor. If the it is located in a table cell, that's a problem..

if ChartEditor.GetCurrentItemEx(TRVTableItemInfo, RVE, Item) then
begin
Table := TRVTableItemInfo(item);
ItemNo := Table.GetMyItemNo;
ChartEditor.TopLevelEditor.SetSelectionBounds(ItemNo, ChartEditor.TopLevelEditor.GetOffsBeforeItem(ItemNo), ItemNo, ChartEditor.TopLevelEditor.GetOffsBeforeItem(ItemNo)); <-- error on this line

end;

Any help is appreciated

Posted: Wed Sep 28, 2005 5:06 pm
by Sergey Tkachenko
If the caret is inside table cell, ChartEditor.TopLevelEditor is an inplace editor of this cell.

The editor containing table is returned in RVE:

Code: Select all

if ChartEditor.GetCurrentItemEx(TRVTableItemInfo, RVE, Item) then 
begin 
  Table := TRVTableItemInfo(item); 
  ItemNo := Table.GetMyItemNo; 
  RVE.SetSelectionBounds(ItemNo, RVE.GetOffsBeforeItem(ItemNo),
    ItemNo, RVE.GetOffsBeforeItem(ItemNo));
end;

Posted: Wed Sep 28, 2005 10:16 pm
by Joel Cuyos
Thanks Sergey