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: With "fileName" is it possible to pick directory only?
Topic Summary:
Created On: 4-Dec-2006 17:07
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 Pekka Mäkinen, on Monday, December 4, 2006 11:49 PM

Answer:
Pete. look at

http://www.smartdxl.com/directoryname.html
 4-Dec-2006 17:07
User is offline View Users Profile Print this message


Pete Kowalski

Posts: 301
Joined: 7-Feb-2003

The attached code shall produce a GUI that allows a user to browse the file system. In the field, the user is able to type in a file name.

My question is can the fileName function be modifed somehow that will only allow a user to select a directory by clicking on the Browse button and not allowing him to type anything in the field?

What I am trying to accomplish is make a report tool of mine more dummy proof by only allowing the user select the directory where the report shall be written to.

Thanks for any tips.

-------------------------
pete.kowalski(at)motorola.com
Report this to a Moderator Report this to a Moderator
 4-Dec-2006 17:54
User is offline View Users Profile Print this message


Antonio Norkus

Posts: 109
Joined: 28-Jun-2003

I don't think that you can get your desired behaviour with the fileName function.

However, you can put your desired filename into the field and, when the user has selected a directory, throw away the filename at the end of the path and put your desired on back on again.

Basically, ignore any changes to the filename that the user may have made...it would probably be a good idea to inform them that your script is going to do this.

Here's an example, using a regexp to extract the path from the filename...

Report this to a Moderator Report this to a Moderator
 4-Dec-2006 19:07
User is offline View Users Profile Print this message


Pekka Mäkinen

Posts: 276
Joined: 18-Mar-2004

Answer Answer
Pete. look at

http://www.smartdxl.com/directoryname.html

-------------------------
Pekka.Makinen@softqa.fi
SoftQA Oy -http://www.softqa.fi/

Edited: 5-Dec-2006 at 06:33 by Pekka Mäkinen
Report this to a Moderator Report this to a Moderator
 4-Dec-2006 23:50
User is offline View Users Profile Print this message


Pete Kowalski

Posts: 301
Joined: 7-Feb-2003

Antonio,

Thanks for sharing your code. It is very useful on another DXL hack.

-------------------------
pete.kowalski(at)motorola.com
Report this to a Moderator Report this to a Moderator
 23-Apr-2007 23:35
User is offline View Users Profile Print this message


jason haury

Posts: 39
Joined: 20-Feb-2007

The code found at Pekka's link (smartdxl.com) works great with one small exception: when one opens the directory browser then closes it (using the OK or Close buttons), then the original GUI ends up in the back ground.

When opening the directory browser, the function "doBrowse()" uses "block" to display the browser. When the user closes this window in some way, both "doSelectOK()" and "doSelectCancel()" use "release" followed by "hide" to close the directory browser window. I've played around with trying to use other functions for managing the visibility of a GUI window, but I can't seem to do is make my main GUI come back to the foreground after i close the directory browser window. Any clues?

i've attached a small piece of code showing the possible behaviors of a parent DB ("main GUI")  and it's child ("the kid").  i have commented lines that will let you see for yourself how the alternatives don't work well either.  the goal is to have a parent DB spawn a child DB, and then when the child is closed, to have the focus go back to the parent, all the while keeping the parent inactive as long as the child is visable.

Jason

 

 



Edited: 24-Apr-2007 at 01:01 by jason haury
Report this to a Moderator Report this to a Moderator
 24-Apr-2007 10:34
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

My apologies - there were bugs in the code.
I have amended the code on the website to fix these issues.

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

Edited: 24-Apr-2007 at 14:03 by Tony Goodman
Report this to a Moderator Report this to a Moderator
 24-Apr-2007 21:50
User is offline View Users Profile Print this message


jason haury

Posts: 39
Joined: 20-Feb-2007

Perfect! Thanks!
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.