wx.FileSelector Class Reference

List of all members.

Public Member Functions

 FileSelector (wxString message, wxString default_path, wxString default_filename, wxString default_extension, wxString wildcard, wx.WindowStyles flags, Window parent, int x, int y)
 FileSelector (string message, string default_path, string default_filename, string default_extension, string wildcard, wx.WindowStyles flags, Window parent, Point position)
 FileSelector (string message, string default_path, string default_filename, string default_extension, string wildcard, wx.WindowStyles flags, Window parent)
 FileSelector (string message, string default_path, string default_filename, string default_extension, string wildcard, wx.WindowStyles flags)
 FileSelector (string message, string default_path, string default_filename, string default_extension, string wildcard)
 FileSelector (string message, string default_path, string default_filename, string default_extension)
 FileSelector (string message, string default_path, string default_filename)
 FileSelector (string message, string default_path)
 FileSelector (string message)
 FileSelector ()

Static Public Member Functions

static implicit operator string (FileSelector f)
static string ShowModal (string message, string default_path, string default_filename, string default_extension, string wildcard, wx.WindowStyles flags, Window parent, Point position)
static string ShowModal (string message, string default_path, string default_filename, string default_extension, string wildcard, wx.WindowStyles flags, Window parent)
static string ShowModal (string message, string default_path, string default_filename, string default_extension, string wildcard, wx.WindowStyles flags)
static string ShowModal (string message, string default_path, string default_filename, string default_extension, string wildcard)

Properties

string Value [get]


Detailed Description

Asks for a file name opening a file selector dialog. Especially relevant flags (on wx.WindowStyles) start with prefix FD_.

Pops up a file selector box. In Windows, this is the common file selector dialog. In X, this is a file selector box with the same functionality. The path and filename are distinct elements of a full file pathname. If path is empty, the current directory will be used. If filename is empty, 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 wx.WindowStyles.FD_OPEN, wx.WindowStyles.FD_SAVE, wx.WindowStyles.FD_OVERWRITE_PROMPT, or wx.WindowStyles.FD_FILE_MUST_EXIST. Note that .wx.WindowStyles.FD_MULTIPLE can only be used with wx.FileDialog and not here as this function only returns a single file name.

Both the Unix 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.

The wildcard may be a specification for multiple types of file with a description for each, such as: "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif".

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

 wxString filename = wxFileSelector("Choose a file to open");
 if ( !filename.empty() )
 {
     // work with the file
     ...
 }
 //else: cancelled by user

See also:
DirSelector


Constructor & Destructor Documentation

wx.FileSelector.FileSelector (  ) 

Starts an instance with message string _("Select a file").

wx.FileSelector.FileSelector ( string  message  ) 

Selects a file displaying the provided message.

Parameters:
message Message string

wx.FileSelector.FileSelector ( string  message,
string  default_path 
)

Selects a file displaying the provided message.

Parameters:
message Message string
default_path Displays files in this path first

wx.FileSelector.FileSelector ( string  message,
string  default_path,
string  default_filename 
)

Selects a file displaying the provided message.

Parameters:
message Message string
default_path Displays files in this path first
default_filename The default filename

wx.FileSelector.FileSelector ( string  message,
string  default_path,
string  default_filename,
string  default_extension 
)

Selects a file displaying the provided message.

Parameters:
message Message string
default_path Displays files in this path first
default_filename The default filename
default_extension The default extension of the searched files

wx.FileSelector.FileSelector ( string  message,
string  default_path,
string  default_filename,
string  default_extension,
string  wildcard 
)

Selects a file displaying the provided message.

Parameters:
message Message string
default_path Displays files in this path first
default_filename The default filename
default_extension The default extension of the searched files
wildcard Determines which files will be displayed. Example: "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif".

wx.FileSelector.FileSelector ( string  message,
string  default_path,
string  default_filename,
string  default_extension,
string  wildcard,
wx.WindowStyles  flags 
)

Selects a file displaying the provided message.

Parameters:
message Message string
default_path Displays files in this path first
default_filename The default filename
default_extension The default extension of the searched files
wildcard Determines which files will be displayed. Example: "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif".
flags The window styles

