Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » How can I select multiple directory/folders using FileSel?
How can I select multiple directory/folders using FileSel? [message #38784] Thu, 17 January 2013 12:55 Go to next message
navi is currently offline  navi
Messages: 107
Registered: February 2012
Location: Sydney, Australia
Experienced Member
Hi All,

In my application I need a way to provide my user with an interface to select multiple folders in-order to build a list of folders. FileSel.ExecuteOpen() with FileSel.Multi(true) allows the user to select multiple files at once and returns a nice list. But if FileSel.ExecuteSelectDir() is used then FileSel.Multi(true) is ignored and will still not allow to select more then one folder at a time!

I have tried having a look inside the FileSel Class. In particular the Execute() method. To complicated to understand what is going on in their. Any tips for how (or if possible) to go around implementing an extension around FileSel to achieve multiple folder selection?

Thanks & Regards
Navi
Re: How can I select multiple directory/folders using FileSel? [message #38807 is a reply to message #38784] Sat, 19 January 2013 15:14 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Multi support for SelectDir added.

Mirek
Re: How can I select multiple directory/folders using FileSel? [message #38808 is a reply to message #38807] Sat, 19 January 2013 15:18 Go to previous messageGo to next message
navi is currently offline  navi
Messages: 107
Registered: February 2012
Location: Sydney, Australia
Experienced Member
mirek wrote on Sat, 19 January 2013 15:14

Multi support for SelectDir added.

Mirek


wow! awesome! you are amazing! so quick!

heaps of thanks & regards
navi
Re: How can I select multiple directory/folders using FileSel? [message #38813 is a reply to message #38784] Sun, 20 January 2013 02:41 Go to previous message
navi is currently offline  navi
Messages: 107
Registered: February 2012
Location: Sydney, Australia
Experienced Member
Very Happy Finally got it working. I guess it just missed the Nightly builds of 01/19/2013 (release 5717). I actually though you only changed the FileSel.cpp and FileSel.h, so I downloaded these 2 files from SVN and it didn't work. But I downloaded the entire http://upp-mirror.googlecode.com/svn/trunk/uppsrc/CtrlLib/ and is now working 100%. I guess your changes spread much wider then only FileSel.cpp and FileSel.h.


One strange thing:

I am actually slightly cheating the system with this
class FileSelExtended : public FileSel{
	public:
        Vector<String>& GetVector(){ return fn; }
};
I am actually selecting at least hundreds of files/directories. thousands in many cases. so coping the name one by one using the operator[] seemed a bit of waste of cpu. I know, its not good and essentially a security issue for FileSel if not careful. but honestly ones I get the vector, I do not need to use any other function from that FileSel instance at this point.

now the strange bit is, in case of filename, you only keep the filename in the fn vector and append the path at operator[]. where in case of folders you keep the whole path and the folder name in fn vector. I no issues with it what so ever. I am happy with or without path in fn. you are the author, I guess you know best.

regards
navi
Previous Topic: Can this be done through U++ and if so how?
Next Topic: How to Draw without overriding Paint?
Goto Forum:
  


Current Time: Fri Apr 26 11:46:12 CEST 2024

Total time taken to generate the page: 0.03339 seconds