LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

File Dialog (Details View and Multiple Selections for View File Type)

I would like to use the generic windows dialog box found in the toolbar under:

File I/O/Advanced File Functions/File Dialog

What I would like to do is have multiple selections for the file type, for example one menu selection is *.txt, another is *.rtf, another is *.csv, etc. Listing a single type is straightforward.

Also does anyone know if there is a way to have the dialog open in the DETAILS view automatically?

Thanks for any help!

Carlton
0 Kudos
Message 1 of 17
(12,915 Views)
Enter the file types ("pattern" input of File Dialog function) as a semicolon delimited list.

For example: "*.txt; *.rtf; *.csv"

Good luck,

-Jim
Message 2 of 17
(12,915 Views)
Hi,
You can do it in following ways:
1. Write in pattern input the string "*.txt; *.csv; *.rtf". This will show to the user only files with this extensions in the dialog.
2. Another way is to create ring or menu where user could specify the extension. Depending on this extension you could wire the appropriate string to the pattern input of "File Dialog.vi"

I have made an example.

Good luck.

Oleg Chutko.
0 Kudos
Message 3 of 17
(12,915 Views)
I want to have the "select type" pop-up menu to have more than one custom pattern. Your suggestion presents files that logically "ORs" the items in the list. What I want is select ONLY *.txt files, or only *.csv files.

For example, when you choose open a file within MS Excel you get a grouped list that lists files of type:

"All Files (*.*)"
"All MS Excel Files (*.xl; *.xls; *xlt; etc.)"
"Web Pages (*.htm; *.html)"
"Text Files (*.prn; *.txt; *.csv)"

This is what I am looking for - sorry if my original question was a little vague. 😞
0 Kudos
Message 4 of 17
(12,915 Views)
This is getting closer to what I want. I want to be able to select the file type from within the File Open dialog window instead of before the window opens.

Having to select the type first in one window, and then navigate to the correct file path and select the appropriate file will be awkward from a user perspective. What if they want to select a different file type while they are browsing the file directory in the File Dialog? They would have to cancel, select the new type from the pop-up menu, and then press the open button again.

Is there a way I can use the standard Windows File Dialog box without having to create my own window in LabVIEW? You get some additional useful features with the windows dialog (e.g. file size, type, modified date),
so I would prefer to use it.

Thanks for you help so far, but I am looking for something different.
0 Kudos
Message 5 of 17
(12,915 Views)
I am trying to do the same thing, but I want the user to be able to select the type for saving. I am wondering if you were ever able to figure out how to populate the list with individual selections.
0 Kudos
Message 6 of 17
(12,915 Views)
Hi,

Doing this with windows api's it though, because the data is passed as a
NULLNULL limited array of NULL limited strings, and there are some other
things to be solved.. I've solved this by creating a memory heap with
windows heap functions, and parsing it with IStrcpy... I can't pass the code
(I changed job, and could not take the code...)

Regards,

Wiebe.


"Terry S" wrote in message
news:506500000005000000DF220100-1042324653000@exchange.ni.com...
> I am trying to do the same thing, but I want the user to be able to
> select the type for saving. I am wondering if you were ever able to
> figure out how to populate the list with individual selections.
0 Kudos
Message 7 of 17
(12,915 Views)
The best result you can get with WinAPI.
I have one sample. You can use it. Unfortunately at this moment I cannot found source code for DLL. (Inside of this DLL Delphi OpenImageDialog was used).
Message 8 of 17
(12,915 Views)

This is how I do it:

 pattern.png

Cheers,

Mikael

Message 9 of 17
(11,768 Views)

I implemented the tip form MikaelH into a VI in order to be able to have a multiple selection for Dialogs without remembering all the codes.

In the picture you can see how to use it

Example.png

 

PS: I know I'm replying to a 7 years old message... but this is the only tip that worked for me. Smiley Happy

Message 10 of 17
(6,585 Views)