wx.FileSelector.FileSelector ( string  message,
string  default_path,
string  default_filename,
string  default_extension,
string  wildcard,
wx.WindowStyles  flags,
Window  parent 
)

Selects a file displaying the provided message.

Parameters:
message Message string
default_path Displays files in this path first
default_filename The default filename
default_extension The default extension of the searched files
wildcard Determines which files will be displayed. Example: "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif".
flags The window styles
parent The parent window

wx.FileSelector.FileSelector ( string  message,
string  default_path,
string  default_filename,
string  default_extension,
string  wildcard,
wx.WindowStyles  flags,
Window  parent,
Point  position 
)

Selects a file displaying the provided message.

Parameters:
message Message string
default_path Displays files in this path first
default_filename The default filename
default_extension The default extension of the searched files
wildcard Determines which files will be displayed. Example: "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif".
flags The window styles
parent The parent window
position The position of this dialog

wx.FileSelector.FileSelector ( wxString  message,
wxString  default_path,
wxString  default_filename,
wxString  default_extension,
wxString  wildcard,
wx.WindowStyles  flags,
Window  parent,
int  x,
int  y 
)

Selects a file displaying the provided message.

Parameters:
message Message string
default_path Displays files in this path first
default_filename The default filename
default_extension The default extension of the searched files
wildcard Determines which files will be displayed. Example: "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif".
flags The window styles
parent The parent window
x The x-coordinate of this dialog
y The y-coordinate of this dialog


Member Function Documentation

static implicit wx.FileSelector.operator string ( FileSelector  f  )  [static]

static string wx.FileSelector.ShowModal ( string  message,
string  default_path,
string  default_filename,
string  default_extension,
string  wildcard,
wx.WindowStyles  flags,
Window  parent,
Point  position 
) [static]

Returns a file that has been selected by the user.

Parameters:
message Message string
default_path Displays files in this path first
default_filename The default filename
default_extension The default extension of the searched files
wildcard Determines which files will be displayed. Example: "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif".
flags The window styles
parent The parent window
position The position of this dialog
Returns:
The path to the selected file. The result will be empty if the user cancelled the dialog.

static string wx.FileSelector.ShowModal ( string  message,
string  default_path,
string  default_filename,
string  default_extension,
string  wildcard,
wx.WindowStyles  flags,
Window  parent 
) [static]

Returns a file that has been selected by the user.

Parameters:
message Message string
default_path Displays files in this path first
default_filename The default filename
default_extension The default extension of the searched files
wildcard Determines which files will be displayed. Example: "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif".
flags The window styles
parent The parent window
Returns:
The path to the selected file. The result will be empty if the user cancelled the dialog.

static string wx.FileSelector.ShowModal ( string  message,
string  default_path,
string  default_filename,
string  default_extension,
string  wildcard,
wx.WindowStyles  flags 
) [static]

Returns a file that has been selected by the user.

Parameters:
message Message string
default_path Displays files in this path first
default_filename The default filename
default_extension The default extension of the searched files
wildcard Determines which files will be displayed. Example: "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif".
flags The window styles
Returns:
The path to the selected file. The result will be empty if the user cancelled the dialog.

static string wx.FileSelector.ShowModal ( string  message,
string  default_path,
string  default_filename,
string  default_extension,
string  wildcard 
) [static]

Returns a file that has been selected by the user.

Parameters:
message Message string
default_path Displays files in this path first
default_filename The default filename
default_extension The default extension of the searched files
wildcard Determines which files will be displayed. Example: "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif".
Returns:
The path to the selected file. The result will be empty if the user cancelled the dialog.


Property Documentation

string wx.FileSelector.Value [get]

the selected file or the empty string if the user cancelled the input. This, use something like the following to deal with cancelations.

            string result=fileselector.Value;
            if (result.Length == 0)
                return; // cancelled input.


Manual of the wx.NET   (c) 2003-2011 the wx.NET project at   Get wx.NET at SourceForge.net. Fast, secure and Free Open Source software downloads