![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Have 2 listviews, how to determine which list the item was dropped on? Topic Summary: Created On: 11-Nov-2008 02:24 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: Hi Chris, I don't think you can directly get the name of a DBE, but you can simply achieve your goal by comparing drop.source and drop.target. A callBack fragment would look like void listCallback(DropEven drop) { DBE sDBE = drop.source DBE tDBE = drop.target if (sDBE == tDBE) { print "Don't drag and drop onto the same list view DBE\n" } else { // your code here } } If you are really keen on getting the name, you could store the DBEs in a global Skip list upon creation, with the DBE variable as key and the name as value, and then with a string dbeName if (find(dbeSkip, sDBE, dbeName)){print "You dragged and dropped onto " dbeName "."} get the appropriate name. Regards, Peter | |
![]() |
|
I have 2 listviews and I've used the callback functions of the list to identify which list I start with but cannot reliably identify which list the item is dropped on.
Is there a way to get the name of a DBE when using drag-n-drop? the DropEvent allows me to get the DBE of the source/target but is there some undocumented (poorly documented) function to get the name of the DBE? My goal is to prevent a user from dropping an item on the same list they start with. I've checked the forums and help files but to no avail. Any ideas/suggestions/leads? TIA Chris in VA |
|
![]() |
|
![]() |
|
Hi Chris,
I don't think you can directly get the name of a DBE, but you can simply achieve your goal by comparing drop.source and drop.target. A callBack fragment would look like void listCallback(DropEven drop) { DBE sDBE = drop.source DBE tDBE = drop.target if (sDBE == tDBE) { print "Don't drag and drop onto the same list view DBE\n" } else { // your code here } } If you are really keen on getting the name, you could store the DBEs in a global Skip list upon creation, with the DBE variable as key and the name as value, and then with a string dbeName if (find(dbeSkip, sDBE, dbeName)){print "You dragged and dropped onto " dbeName "."} get the appropriate name. Regards, Peter |
|
![]() |
|
![]() |
|
DOH!
![]() Didn't even think about doing that; I guess I was wrapped up in comparing the names of the DBEs and didn't think to see if the elements were the same... Thanks! Chris in VA |
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.