Page 1 of 1

TShellTree Problem with path for non folders

Posted: Wed Feb 01, 2006 8:55 am
by Treoxx
Hello,

I like to use PTShellTree for browsing for a license file.
(This file will be later copied to the installation folder)

The options make it possible to show non-folders in the tree list.
The only problem is that when I select a file the path in the TARGETDIR is set to:

c:\\programfiles\\testdir\\licence.txtThe path is always like an folder even when I select non folders.

Is there any solution for this?
(Exept empty the TARGETDIR variabele before the window has opened.)

Thanks!

Posted: Wed Feb 01, 2006 9:38 am
by CandiceJones
Hi!

You could just use Parse String and remove the last "\" that way.

Posted: Wed Feb 01, 2006 9:57 am
by Treoxx
yes, that is an option I've tried.

But it looks stupid for the user at the time a file is choosen, and there are some other troubles.

Like this:

Choose file:

D:\\testdir\\test.txt\\

next
back

D:\\testdir\\test.txt

next
back
Choose other file! and than it happends:

D:\\testdir\\theotherfilecomeshere.txt\\test.txt



Yust tried again: Above doen't have anything to do with the parse string, it is always happening, the second try to select a file.

Posted: Wed Feb 01, 2006 10:10 am
by jimo
You may want to try the "File Dialog" plugin to return the file name.

Available here:mdPlugins

Posted: Wed Feb 01, 2006 10:23 am
by Treoxx
I've tried the plugin and it is a workable option.

The problem is just:

The user has to choose three different things:

InstallationDir
DatabaseDir
Licensefile

I'd like to see that all dialogs work on the same way to keep it simple, fast and clean.

InstallationDir and DatabaseDir are not a problem with the PTShellTree, the licensefile is another story.

Posted: Wed Feb 01, 2006 1:46 pm
by MichaelNesmith
Maybe you can use the PTShellList to select the file? After all, that control is specifically designed to display files.

Posted: Thu Feb 02, 2006 4:30 am
by Treoxx
I've tried the PTShellList but I'm having the same problems.
The slash is always there even after a file selection.

And the problem I've described in the post in this tread at Wed Feb 01, 2006 2:57 pm.

Posted: Thu Feb 02, 2006 7:48 am
by MichaelNesmith
Hi!

I built an example project for you...its called "File Selector" and contains Explorer controls.

I have attached the built EXE and the sources of the project. It works fine as far as I can tell...please take a look!

File Attached:

File Selector.zip

Posted: Fri Feb 03, 2006 4:05 am
by Treoxx
Michael,

That is the exact same way I did to get the problem out of the way :)

The problem was that I liked to use an edit box with it, so the user can fill in the location of the file without browsing, so I had to use the variable TARGETDIR. (To let show the selected path in the edit box.)

I've changed your version to my first solution, with the problem with the slashes.

Try to select a file, next - back - select another file.
And have a look at the PATH.

Many thanks for the support by the way!

File Attached:

File Selector.zip

Posted: Fri Feb 03, 2006 8:05 am
by MichaelNesmith
Ah, I see! This is because you are setting the "receives value" field to "installation folder", which is causing the file path to be modified like a folder path.

Posted: Fri Feb 03, 2006 9:16 am
by Treoxx
MichaelNesmith wrote:Ah, I see! This is because you are setting the "receives value" field to "installation folder", which is causing the file path to be modified like a folder path.


Thats true,

But if I don't do that the edit box is not interactive with the PTShellList.
So I can never show an good filepath in an interactive editbox.

Posted: Fri Feb 03, 2006 10:21 am
by MichaelNesmith
Don't worry - we're addressing this control interactivity issue very soon. Having to fall back on TARGETDIR for everything is getting quite inconvenient, so we will resolve this!