Problem with xBrowse and Drag&Drop (solved!)

Post Reply
User avatar
gkuhnert
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands
Contact:

Problem with xBrowse and Drag&Drop (solved!)

Post 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.
 
Last edited by gkuhnert on Wed Apr 13, 2011 7:52 am, edited 1 time in total.
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Problem with xBrowse and Drag&Drop

Post by nageswaragunupudi »

Please see this posting.
http://forums.fivetechsupport.com/viewt ... in#p105691

Does this help you?
Regards

G. N. Rao.
Hyderabad, India
User avatar
gkuhnert
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands
Contact:

Re: Problem with xBrowse and Drag&Drop

Post by gkuhnert »

Mr. Rao,

thanks for your reply. That appears to help :
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
Post Reply