trichview.com

trichview.support




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


Return to index


Author

Message

Christoph Camphausen

Posted: 12/04/2002 13:48:35


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