O. Wyss
--
See "http://wxguide.sourceforge.net/" for ideas how to design your app.
Why not just try it and find out? :-D
Kevin
> I use something like "*.zip" in my code, I so I would assume things like ?
> are supported too.
>
> Why not just try it and find out? :-D
>
I tried "*.cpp;*.h", "*.cpp|*.h" they both doesn't seem to work.
This code works fine for me:
wxArrayString SkinFiles;
const wxString FileSpec = _T("*.zip");
const int flags = wxDIR_FILES;
if (m_SkinsDirectory != wxEmptyString && wxDirExists(m_SkinsDirectory))
{
// Get all .zip files
wxDir::GetAllFiles(m_SkinsDirectory, &SkinFiles, FileSpec, flags);
}
I think GetAllFiles uses the same methods you are trying to use.
I don't know if that helps or not.
Regards,
Kevin
----- Original Message -----
From: "Otto Wyss" <w...@users.sourceforge.net>
Newsgroups: comp.soft-sys.wxwindows
To: <wx-u...@lists.wxwindows.org>
On Tue, Dec 02, 2003 at 10:13:00PM +0100, Otto Wyss wrote:
>
> "Kevin Hock" <hoc...@yahoo.com> wrote:
>
> > This code works fine for me:
> >
> > wxArrayString SkinFiles;
> > const wxString FileSpec = _T("*.zip");
> >
> This works here as well but how do you formulate multiple choices?
> VC++ accepts "*.cpp;*.h", explorer allows "*.cpp,*.h". At least
> "*.cpp|*.h" should work but it doesn't.
>
> > I think GetAllFiles uses the same methods you are trying to use.
> >
> > I don't know if that helps or not.
Yes, and they both end up in wxMatchWild under
wxGTK-2.4.2. wxMatchWild only supports '*' and '?', and does NOT
support multiple patterns like '|' or ';'.
On wxMSW-2.4.0 they end up calling the win32 function FindFirstFile,
"which can contain wildcard characters (* and ?)":
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/findfirstfile.asp
Looks like neither platform allows multiple patterns. I am guessing
that wxGTK's implementation was designed to emulate the behavior of
MSW's FindFirstFile.
- Aj
The OpenFileDialogs under MSW do support multiple extensions, but
for FindFirstFile (don't know GTK) you'd need to split the string and loop
through all extensions.
bye Fabi