trichview.com

trichview.support




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


Return to index


Author

Message

Sergey Tkachenko

Posted: 12/10/2002 11:10:23


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

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


Yes, sorry.



> 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.


It's ok, but it will be better to use only editing functions:


Instead of


       table.cells[Row,Col].clear;

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

       inc(sn);

       rv.format;


write


       rv.TopLevelEditor.SelectAll;

       rv.InsertText('test'+IntToStr(sn));

       inc(sn);


>

> Perhaps something is wrong with MoveCaretTo?


No, it is correct.





Powered by ABC Amber Outlook Express Converter