With the clicks cell the content a spreadsheet in Edit shows

General TRichView support forum. Please post your questions here
Post Reply
Jmich
Posts: 19
Joined: Mon Apr 30, 2007 10:10 am

With the clicks cell the content a spreadsheet in Edit shows

Post by Jmich »

With the clicks one single table cell the cell-content with Edit shows. Who can help?



Thank you

JM
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Sorry, I do not understand your question.
Jmich
Posts: 19
Joined: Mon Apr 30, 2007 10:10 am

Post by Jmich »

if I click on a cell in a table of Richviewedit, this content of the cell in a Tedit field should be shown.

For example: if select rich_table.Cells[r,c] = true then
begin
edit1.Text := rich_table.cells[r,c];
end;

How can of working?


Many greetingses

Jmich
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Use OnRVMouseDown event.

Code: Select all

procedure TForm3.RichViewEdit1RVMouseUp(Sender: TCustomRichView;
  Button: TMouseButton; Shift: TShiftState; ItemNo, X, Y: Integer);
begin
  if (Button<>mbLeft) or (Shift<>[]) then
    exit;
  if RichViewEdit1.InplaceEditor<>nil then
    Edit1.Text := GetAllText(RichViewEdit1.TopLevelEditor)
  else
    Edit1.Text := ''; // not a cell
end;
GetAllText is declared in RVGetText unit.
Note: it may return multiline text.
Post Reply