FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse drag&drop
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
xBrowse drag&drop
Posted: Sat Feb 28, 2009 10:48 PM
Compiled with an older xBrowse version you could click anywhere in the browser to drag and drop.
Compiled with 9.01 you have to click in the row selector column.
How can I get the old behavior.
Thanks in advance.

Regards, Otto


Code (fw): Select all Collapse
//  nageswaragunupudi

#include 'fivewin.ch'

static lThouSep        := .f.
static cNumFormat      := "A"
static nxlLangID, cxlTrue := "=(1=1)", cxlFalse := "=(1=0)", cxlSum, cxlSubTotal, lxlEnglish := .f.

FUNCTION Main()
    LOCAL oWnd, oBrw, oCur, i, aData := {}

    FOR i := 1 TO 6
        AAdd( aData, { str(i,2), "Description " + Str( i ), Replicate( Chr( 64 + i ), 5 ) } )
    NEXT i

    DEFINE CURSOR oCur DRAG
    DEFINE WINDOW oWnd
    oBrw      := TXBrowse():New( oWnd )
    oBrw:SetArray( aData )
    oBrw:CreateFromCode()
    oWnd:oClient := oBrw
    //
    oBrw:oDragCursor   := oCur
    oBrw:bDragBegin    := { |nRow,nCol,nFlags| DragBegin( nRow, nCol, nFlags, oBrw ) }
    oBrw:bDropOver     := { |uDropInfo, nRow, nCol, nFlags| DropOver( uDropInfo, nRow, nCol, nFlags, oBrw ) }
    //
    ACTIVATE WINDOW oWnd
    oCur:End()

RETURN NIL

STATIC FUNCTION DragBegin( nRow, nCol, nFlags, oBrw )
//msginfo("DragBegin")
    SetDropInfo( EVAL( oBrw:SelectedCol():bStrData ) )

RETURN NIL

STATIC FUNCTION DropOver( uDropInfo, nRow, nCol, nFlags, oBrw )
//msginfo("DropOver")
    oBrw:lButtonDown( nRow, nCol, nFlags)
    oBrw:lButtonUp(   nRow, nCol, nFlags)

    MsgInfo( uDropInfo + CRLF + 'dropped on' + CRLF + ;
        EVAL( oBrw:SelectedCol():bStrData ) )

RETURN NIL

Continue the discussion