"Normal" file browser for directories


#1

Is there any way we can ge the "normal" file browser for choosing directories? Sorry, I don't know what else to call it. What I mean by "normal" is that on Windows it would look like File Explorer. So on Windows, pretty much the same as the FileChooser does when choosing or saving files.  I'm not sure how it works on other systems, but the current one on Windows isn't the most intuitive in my opinion. Most applications I use these days use this "normal" one and I would much rather have that for my own JUCE apps.

 

As another note while I'm here, I found a problem with the 'Load' File Browser With Image Preview in the Juce Demo's Dialog Boxes demo on Windows when you use the native window. The problem is that you can resize the window larger, but you can't make it smaller. 


#2

You can tell the FileChooser to use native dialog boxes with the last parameter of the constructor. Is that what you're after Jordan?

FileChooser (const String &dialogBoxTitle, const File &initialFileOrDirectory=File::nonexistent, const String&filePatternsAllowed=String::empty, bool useOSNativeDialogBox=true)

#3

You should search the JUCE code for the function you’re looking for to see if/how it’s implemented… In this case grep for SHBrowseForFolder

Rail


#4

No that's the one that i'm currently using and don't like. The file browser I want is used in pretty much every (Windows) application that I use these days. For instance, if you choose a directory for a project in Visual Studio or the folder in Sublime Text, you'll get the "normal" file browser (File Explorer). The one that is currently used by JUCE is like just a tree view, instead of like File Explorer. It's native, but not the one that most people are probably expecting. I believe most other libraries/frameworks (like Qt) use the one that I'm speaking about. I'm not sure how this is on other platforms, like OS X or Linux, but I imagine it's similar. Does anyone know?

I have included two images showing the one that JUCE uses, and the one that I want.

JUCE:

"Normal" File Explorer from my Qt app:


#5

QFileDialog is a custom dialog and not a standard Windows dialog. JUCE uses the standard SHBrowseForFolder function.

https://msdn.microsoft.com/en-us/library/windows/desktop/bb762115(v=vs.85).aspx

Rail


#6

Ah, I see. Well most applications I use have this same kind of "Folder Chooser" on Windows. I'm not sure how it's done though. I just tried JUCE's FileChooser with for choosing directories on Linux (Ubuntu with Cinnamon desktop) and it worked exactly as expected on there. The only one that seems quite different is the one that's used on Windows currently. On Ubuntu you get the nautilus browser, similar to the Windows File Explorer.

I would really rather not deal with the Windows API. I'm hoping that JUCE can add support for this at some time. 


#7

I have this problem too. That SHBrowseForFolder is just horrible.

So that native windows looking dialog I see there is actually assembled in QT, but I"m guessing out of various native windows components?