::wxFileSelector

char * wxFileSelector(char *message, char *default_path = NULL, char *default_filename = NULL, char *default_extension = NULL, char *wildcard = "*.*'', int flags = 0, wxFrame *parent = NULL, int x = -1, int y = -1)

Pops up a file selector box. In Windows, this is the common file selector dialog. In X, this is a file selector box with somewhat less functionality. The path and filename are distinct elements of a full file pathname. If path is NULL, the current directory will be used. If filename is NULL, no default filename will be supplied. The wildcard determines what files are displayed in the file selector, and file extension supplies a type extension for the required filename. Flags may be a combination of wxOPEN, wxSAVE, wxOVERWRITE_PROMPT, wxHIDE_READONLY, or 0. They are only significant at present in Windows.

Both the X and Windows versions implement a wildcard filter. Typing a filename containing wildcards (*, ?) in the filename text item, and clicking on Ok, will result in only those files matching the pattern being displayed. In the X version, supplying no default name will result in the wildcard filter being inserted in the filename text item; the filter is ignored if a default name is supplied.

The application must check for a NULL return value (the user pressed Cancel). For example:

char *s = wxFileSelector("Choose a file to open");
if (s)
{
  ...
}