trichview.com

trichview.support




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


Return to index


Author

Message

Camphausen

Posted: 12/05/2002 1:46:04


I use TRichViewEdit as an order form for a pharmacy interface. I drag the text

from a TListBox.

Inside TRichViewEdit each row of a table represents a certain drug (only one

drug per row allowed).

When the DragDrop event occurs I need to know which table and which cell

contains the drug.



Sergey Tkachenko wrote:


> From where and to where do you want to drag text?

>

> GetWordAt may return word of text inserted in table, not a name of table...

>

> >

> > I use the table as a kind of protected (small) spreadsheet.

> > The user should be able to drag&drop a text to the selected cell.

> > The application should know, which table and which cell has been selected.

> > I used your dragimg-example, but it doesne't work correctly.

> > Here is a short piece of code:

> >

> > procedure TForm1.rvDragDrop(Sender, Source: TObject; X,Y: Integer);

> > var RVData : TCustomRVFormattedData;

> >     ItemNo,row,col : Integer;

> >     ItemName : string;

> >     rve: TCustomRichViewEdit;

> > begin

> >   MoveCaretTo(X,Y);

> >   RichViewEdit1.GetWordAt(X,Y,RVData,ItemNo,ItemName);

> >   if ItemName='TabMed' then begin

> >      RVDATA.clear;

> >      RVDATA.AddNL('test'),0,0);

> >      RichViewEdit1.format;

> >   end;

> >   StatusBar.Panels[0].Text:='? ?';

> >   if ItemName='TabMed' then begin

> >      rve:=tabMed.GetEditedCell(Row,Col);

> >      if rve<>nil

> >         then StatusBar.Panels[0].Text:=Format('Row: %d,Col:

> %d',[row,col]);

> >   end;

> > end;

> >







Powered by ABC Amber Outlook Express Converter