Table -> Cell[c,r] -> selectAll

General TRichView support forum. Please post your questions here
Post Reply
Denoson
Posts: 71
Joined: Tue Jan 24, 2006 9:25 pm
Contact:

Table -> Cell[c,r] -> selectAll

Post by Denoson »

I need to select all value of table cell.

Code: Select all

  if not EDITOR.CanChange or
     not EDITOR.GetCurrentItemEx(TRVTableItemInfo, rve, item) then exit;

  table := TRVTableItemInfo(item);
  if table.GetEditedCell(r,c)<>nil then 
  begin
    table.Cells[r,c].SelectAll;
    Caption := 'Cell: ' + inttostr(r) + ', ' + inttostr(c);
  end;
Edit-cell is detected (Row and Column), but text is not selected.
Sergey Tkachenko
Site Admin
Posts: 17604
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Code: Select all

  if not EDITOR.GetCurrentItemEx(TRVTableItemInfo, rve, item) then exit; 

  table := TRVTableItemInfo(item); 
  if table.GetEditedCell(r,c)<>nil then 
  begin 
    table.Cells[r,c].GetRVData.SelectAll; 
    table.Cells[r,c].GetRVData.Invalidate;
    Caption := 'Cell: ' + inttostr(r) + ', ' + inttostr(c); 
  end; 
When the cell is edited, all cell items are moved to the cell inplace editor.
Its content is available as Cell.GetRVData.
Also, I removed CanChange, because this code does not modify document.
Denoson
Posts: 71
Joined: Tue Jan 24, 2006 9:25 pm
Contact:

Cells

Post by Denoson »

I try new code, but:

table.Cells[r,c].GetRVData. - has no SelectAll and Invalidate methods :(
Denoson
Posts: 71
Joined: Tue Jan 24, 2006 9:25 pm
Contact:

Cells

Post by Denoson »

Hello Sergey, any news about Cells->Select all?
Sergey Tkachenko
Site Admin
Posts: 17604
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Code: Select all

  if not EDITOR.GetCurrentItemEx(TRVTableItemInfo, rve, item) then exit; 

  table := TRVTableItemInfo(item); 
  if table.GetEditedCell(r,c)<>nil then 
  begin 
    TCustomRVFormattedData(table.Cells[r,c].GetRVData).SelectAll; 
    TCustomRVFormattedData(table.Cells[r,c].GetRVData).Invalidate; 
    Caption := 'Cell: ' + inttostr(r) + ', ' + inttostr(c); 
  end; 
Denoson
Posts: 71
Joined: Tue Jan 24, 2006 9:25 pm
Contact:

Cells -> Select all

Post by Denoson »

Thanks this code works well.
Post Reply