realbasic-nug.it
[Top] [All Lists]

Re: Drag and Drop

To: REALbasic NUG Italian <realbasic-nug dot it at lists dot realsoftware dot com>
Subject: Re: Drag and Drop
From: Gilberto De Faveri <gilberto dot defaveri at omnidea dot it>
Date: Tue, 15 Jan 2008 00:02:20 +0100
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug dot it at lists dot realsoftware dot com
References: <000801c85633$8ca20b90$bf86174f at a0a3c02bb53024>

On 13/gen/08, at 23:27, BluStar wrote:

Ma se trasporto una riga in una EditField con Multiline impostata su True, il cursore non va a capo.

Credo il cursore venga posizionato nel punto in cui termina l'operazione di trascinamento o che rimanga selezionato il testo copiato.

Per modificare questo comportamento puoi inserire nell'evento TextChanged dell'EditField

Me.SelStart = Len(Me.Text)

Inoltre perchè posso trasportare una riga in una EditField e non in un'altra ListBox ?


Trovi un esempio alla voce DragItem nella Language Reference:

***
Each ListBox has its EnableDrag property set to True. The DragRow event handler is:
Function DragRow (drag as DragItem, row as Integer) As Boolean
 Drag.PrivateRawData("text")= Me.List(Row)+ EndOfLine //get the text
   Me.RemoveRow(Row)
  Return True //allow the drag
To enable each ListBox to accept the dragged text, the following statement appears in its Open event handler:

Me.AcceptRawDataDrop("text")
The DropObject event handler is as follows:

Sub DropObject (obj as DragItem)
 If  obj.RawDataAvailable("text") then
   Me.AddRow(obj.RawData("text"))
 end if
***

--
gilberto de faveri
omnidea srl

edificio pegaso
parco scientifico tecnologico vega
via delle industrie, 15
30175 venezia marghera

tel +39 041 509 3441
fax +39 041 509 3641

www.omnidea.it



<Prev in Thread] Current Thread [Next in Thread>