wxFileDialog::SetWildcard() and case sensitivity

Ian Britten britten at caris.com
Tue Sep 4 13:11:18 PDT 2007


Hi all,
[ wxGTK, wxMSW v2.8.4 ]

Is it possible (And portable!) to set some sort of case-insensitive
behaviour for the wildcard handling of the wxFileDialog?  I was
thinking along the lines of setting some sort of Regex pattern as
the wildcard... (Maybe?)

<Background>
As anyone who working in a mixed environment can quickly confirm,
many users of a certain OS don't know/care about case sensitivity
of file names >:O
As a result, lots of files change from 'file.jpg' to 'FILE.JPG'.
When those files go back to a case-sensitive OS, the case-sensitive
file selection dialogs can no longer pick those files.  The only
solution is for users to manually rename the files.
Picking files on a CD is especially problematic, since the files
can't actually be renamed.
</Background>

I'd like to allow users to pick a file, but basically ignore the
case of the extension, so that programatically setting a wildcard
of *.jpg actually allows the user to pick files like *.JPG, *.jpg,
*.Jpg, etc... (Maybe even handling the annoying *.JPEG variant too!)

[ Yes, I'm aware that I could add multiple entries to the wildcard
filter, one for each case variant.  However, that'd very quickly
becode a very long list, when supporting many different extensions ]

Is something like this possible?  If not, could it be?

Thanks!
Ian




More information about the wx-users mailing list