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: DB Callback function ignores current folder
Topic Summary: How to get callback function to reset the "current" assignment
Created On: 28-Mar-2006 04:20
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 Tony Goodman, on Thursday, March 30, 2006 4:37 AM

Answer:
Paul,

you could try using the following:

Item itm = getSelectedItem()

You will then need to check if this is a folder, if its open etc etc...

Unforunately this is not the same as "current" because the item may be selected in the list view and therefore not be open.

getSelectedItem returns a handle on the item that is currently selected in the database explorer tree or list view. It is not a perm, but is defined in dbExplorerGlobals.inc.
 28-Mar-2006 04:20
User is offline View Users Profile Print this message


Paul Miller

Posts: 376
Joined: 2-Oct-2002

Hi,

I have script that uses a Top Most DB to display a list of modules in the current folder - works fine when the DB is first opened.

If the user leaves the DB open and selects another folder in the DOORS Explorer, when the user selects a refresh button that triggers a callback, it seems to be stuck on whatever the current folder was at the time the DB was first created.

How can I get a callback to respond to whatever the current folder is in the DOORS Explorer?

Code segment below demonstrates the problem where the initialisation of the Folder variable "f" in function "doRun" seems to get locked on whatever the current folder was during the first run through of this function - subsequent callbacks to function "doRun" do not refresh to the current folder w.r.t. the DOORS Explorer.

DB runAllDB = null
DBE reportBox = null

void doRun(DB db) {

Folder f = current
string folderName

folderName = name(f)
set(reportBox,folderName)
}


runAllDB = topMost("Display Current Folder")

reportBox = text(runAllDB, "Report:", "", 450, 100, false)

left(runAllDB)
btnRun = apply(runAllDB, "Refresh", doRun)

show(runAllDB)

-------------------------
Paul Miller
Specification Practices Specialist,
EuroCyber,
Melbourne, Australia.
Mobile: +61 (0)418 135 103
Web Site: http://www.eurocyber.biz
E-mail: miller@eurocyber.biz">pmiller@eurocyber.biz
Report this to a Moderator Report this to a Moderator
 28-Mar-2006 11:20
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

Answer Answer
Paul,

you could try using the following:

Item itm = getSelectedItem()

You will then need to check if this is a folder, if its open etc etc...

Unforunately this is not the same as "current" because the item may be selected in the list view and therefore not be open.

getSelectedItem returns a handle on the item that is currently selected in the database explorer tree or list view. It is not a perm, but is defined in dbExplorerGlobals.inc.

-------------------------
Tony Goodman
http://www.smartdxl.com

Edited: 28-Mar-2006 at 11:25 by Tony Goodman
Report this to a Moderator Report this to a Moderator
 28-Mar-2006 14:41
User is offline View Users Profile Print this message


Iftakher Uddin

Posts: 56
Joined: 16-Sep-2004

Hi,

following modified code will work for the mentioned problem.

Greetings...
Rony


string getCurrentFolder()
{

OleAutoObj objDOORS = oleGetAutoObject("DOORS.Application")
OleAutoArgs autoArgs = create()
string strCurFolderName = ""
string str = ""
clear(autoArgs)
put (autoArgs, "strCurFolderName = name(current Folder); oleSetResult(strCurFolderName)")
oleMethod(objDOORS,"runStr", autoArgs, str)
strCurFolderName = oleGetResult()
delete (autoArgs)
return strCurFolderName
}

DBE reportBox = null

void doRun(DB db)
{
string folderName = getCurrentFolder
set(reportBox, folderName)
}

runAllDB = topMost("Display current Fodler")
reportBox = text(runAllDB, "Report:", "", 450, 100, false)
left(runAllDB)
btnRun = apply(runAllDB, "Refresh", doRun)

show(runAllDB)



======================
Iftakher Uddin (Rony)
Iftakher.Uddin@HOOD-Group.com

Edited: 29-Mar-2006 at 14:49 by Iftakher Uddin
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.