i have some GET and enable "DROPFILES"
- Code: Select all Expand view
- ON DROPFILES DoDropFiles( nRow, nCol, aFiles )
i try to found TGET and compare Position where i drop
- Code: Select all Expand view
- PROCEDURE DoDropFiles( nRow, nCol, aFiles )
LOCAL ii, iMax, oObj, cVALTYPE
LOCAL aCtrls := oMain:aControls
cVALTYPE := VALTYPE(aFiles)
FWLOG "VALTYPE", cVALTYPE, aFiles
FOR ii := 1 TO LEN( aCtrls )
oObj := aCtrls[ ii ]
IF VALTYPE( oObj ) == "O"
DO CASE
CASE oObj:ClassName() == "TGET"
IF oObj:nTop <= nRow .AND. nRow <= oObj:nTop + oObj:nHeight
IF oObj:nLeft <= nCol .AND. nCol <= oObj:nLeft + oObj:nWidth
// drop to GET
IF cVALTYPE = "A"
oObj:cVarName := aFiles[1]
ELSE
oObj:cVarName := aFiles
ENDIF
oObj:refresh()
FWLOG oObj:nTop, nRow, oObj:nTop + oObj:nHeight
FWLOG oObj:nLeft, nCol, oObj:nLeft + oObj:nWidth
EXIT
ENDIF
ENDIF
ENDCASE
ELSE
FWLOG "not Object", oObj
ENDIF
NEXT
RETURN
Position seems right in Logfile but it does not appear in GET ... is ::cVarName right
---
- Code: Select all Expand view
- STATIC oMain
PROCEDURE MAIN( cDbf1, cDbf2 )
LOCAL oText_1
LOCAL oText_2
LOCAL oBtn_1
LOCAL oBtn_2
LOCAL oBtn_3
LOCAL oBtn_4
LOCAL cDBF_1 := ""
LOCAL cDBF_2 := ""
IF !EMPTY( cDbf1 )
cDBF_1 := cDbf1
ENDIF
IF !EMPTY( cDbf2 )
cDBF_2 := cDbf2
ENDIF
DEFINE WINDOW oMain FROM 0, 0 TO 600, 800 PIXEL TITLE "FiveWin Sync DBF Demo " + cVersion ICON "A1MAIN" NOMAXIMIZE NOMINIMIZE
@ 010, 010 BUTTON oBtn_1 PROMPT FWString( "Source DBF" ) SIZE 100, 30 PIXEL ACTION( cDBF_1 := cGetFile( "DBF File(*.dbf)|*.dbf|", "Select any dbf file",, CURDIR() ), oText_1:refresh() ) OF oMain
@ 010, 120 GET oText_1 VAR cDBF_1 SIZE 650, 30 PIXEL
@ 080, 010 BUTTON oBtn_2 PROMPT FWString( "Target DBF" ) SIZE 100, 30 PIXEL ACTION( cDBF_2 := cGetFile( "DBF File(*.dbf)|*.dbf|", "Select any dbf file",, CURDIR() ), oText_2:refresh() ) OF oMain
@ 080, 120 GET oText_2 VAR cDBF_2 SIZE 650, 30 PIXEL
ACTIVATE WINDOW oMain ;
ON DROPFILES DoDropFiles( nRow, nCol, aFiles ) ;
CENTER
RETURN