Home | Trees | Index | Help |
|
---|
Package wx :: Class FileDialog |
|
object
--+ |Object
--+ |EvtHandler
--+ |Window
--+ |TopLevelWindow
--+ |Dialog
--+ | FileDialog
wx.FileDialog allows the user to select one or more files from the filesystem.
In Windows, this is the common file selector dialog. On X based platforms a generic alternative is used. The path and filename are distinct elements of a full file pathname. If path is "", the current directory will be used. If filename is "", 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.
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. 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"
wx.OPEN This is an open dialog. wx.SAVE This is a save dialog. wx.HIDE_READONLY For open dialog only: hide the checkbox allowing to open the file in read-only mode. wx.OVERWRITE_PROMPT For save dialog only: prompt for a confirmation if a file will be overwritten. wx.MULTIPLE For open dialog only: allows selecting multiple files. wx.CHANGE_DIR Change the current working directory to the directory where the file(s) chosen by the user are.
Method Summary | |
---|---|
FileDialog |
Constructor. |
__repr__(self)
| |
String |
Returns the default directory. |
String |
Returns the default filename. |
PyObject |
Returns a list of filenames chosen in the dialog. |
int |
Returns the index into the list of filters supplied, optionally, in the wildcard parameter. |
String |
Returns the message that will be displayed on the dialog. |
String |
Returns the full path (directory and filename) of the selected file. |
PyObject |
Fills the array paths with the full paths of the files chosen. |
long |
Returns the dialog style. |
String |
Returns the file dialog wildcard. |
Sets the default directory. | |
Sets the default filename. | |
Sets the default filter index, starting from zero. | |
Sets the message that will be displayed on the dialog. | |
Sets the path (the combined directory and filename that will be returned when the dialog is dismissed). | |
Sets the dialog style. | |
Sets the wildcard, which can contain multiple file types, for example: |
Instance Method Details |
---|
__init__(self,
parent,
message=FileSelectorPromptStr,
defaultDir=EmptyString,
defaultFile=EmptyString,
wildcard=FileSelectorDefaultWildcardStr,
style=0,
pos=DefaultPosition)
Constructor. Use ShowModal method to show the dialog. |
GetDirectory(self)Returns the default directory.
|
GetFilename(self)Returns the default filename.
|
GetFilenames(self)Returns a list of filenames chosen in the dialog. This function should only be used with the dialogs which have wx.MULTIPLE style, use GetFilename for the others.
|
GetFilterIndex(self)Returns the index into the list of filters supplied, optionally, in the wildcard parameter. Before the dialog is shown, this is the index which will be used when the dialog is first displayed. After the dialog is shown, this is the index selected by the user.
|
GetMessage(self)Returns the message that will be displayed on the dialog.
|
GetPath(self)Returns the full path (directory and filename) of the selected file.
|
GetPaths(self)Fills the array paths with the full paths of the files chosen. This function should only be used with the dialogs which have wx.MULTIPLE style, use GetPath for the others.
|
GetStyle(self)Returns the dialog style.
|
GetWildcard(self)Returns the file dialog wildcard.
|
SetDirectory(self, dir)Sets the default directory.
|
SetFilename(self, name)Sets the default filename.
|
SetFilterIndex(self, filterIndex)Sets the default filter index, starting from zero.
|
SetMessage(self, message)Sets the message that will be displayed on the dialog.
|
SetPath(self, path)Sets the path (the combined directory and filename that will be returned when the dialog is dismissed).
|
SetStyle(self, style)Sets the dialog style.
|
SetWildcard(self, wildCard)Sets the wildcard, which can contain multiple file types, for example: "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif"
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1.20040428.rpd on Tue Apr 26 14:23:17 2005 | http://epydoc.sf.net |