Gotheallblacks
Programmer
I want to OLEdrag from a source onto the SimplelistListview and Take some action with the passed data
From the source object say a textbox
*OLEStartdrag
LPARAMETERS oDataObject, nEffect
* Clear out all data from the data object
oDataObject.ClearData
nEffect = 1
*-- Register the text (1) format
oDataObject.SetFormat( 1 ) && text
*OLESetdata
LPARAMETERS oDataObject, eFormat
DO CASE
CASE trans( eFormat ) == '1' && Text format
oDataObject.SetData( this.value, 1 )
ENDCASE
I have set the OLElist.OLEDropmode to 1 in the init method which shows allowed to drop
From the OLEDragover
LPARAMETERS oDataObject, nEffect, nButton, nShift, nXCoord, nYCoord, nState
IF nState == 0 && Drag Enter
DO CASE
CASE oDataObject.GetFormat( 1 )
* I can handle drops of text
* Tell OLEDragDrop that I know how to handle this
This.OLEDropHasData = 1
* Tell OLEDragDrop that I want to copy this
This.OLEDropEffects = 1
ENDCASE
ENDIF
And from the OLEDragdrop add a record to cursor and refreshlist
LPARAMETERS data, effect, button, shift, x, y
IF Data.getformat(1)
LOCAL lc
lc = Data.getdata(1)
SELECT test && (READWRITE CURSOR)
APPEND BLANK
replace test.item WITH 'new 1'
replace test.cname WITH lc
replace test.check WITH .t.
this.Parent.refreshlist()
ENDIF
My problem is ,this works with other objects like a Listbox and does not work with ListView, Listview is not recognising the drop.
From the source object say a textbox
*OLEStartdrag
LPARAMETERS oDataObject, nEffect
* Clear out all data from the data object
oDataObject.ClearData
nEffect = 1
*-- Register the text (1) format
oDataObject.SetFormat( 1 ) && text
*OLESetdata
LPARAMETERS oDataObject, eFormat
DO CASE
CASE trans( eFormat ) == '1' && Text format
oDataObject.SetData( this.value, 1 )
ENDCASE
I have set the OLElist.OLEDropmode to 1 in the init method which shows allowed to drop
From the OLEDragover
LPARAMETERS oDataObject, nEffect, nButton, nShift, nXCoord, nYCoord, nState
IF nState == 0 && Drag Enter
DO CASE
CASE oDataObject.GetFormat( 1 )
* I can handle drops of text
* Tell OLEDragDrop that I know how to handle this
This.OLEDropHasData = 1
* Tell OLEDragDrop that I want to copy this
This.OLEDropEffects = 1
ENDCASE
ENDIF
And from the OLEDragdrop add a record to cursor and refreshlist
LPARAMETERS data, effect, button, shift, x, y
IF Data.getformat(1)
LOCAL lc
lc = Data.getdata(1)
SELECT test && (READWRITE CURSOR)
APPEND BLANK
replace test.item WITH 'new 1'
replace test.cname WITH lc
replace test.check WITH .t.
this.Parent.refreshlist()
ENDIF
My problem is ,this works with other objects like a Listbox and does not work with ListView, Listview is not recognising the drop.