[Gambas-user] Multiselect files

Benoit Minisini gambas at ...1...
Wed May 11 14:01:04 CEST 2005


On Wednesday 11 May 2005 12:46, ML wrote:
> On 10/05/2005 11:45, Marco Gusy wrote:
> > Thanks for the fast answer!
> >
> > I think Dialog class should allow multiselect, if any developer would
> > like to implement this it would be great.
>
> Well, a quick hack that works for me is in the attached patches to
> CDialog.cpp files in gb.qt and gb.qt.kde that allow to select multiple
> files.
>
> The new method Dialog.OpenFiles behaves like its brother Dialog.OpenFile
> (that is it returns true if no files have been selected and vice versa)
> but, after calling OpenFiles, Dialog.Path contains a string containing all
> the files chosen, separated by spaces.
>
> You can then easily split the string to get an array of the files you
> selected.
>
> Ciao,
> Piero

Thanks for the patch. I will use it, but in a different way. I will add in the 
next development version an optional parameter to Dialog.OpenFile(), to tell 
that we want to select multiple files, and a new property, Dialog.Paths, that 
will return an array of the selected files.

Regards,

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the User mailing list