Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
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
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
Answer This question was answered by Peter Albert, on Tuesday, November 11, 2008 1:19 PM

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
 11-Nov-2008 02:24
User is offline View Users Profile Print this message


Chris Welch

Posts: 19
Joined: 10-Jan-2006

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
Report this to a Moderator Report this to a Moderator
 11-Nov-2008 08:12
User is offline View Users Profile Print this message


Peter Albert

Posts: 232
Joined: 30-Dec-2005

Answer 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
Report this to a Moderator Report this to a Moderator
 11-Nov-2008 14:10
User is offline View Users Profile Print this message


Chris Welch

Posts: 19
Joined: 10-Jan-2006

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
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.