SyntaxBomb - Indie Coders

Languages & Coding => BlitzMax / BlitzMax NG => Brucey's Modules => Topic started by: stratos on June 29, 2021, 19:03:03

Title: Help with wxFileDialog
Post by: stratos 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.
Title: Re: Help with wxFileDialog
Post by: Henri 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
Title: Re: Help with wxFileDialog
Post by: Henri 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
Title: Re: Help with wxFileDialog
Post by: stratos 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