trichview.com

trichview.support




Re: Finding the owning table for a cell item


Return to index


Author

Message

Sergey Tkachenko

Posted: 01/31/2004 21:44:59


procedure TForm3.RichViewEdit1RVMouseDown(Sender: TCustomRichView;

  Button: TMouseButton; Shift: TShiftState; ItemNo, X, Y: Integer);

var AOffs: Integer;

    ARVData: TCustomRVFormattedData;

begin

  inc(X, Sender.HScrollPos);

  inc(Y, Sender.VScrollPos*Sender.VSmallStep);

  if Sender.GetItemAt(X, Y, ARVData, ItemNo, AOffs, False) then begin

    repeat

      // GetSourceRVData is reverse to GetRVData

      ARVData := TCustomRVFormattedData(ARVData.GetSourceRVData);

      if ARVData is TRVTableCellData then begin

        ItemNo := TRVTableCellData(ARVData).GetTable.GetMyItemNo; // faster

than

GetItemNo

        ARVData :=

TCustomRVFormattedData(ARVData.GetAbsoluteParentData.GetSourceRVData);

      end;

    until not (ARVData is TRVTableCellData);

    // ItemNo found

end;

end;


But tomorrow I'll upload update correcting ItemNo parameter, so this code

will not be necessary.





Powered by ABC Amber Outlook Express Converter