exFileDialog wildcard doesn't work on initial entry

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
jamescobban
Knows some wx things
Knows some wx things
Posts: 30
Joined: Sun Feb 01, 2009 12:38 am

exFileDialog wildcard doesn't work on initial entry

Post by jamescobban »

I am creating an instance of wxFileDialog in C++ (gcc) on Linux (Ubuntu) with GTK2 and wxWidgets 2.8.10 as follows:

Code: Select all

openFileDialog = new wxFileDialog(this,					"Choose a file", 									"/media/disk-1/Documents and Settings/Jim Cobban/My Documents/FamilyTree",									"Cobban.GED",									"GEDCOM files (*.ged)|*.ged;*.GED",									wxFD_FILE_MUST_EXIST + wxFD_CHANGE_DIR);
I am puzzled because when I pop the dialog up it initially shows every file in the selected directory and the wildcard selection item in the GTK dialog shows blank until I click on it with the mouse, only then does my wildcard selection shows up and the list of files is restricted.

Is there some trick to getting the GTK dialog to honor the wildcard when it is first popped up?
protocol
Moderator
Moderator
Posts: 680
Joined: Wed Jan 18, 2006 6:13 pm
Location: Dallas, TX
Contact:

Post by protocol »

try it without the semi-colon.

Code: Select all

"GEDCOM files (*.ged)|*.ged|GEDCOM files (*.GED)|*.GED"
/* UIKit && wxWidgets 2.8 && Cocoa && .Net */
QuRegExmm
wxPCRE & ObjPCRE - Regex It!
jamescobban
Knows some wx things
Knows some wx things
Posts: 30
Joined: Sun Feb 01, 2009 12:38 am

Post by jamescobban »

protocol wrote:try it without the semi-colon.

Code: Select all

"GEDCOM files (*.ged)|*.ged|GEDCOM files (*.GED)|*.GED"
This does not give the desired result, as it creates TWO separate items on the selection list when in fact there is only one type, complicated by Bill's decision to support case-insensitive file names.

I still do not have a resolution to this issue. To get around a bug in the current distributed version of wxWidgets I have changed the initialization code slightly, but this does not change the behavior. In detail when the dialog first pops up the display is momentarily correct, that is the filetype selection control shows only the GEDCOM files line and the list of files displayed includes only files with type .ged or .GED, but the display continues to flicker as something in the Gtk2 support code continues to modify the dialog, and once the display settles down the selection control displays blank and the list of files shows all of the files in the directory.
protocol
Moderator
Moderator
Posts: 680
Joined: Wed Jan 18, 2006 6:13 pm
Location: Dallas, TX
Contact:

Post by protocol »

The other simple solution is to only accept one filetype of the same ext name. Make sure your application saves the file as the desired type. People who use Unix/Linux are aware of case-sensitivity.
/* UIKit && wxWidgets 2.8 && Cocoa && .Net */
QuRegExmm
wxPCRE & ObjPCRE - Regex It!
Post Reply