wx.FilePickerCtrl

Inheritance diagram for wx.FilePickerCtrl:



Description

This control allows the user to select a file. The generic implementation is a button which brings up a wx.FileDialog when clicked. Native implementation may differ but this is usually a (small) widget which give access to the file-chooser dialog. It is only available if wx.USE_FILEPICKERCTRL is set to 1 (the default).

Window Styles

Window Style Description
wx.FLP_DEFAULT_STYLE The default style: includes wx.FLP_OPEN | wx.FLP_FILE_MUST_EXIST and, under wxMSW only, wx.FLP_USE_TEXTCTRL.
wx.FLP_USE_TEXTCTRL Creates a text control to the left of the picker button which is completely managed by the wx.FilePickerCtrl and which can be used by the user to specify a path (see SetPath). The text control is automatically synchronized with button’s value.
wx.FLP_OPEN Creates a picker which allows the user to select a file to open.
wx.FLP_SAVE Creates a picker which allows the user to select a file to save.
wx.FLP_OVERWRITE_PROMPT Can be combined with wx.FLP_SAVE only: ask confirmation to the user before selecting a file.
wx.FLP_FILE_MUST_EXIST Can be combined with wx.FLP_OPEN only: the selected file must be an existing file.
wx.FLP_CHANGE_DIR Change current working directory on each user file selection change.

Event Handling

Event Name Description
wx.EVT_FILEPICKER_CHANGED(id, func) The user changed the file selected in the control either using the button or using text control (see wx.FLP_USE_TEXTCTRL; note that in this case the event is fired only if the user’s input is valid, e.g. an existing file path if wx.FLP_FILE_MUST_EXIST was given).

Control Appearance


wxMSW

wxMSW

wxMAC

wxMAC

wxGTK

wxGTK


Properties Summary

Class API

Methods

__init__(parent, id=-1, path="", message=wx.FileSelectorPromptStr, wildcard=wx.FileSelectorDefaultWildcardStr, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.FLP_DEFAULT_STYLE, validator=wx.DefaultValidator, name=wx.FilePickerCtrlNameStr)

Constructor.

Parameters:


Returns:

wx.FilePickerCtrl


CheckPath(path)

Parameters:

  • path (string)

Returns:

bool


GetPath()

Returns the absolute path of the currently selected file.


Returns:

string


GetTextCtrlValue()
No docstrings available for this method.

SetPath(filename)

Sets the absolute path of the currently selected file. This must be a valid file if the wx.FLP_FILE_MUST_EXIST style was given.

Parameters:

  • filename (string)

Properties

Path
See GetPath and SetPath
TextCtrlValue
See GetTextCtrlValue