Page 1 of 1

Problem with xBrowse and Drag&Drop (solved!)

Posted: Tue Apr 12, 2011 8:20 am
by gkuhnert
Hi,

with xBrowse it happens often, that the drag-cursor is activated if you don't try to drag something. If you start my example, it opens two mdi-childs. If for example, the right one has the focus and you click on a cell in the left mdi-child, the drag-cursor gets activated without trying to drag anything.
Has anyone an idea, how to avoid this unwanted behaviour?

Code: Select all

#include "fivewin.ch"
#include "xbrowse.ch"

Function Main()
local oWnd, oWndChild1, oWndChild2
local oCursor
local oWndEdit, oBar, oImage
local cName := "FiveWin power"
local oBrw1, oBrw2
local aArray1 := {}
local nI

    for nI := 1 to 1000
        aAdd(aArray1, {"Small text" + cValToStr(nI), "A typically Longer text Description of a random item " + cValToStr(nI), "Information" + cValToStr(nI),;
                            "Small text" + cValToStr(nI), "A typically Longer text Description of a random item " + cValToStr(nI), "Information" + cValToStr(nI),;
                            "Small text" + cValToStr(nI), "A typically Longer text Description of a random item " + cValToStr(nI), "Information" + cValToStr(nI),;
                            "Small text" + cValToStr(nI), "A typically Longer text Description of a random item " + cValToStr(nI), "Information" + cValToStr(nI),;
                            "Small text" + cValToStr(nI), "A typically Longer text Description of a random item " + cValToStr(nI), "Information" + cValToStr(nI),;
                            "Small text" + cValToStr(nI), "A typically Longer text Description of a random item " + cValToStr(nI), "Information" + cValToStr(nI),;
                            "Small text" + cValToStr(nI), "A typically Longer text Description of a random item " + cValToStr(nI), "Information" + cValToStr(nI),;
                            "Small text" + cValToStr(nI), "A typically Longer text Description of a random item " + cValToStr(nI), "Information" + cValToStr(nI),;
                            "Small text" + cValToStr(nI), "A typically Longer text Description of a random item " + cValToStr(nI), "Information" + cValToStr(nI),;
                            "Small text" + cValToStr(nI), "A typically Longer text Description of a random item " + cValToStr(nI), "Information" + cValToStr(nI),;
                            "Small text" + cValToStr(nI), "A typically Longer text Description of a random item " + cValToStr(nI), "Information" + cValToStr(nI)})

    next

    DEFINE CURSOR oCursor hand

   DEFINE WINDOW oWnd FROM 1, 1 TO 20, 70 TITLE "Drag&Drop Test" MDI

   DEFINE WINDOW oWndChild1 MDICHILD OF oWnd FROM 1, 1 TO 70, 99 TITLE "MDI Child 1"

   @ 1,1 XBROWSE oBrw1 OF oWndChild1 AUTOCOLS ARRAY aArray1 CELL LINES
       oBrw1:CreateFromCode()
    oWndChild1:oClient := oBrw1

       oBrw1:oDragCursor := oCursor        // Select a Drag cursor
    oBrw1:bDragBegin  := {|nRow, nCol, nKeyFlags| SetDropInfo({"ABCDEF"}) }


   ACTIVATE WINDOW oWndChild1

   DEFINE WINDOW oWndChild2 MDICHILD OF oWnd FROM 1, 101 TO 70, 199 TITLE "MDI Child 2"

   @ 1,1 XBROWSE oBrw2 OF oWndChild2 AUTOCOLS ARRAY aArray1 CELL LINES
    oBrw2:CreateFromCode()
    oWndChild2:oClient := oBrw2

       oBrw2:oDragCursor := oCursor        // Select a Drag cursor
    oBrw2:bDragBegin  := {|nRow, nCol, nKeyFlags| SetDropInfo({"ABCDEF"}) }

    ACTIVATE WINDOW oWndChild2

   ACTIVATE WINDOW oWnd MAXIMIZED

return .t.
 

Re: Problem with xBrowse and Drag&Drop

Posted: Tue Apr 12, 2011 9:36 am
by nageswaragunupudi
Please see this posting.
http://forums.fivetechsupport.com/viewt ... in#p105691

Does this help you?

Re: Problem with xBrowse and Drag&Drop

Posted: Tue Apr 12, 2011 11:37 am
by gkuhnert
Mr. Rao,

thanks for your reply. That appears to help :