Added: You can now select multiple items in the tree using checkboxes (just set the $iMultiple parameter to -1). Selecting or clearing an item with the Ctrl key pressed will check/clear all items lower in the tree as long as they have actually been expanded at least once - unexpanded items are unaffected as they do not exist in the dialog tree until they have been expanded.
New: When using checkboxes items in the tree can be prechecked using the _CFF_SetPreCheck function. All items on the passed paths will be checked to give a visual indication that something is prechecked deeper within the tree. Prechecked items will always be returned unless the specific checkbox is expanded and cleared. There is an additional option for the $iDisplay parameter - adding 512 will only return the lowest item on any path so that checking higher level folders does not return them as well. It is not recommended to precheck significant numbers of items within the tree as checking newly expanded items against the large lists will increase the time taken for the tree to update.
Thanks to Deye for the idea and lots of beta testing.
Note you need AutoIt v18.104.22.168 or later to run this release of the UDF as it will not run with earlier versions.
Previous versions: ChangeLog.txt 10.05KB 19 downloads
I was fed up with using the native FileOpenDialog and FileSelectFolder which appeared anywhere on the screen in seemingly random sizes and often allowed users to select files from other than the path desired. So I decided to write my own version of an Explorer-type treeview and here it is: ChooseFileFolder.
What are the main advantages of this UDF over the normal dialogs?
- Common format for both file and folder selection.
- Ability to size and place the dialog where you want it rather than how Windows last left it.
- Ability to select (and delete) multiple items - even from different folders or drives. You can also select both files and folders from the same tree.
- Ability to preselect items.
- And there is also a function to allow you to use an existing treeview in your own GUI to display the folder tree - no need to have a dialog at all.
Here is a zip file with the UDF and several example scripts: ChooseFileFolder.zip 20.11KB 101 downloads
As usual happy to take feedback and, preferably, plaudits.
Edited by Melba23, 11 February 2015 - 11:36 AM.