October 24, 2021, 23:08:46

Author Topic: Help with wxFileDialog  (Read 730 times)

Offline stratos

  • Jr. Member
  • **
  • Posts: 2
Help with wxFileDialog
« on: June 29, 2021, 19:03:03 »
Hi,
I'm using the awesome wxMax mod and I need to select multiple file from a wxFileDialog but it doesn't work.

Code: [Select]
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.

Offline Henri

  • Sr. Member
  • ****
  • Posts: 356
Re: Help with wxFileDialog
« Reply #1 on: July 01, 2021, 10:54:06 »
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

Offline Henri

  • Sr. Member
  • ****
  • Posts: 356
Re: Help with wxFileDialog
« Reply #2 on: July 01, 2021, 20:15:42 »
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
  1.         Const wxFD_MULTIPLE_EX:Int = $200      


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

-Henri
« Last Edit: July 01, 2021, 20:21:15 by Henri »
- Got 01100011 problems, but the bit ain't 00000001

Offline stratos

  • Jr. Member
  • **
  • Posts: 2
Re: Help with wxFileDialog
« Reply #3 on: July 01, 2021, 22:00:16 »
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!

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal