It's probably been known for ages, so before I report this as a bug, I just wanted to check that I am not overlooking something trivial.
The "Create Folder" function offers to open a dialog if you don't provide a folder path. The problem is that the file dialog that pops up... well is a file dialog, not a folder dialog.
Here I want to create a subfolder called "Transposed" into my folder "100322_AJB", but except for my window title (the only input to the function, beside the destination path - set to empty in this case, hence the dialog box), everything is wrong in the dialog box:
"File name:" ? I want to create (or maybe rename) a FOLDER!
"Save as type:" ? idem
"Save button"? I want to CREATE a folder!
That does not result in very clean GUI, is what I think... I tested this in LV 2010 but I am ready to bet that it has been here since the introduction of that function.
Solved! Go to Solution.
It does show a somewhat confusing dialog, but does create a folder if a "filename" is entered and "Save" selected.
Sure. I am not saying it is not doing what is needed, but you have to guess your way through the dialog as it is not appropriate for "creating a folder", which is after all the name of the function...
As you mentioned this dialog is a bit confusing. I will look into this in more detail, but it seems that the Create Folder function is calling the Windows file dialog dll and there is likely no concrete fix for this without digging deeper into the Windows function codes.
Actually, it's worse than I thought: the dialog popping up when pressing on the file/folder selection button of a path control has the same problem.
And in fact, it DOES NOT behave as "expected".
That is, if you select to open a new or existing folder, the dialog will be the one I have pasted in my first post. Then, typing in a new folder name in the "File name:" box and pressing "Save" will NOT create a folder. You need to bypass all this and use the "Create New Folder" icon of the dialog box (the one with a little red flower or gearbox), then open the folder and click "Current Folder".
This is what I used before, but I thought that Putnam had tested it as I just described. This does not work.
This annoyed me so much that I wrote a VI and DLL to call into the native Windows FolderBrowseDialog. Does not have all of the bells and whistles of the file dialog, but less annoying.
DLL is 32-bit windows.
My usual solution is to use the Mouse Down? event to catch clicks on the browse button and use my own dialog. The easy way to do this requires a private property to get the browse button rectangle. Why it is private is beyond me, but you can also determine it pretty quickly by hand. Or, sometimes I use my own boolean browse button and disable the built-in button.
Every so often I like the UI to be just-so and these are just the lengths I am willing to go to.
It looks like the best short term course of action will be to use the workaround provided by Darin. I have searched our database and haven't come across a pre-existing CAR on this issue. I will check in with R&D and some of our LabVIEW developers to ensure that they are aware of this issue. I will check back in with you to let you know what is going on in regards to this issue.
Thanks for bringing this to our attention!