#include "Fivewin.ch"
function Main()
Local oDlg
Local oLbx1, oLbx2, oLbx3, cValue, aItems
Local oBrw1, oBrw2, oBrw3
Local oCursor, oOrigen, oDestino
DEFINE CURSOR oCursor drag
aItems := { "UNO", "DOS", "TRES", "CUATRO", "CINCO", "SEIS", "SIETE" }
DEFINE DIALOG oDlg SIZE 800,600
@ 10, 10 LISTBOX oLbx1 VAR cValue ITEMS aItems ;
SIZE 80, 100 PIXEL OF oDlg
@ 10, 100 LISTBOX oLbx2 VAR cValue ITEMS {} ;
SIZE 80, 100 PIXEL OF oDlg
@ 10, 300 XBROWSE oBrw1 OF oDlg COLUMNS 1 ;
ARRAY { "Item 1","Item 2","Item 3","Item 4" } ;
SIZE 100, 100 PIXEL
@ 120, 10 XBROWSE oBrw2 OF oDlg COLUMNS 1 ;
ARRAY { "Item 1","Item 2","Item 3","Item 4" } ;
SIZE 100, 100 PIXEL
@ 120, 120 XBROWSE oBrw3 OF oDlg COLUMNS 1 ;
ARRAY { "Item 11","Item 12","Item 13","Item 14" } ;
SIZE 100, 100 PIXEL
@ 120, 300 LISTBOX oLbx3 VAR cValue ITEMS {} ;
SIZE 80, 100 PIXEL OF oDlg
oBrw1:CreateFromCode()
oBrw2:CreateFromCode()
oBrw3:CreateFromCode()
oLbx1:Cargo := "LBX1"
oLbx2:Cargo := "LBX2"
oLbx3:Cargo := "LBX3"
oBrw1:Cargo := "BRW1"
oBrw2:Cargo := "BRW2"
oBrw3:Cargo := "BRW3"
// DEFINIR DRAG AND DROP
oLbx1:oDragCursor := oCursor
oLbx1:bDragBegin := { | nRow, nCol, nKeyFlags | ;
oOrigen := oLbx1, ;
SetBegin(oOrigen) }
oLbx1:bDropOver := { | uDropInfo, nRow, nCol, nKeyFlags | ;
oDestino := oLbx1, ;
SetOver(uDropInfo, nRow, nCol, nKeyFlags, oOrigen, oDestino) }
oLbx2:oDragCursor := oCursor
oLbx2:bDragBegin := { | nRow, nCol, nKeyFlags | ;
oOrigen := oLbx2, ;
SetBegin(oOrigen) }
oLbx2:bDropOver := { | uDropInfo, nRow, nCol, nKeyFlags | ;
oDestino := oLbx2, ;
SetOver(uDropInfo, nRow, nCol, nKeyFlags, oOrigen, oDestino) }
oLbx3:oDragCursor := oCursor
oLbx3:bDragBegin := { | nRow, nCol, nKeyFlags | ;
oOrigen := oLbx3, ;
SetBegin(oOrigen) }
oLbx3:bDropOver := { | uDropInfo, nRow, nCol, nKeyFlags | ;
oDestino := oLbx3, ;
SetOver(uDropInfo, nRow, nCol, nKeyFlags, oOrigen, oDestino) }
oBrw1:oDragCursor := oCursor
oBrw1:bDragBegin := { | nRow, nCol, nKeyFlags | ;
oOrigen := oBrw1, ;
SetBegin(oOrigen) }
oBrw1:bDropOver := { | uDropInfo, nRow, nCol, nKeyFlags | ;
oDestino := oBrw1, ;
SetOver(uDropInfo, nRow, nCol, nKeyFlags, oOrigen, oDestino) }
oBrw2:oDragCursor := oCursor
oBrw2:bDragBegin := { | nRow, nCol, nKeyFlags | ;
oOrigen := oBrw2, ;
SetBegin(oOrigen) }
oBrw2:bDropOver := { | uDropInfo, nRow, nCol, nKeyFlags | ;
oDestino := oBrw2, ;
SetOver(uDropInfo, nRow, nCol, nKeyFlags, oOrigen, oDestino) }
oBrw3:oDragCursor := oCursor
oBrw3:bDragBegin := { | nRow, nCol, nKeyFlags | ;
oOrigen := oBrw3, ;
SetBegin(oOrigen) }
oBrw3:bDropOver := { | uDropInfo, nRow, nCol, nKeyFlags | ;
oDestino := oBrw3, ;
SetOver(uDropInfo, nRow, nCol, nKeyFlags, oOrigen, oDestino) }
ACTIVATE DIALOG oDlg CENTER
RETURN .F.
//-----------------------**-----------------------------------------------//
STATIC FUNCTION SetBegin(oOrigen)
/*
Local cOrigen := Left(oOrigen:Cargo, 3)
If cOrigen == "LBX"
If len(oOrigen:aItems) >0
SetDropInfo( oOrigen:getSelText() )
EndIf
RETURN NIL
EndIf
If cOrigen == "BRW"
SetDropInfo( oOrigen:aArrayData[oOrigen:nArrayAt] )
EndIf
*/
RETURN NIL
//-----------------------**-----------------------------------------------//
STATIC FUNCTION SetOver( uDropInfo, nRow, nCol, nKeyFlags,;
oOrigen, oDestino)
Msginfo("Arratrando " + oOrigen:Cargo + " a " + oDestino:Cargo)
RETURN NIL
return nil