trichview.com

trichview.support




Re: Drag and Drop file into the table...


Return to index


Author

Message

Camphausen

Posted: 12/10/2002 4:11:08


Your example does not work. GetEditedCell is not a boolean function!

(function GetEditedCell(var Row,Col: Integer): TCustomRichViewEdit;)

I use TRichViewEdit v1.6.56 (without nested tables)

and I have tried following code:

..

MoveCaretTo(X, Y);

if rv.GetCurrentItemEx(TRVTableItemInfo, currve, item) then begin

   table := TRVTableItemInfo(item);

   if table.GetEditedCell(Row,Col)<>nil then begin

      table.cells[Row,Col].clear;

      table.cells[Row,Col].AddNL('test'+IntToStr(sn),0,0);

      inc(sn);

      rv.format;

   end;

  end;

At the moment I rather use my (yet complicated) function: IsCursorInsideTable.


Perhaps something is wrong with MoveCaretTo?

procedure TFrameOrderText.MoveCaretTo(X, Y: Integer);

var RVData: TCustomRVFormattedData;

    ItemNo, Offs: Integer;

begin

  inc(X, RV.HScrollPos);

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

  RV.RVData.GetItemAtEx(X,Y,RVData,ItemNo,Offs,false);

  if ItemNo<0 then

    exit;

  if RVData is TRVTableCellData then begin

    TRVTableCellData(RVData).Edit;

    RVData := TCustomRVFormattedData(RVData.GetRVData);

  end;

  RVData.SetSelectionBounds(ItemNo, Offs, ItemNo, Offs);

  RVData.Invalidate;

end;



yours sincerely

CKC





Powered by ABC Amber Outlook Express Converter