04-13-2010 07:32 AM
Hi all,
I want to use the file browser (from FileBrowser.fp). If a path is given (e.g. from history) I want the file to be selected in the file browser, and the directory tree being expanded to the appropriate directory.
The only function I have found was to set the attribute ATTR_START_PATH which doesn't fit my needs because it limits browsing to this directory (and subfolders), but I want the user to be able to browse everything, including root level.
Is there a function or an example to preselect a path or a file with path in the file browser?
Thanks in advance for your help.
04-14-2010 10:46 AM
The way I did this was to use Makepathname and FileSelectPopup functions like so:
MakePathname ("c:\\", "Whatever.csv", pathname);
ipath = FileSelectPopup ("c:\\", "*.csv*", ".csv", "Save File As...", VAL_SAVE_BUTTON, 0, 0, 1, 0, pathname);
if (ipath = 0)
break;
This particular case sets the default as a .csv file, but you can have it as any file type. In the first argument of the FileSelectPopup function just set the directory as high up as you like. In my case I wanted to have the whole c drive available. Try this and let me know if it works for you.
04-14-2010 11:12 AM
ACowans,
thank you for your answer.
I don't want to use FileSelectPopup (which has the ability to let the programmer preselect a directory and even a file within this directory).
I want to use the file browser which is available at "C:\Program Files\National Instruments\CVI90\toolslib\custctrl\FileBrowser.fp". This file browser integrates in my user interface (is not a popup). But, as already mentioned, I don't know how to preselect a path in this file browser.
Btw. in the meantime I'm using the FileSelectPopup which unfortunately doesn't perfectly fit into my operational concept.