Help with wxFileDialog

Started by stratos, June 29, 2021, 19:03:03

Previous topic - Next topic

stratos

Hi,
I'm using the awesome wxMax mod and I need to select multiple file from a wxFileDialog but it doesn't work.


Local ofd:wxFileDialog = New wxFileDialog.Create(Self, "Select files...", "", "", "", wxFD_OPEN | wxFD_MULTIPLE)

If ofd.ShowModal() = wxID_OK
' do something with the files...
End If

ofd.Destroy()


The dialog pops up but I can select only one file.

Thanks in advance.

Henri

Hi,

I tried it and indeed it doesn't work for some reason. I can check this at some point.

-Henri
- Got 01100011 problems, but the bit ain't 00000001

Henri

#2
Okay, managed to find the problem.

Constant wxFD_MULTIPLE should actually be $0200 instead of $0020.


Two ways to correct this:

  1.  Change the value in wxFileDialog.bmx (requires some module building which shouldn't be a problem if you have NG)
 
  2. Create your own constant and use that instead like:
   
Code (blitzmax) Select

Const wxFD_MULTIPLE_EX:Int = $200



Ps. You dont have to specify the wxFD_OPEN style with the wxFD_MULTIPLE style.

-Henri
- Got 01100011 problems, but the bit ain't 00000001

stratos

Problem solved!

I changed the value of wxFD_MULTIPLE in the common.bmx file, in the wxfiledialog.mod folder and now everything works perfectly.

Thank you very much!