Topic
3 replies Latest Post - ‏2013-05-17T14:53:08Z by DesHao
SystemAdmin
SystemAdmin
3180 Posts
ACCEPTED ANSWER

Pinned topic Drag and Drop from Listview to Treeview

‏2013-03-21T15:01:07Z |
Hi All,

I'm trying to implement drag and drop between from a listview to a treeview.

In my listview definition, I have a callback function. In my treeview definition, I have the same callback function as below.
void mylistcallback(DropEvent de)
{
bool b = de.sourceIsListView
bool b1 = de.targetIsTreeView

print "list : " b "\n"
print "tree : " b1 ""

// index in the listview
print de.sourceIndex "\n"
}

ctlTreeViewLRU = treeView(dbReqBox, mylistcallback, 0, 300, 15)
...
ctlListViewLRUItem = listView(dbReqBox, mylistcallback, listViewOptionSortText, 700, 15, dummy)
I can get the index of the element I want to drag (into the list view). But I can't get the indew in the treeview where I want to drop the element coming from my listview

How can I know where I want to insert my element in the treeview ?

Thanks and regards

David
Updated on 2013-03-21T16:29:42Z at 2013-03-21T16:29:42Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    3180 Posts
    ACCEPTED ANSWER

    Re: Drag and Drop from Listview to Treeview

    ‏2013-03-21T15:32:50Z  in response to SystemAdmin
    I answer my own topic !!

    I tried the property 'targetPath' on the dropEvent and it works. I can get the path in the target treeview although the DXL reference manual stipulate the following :

    'targetPath: The path of the target item of a drag operation; this is only valid if targetIsListView is true, otherwise, it is null'

    but in my case, targetIsListView is false since my target is a treeview !!!!

    The documentation doesn't seems to be up to date !!!
    • SystemAdmin
      SystemAdmin
      3180 Posts
      ACCEPTED ANSWER

      Re: Drag and Drop from Listview to Treeview

      ‏2013-03-21T16:29:42Z  in response to SystemAdmin

      The documentation doesn't seems to be up to date !!!

      Welcome to DOORS DXL development :-)

       

       

       

      • Pekka Mäkinen - http://www.softqa.eu/

       

       

      Updated on 2014-01-06T23:21:09Z at 2014-01-06T23:21:09Z by iron-man
  • DesHao
    DesHao
    2 Posts
    ACCEPTED ANSWER

    Re: Drag and Drop from Listview to Treeview

    ‏2013-05-17T14:53:08Z  in response to SystemAdmin

    Hi,

    If I understood it right, you want to drag an item from the list view and drop it into dbe like a mini explorer?

    so you can replace the "block" function with the "show" function. after that both list view and tree view will be "true" and you can proceed.

    regards

    Hao