trichview.support
Re: Drag and Drop file into the table... |
Author |
Message |
Sergey Tkachenko |
Posted: 12/04/2002 23:08:00 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