trichview.com

trichview.support




Finding the owning table for a cell item


Return to index


Author

Message

Robert Haynes

Posted: 01/31/2004 13:18:39


Hi,


Please help,  I have been tring to work this one out to ages and still cant

get to the bottom of it.


In the RVMouseDown event I have found that even though the help file states

that the item no passed is the item no in the root rv data - even inside a

table,  it isn't. It instead appears to be the item no in the cells rvdata.


...so as what I need is the itemno of the table clicked on / in or near ! I

am trying the following :-


(I am aware of the issues in casting any old RV data as a cell - this is an

extract of the code !!!)


procedure TDocumentPane.DocumentRVMouseDown(Sender: TCustomRichView;


Button: TMouseButton;


Shift: TShiftState;


ItemNo, X, Y: Integer);

var item : integer;

begin

          Sender.getItemAt(x, y, rv, item, offs, false);

          //rv is the cell rvdata? - find THE OWNING TABLE....and its Item

No in the root

          item := TRVTableCellData(rv).GetTable.GetMyItemNo;

end;


Thanks


Robert






Powered by ABC Amber Outlook Express Converter