Problem with xBrowse and Drag&Drop (solved!)

Problem with xBrowse and Drag&Drop (solved!)

Postby gkuhnert » Tue Apr 12, 2011 8:20 am

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  Expand view
#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
gkuhnert
 
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands

Re: Problem with xBrowse and Drag&Drop

Postby nageswaragunupudi » Tue Apr 12, 2011 9:36 am

Please see this posting.
viewtopic.php?f=3&t=20023&p=105691&hilit=bdragbegin#p105691

Does this help you?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Problem with xBrowse and Drag&Drop

Postby gkuhnert » Tue Apr 12, 2011 11:37 am

Mr. Rao,

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

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
User avatar
gkuhnert
 
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 85 guests