This control allows the user to select a file.
Two implementations of this class exist, one for Gtk and another generic one for all the other ports.
This class is only available if USE_FILECTRL is set to 1.
This class supports the following styles:
Handlers bound for the following event types will receive a FileCtrlEvent parameter.
EVT_FILECTRL_FILEACTIVATED: The user activated a file(by double-clicking or pressing Enter)
EVT_FILECTRL_SELECTIONCHANGED: The user changed the current selection(by selecting or deselecting a file)
EVT_FILECTRL_FOLDERCHANGED: The current folder of the file control has been changed
EVT_FILECTRL_FILTERCHANGED: The current file filter of the file control has been changed.
New in version 2.9.1..
Implementations:GTK port; a generic implementation is used elsewhere.
See also
__init__ | |
Create | Create function for two-step construction. |
GetDirectory | Returns the current directory of the file control (i.e. |
GetFilename | Returns the currently selected filename. |
GetFilterIndex | Returns the zero-based index of the currently selected filter. |
GetPath | Returns the full path (directory and filename) of the currently selected file. |
GetWildcard | Returns the current wildcard. |
SetDirectory | Sets(changes) the current directory displayed in the control. |
SetFilename | Selects a certain file. |
SetFilterIndex | Sets the current filter index, starting from zero. |
SetPath | Changes to a certain directory and selects a certain file. |
SetWildcard | Sets the wildcard, which can contain multiple file types, for example: “BMP files (.bmp)|.bmp|GIF files (.gif)|.gif”. |
ShowHidden | Sets whether hidden files and folders are shown or not. |
Directory | See GetDirectory and SetDirectory |
Filename | See GetFilename and SetFilename |
Filenames | See GetFilenames |
FilterIndex | See GetFilterIndex and SetFilterIndex |
Path | See GetPath and SetPath |
Paths | See GetPaths |
Wildcard | See GetWildcard and SetWildcard |
This control allows the user to select a file.
Possible constructors:
FileCtrl()
FileCtrl(parent, id=ID_ANY, defaultDirectory='',
defaultFilename='', wildCard=FileSelectorDefaultWildcardStr,
style=FC_DEFAULT_STYLE, pos=DefaultPosition, size=DefaultSize,
name=FileCtrlNameStr)
Overloaded Implementations:
__init__ (self)
__init__ (self, parent, id=ID_ANY, defaultDirectory=’‘, defaultFilename=’‘, wildCard=FileSelectorDefaultWildcardStr, style=FC_DEFAULT_STYLE, pos=DefaultPosition, size=DefaultSize, name=FileCtrlNameStr)
Constructs the window.
Parameters: |
|
---|---|
Returns: | True if the control was successfully created or False if creation failed. |
Create function for two-step construction.
See FileCtrl for details.
Parameters: | |
---|---|
Return type: | bool |
Returns the current directory of the file control (i.e.
the directory shown by it).
Return type: | string |
---|
Returns the currently selected filename.
For the controls having the FC_MULTIPLE style, use GetFilenames instead.
Return type: | string |
---|
Returns the zero-based index of the currently selected filter.
Return type: | int |
---|
Returns the full path (directory and filename) of the currently selected file.
For the controls having the FC_MULTIPLE style, use GetPaths instead.
Return type: | string |
---|
Returns the current wildcard.
Return type: | string |
---|
Sets(changes) the current directory displayed in the control.
Parameters: | directory (string) – |
---|---|
Return type: | bool |
Returns: | Returns True on success, False otherwise. |
Selects a certain file.
Parameters: | filename (string) – |
---|---|
Return type: | bool |
Returns: | Returns True on success, False otherwise |
Sets the current filter index, starting from zero.
Parameters: | filterIndex (int) – |
---|
Changes to a certain directory and selects a certain file.
In case the filename specified isn’t found/couldn’t be shown with currently selected filter, False is returned.
Parameters: | path (string) – |
---|---|
Return type: | bool |
Returns: | Returns True on success, False otherwise |
Sets the wildcard, which can contain multiple file types, for example: “BMP files (.bmp)|.bmp|GIF files (.gif)|.gif”.
Parameters: | wildCard (string) – |
---|
Sets whether hidden files and folders are shown or not.
Parameters: | show (bool) – |
---|
See GetDirectory and SetDirectory
See GetFilename and SetFilename
See GetFilenames
See GetFilterIndex and SetFilterIndex
See GetPaths
See GetWildcard and SetWildcard