A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://wxpython.org/Phoenix/docs/html/wx.FileCtrl.html below:

wx.FileCtrl — wxPython Phoenix 4.2.4a1 documentation

wx.FileCtrl¶

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.

Window Styles¶

This class supports the following styles:

Events Emitted by this Class¶

Handlers bound for the following event types will receive a wx.FileCtrlEvent parameter.

Implementations:GTK port; a generic implementation is used elsewhere.

Class Hierarchy¶

Inheritance diagram for class

FileCtrl

:

Control Appearance¶ Methods Summary¶

__init__

Create

Create function for two-step construction.

GetClassDefaultAttributes

GetDirectory

Returns the current directory of the file control (i.e. the directory shown by it).

GetFilename

Returns the currently selected filename.

GetFilenames

Returns a list of filenames selected in the control. This function

GetFilterIndex

Returns the zero-based index of the currently selected filter.

GetPath

Returns the full path (directory and filename) of the currently selected file.

GetPaths

Returns a list of the full paths (directory and filename) of the files

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.

Properties Summary¶ Class API¶
class wx.FileCtrl(Control)¶

Possible constructors:

FileCtrl() -> None

FileCtrl(parent, id=ID_ANY, defaultDirectory='', defaultFilename='',
         wildCard=FileSelectorDefaultWildcardStr, style=FC_DEFAULT_STYLE,
         pos=DefaultPosition, size=DefaultSize, name=FileCtrlNameStr) -> None

This control allows the user to select a file.


Methods¶
__init__(self, *args, **kw)¶

Overloaded Implementations:

__init__ (self)

Return type:

None

__init__ (self, parent, id=ID_ANY, defaultDirectory=’’, defaultFilename=’’, wildCard=FileSelectorDefaultWildcardStr, style=FC_DEFAULT_STYLE, pos=DefaultPosition, size=DefaultSize, name=FileCtrlNameStr)

Constructs the window.

Parameters:
  • parent (wx.Window) – Parent window, must not be not None.

  • id (wx.WindowID) – The identifier for the control.

  • defaultDirectory (string) – The initial directory shown in the control. Must be a valid path to a directory or the empty string. In case it is the empty string, the current working directory is used.

  • defaultFilename (string) – The default filename, or the empty string.

  • wildCard (string) – A wildcard specifying which files can be selected, such as “x.x” or “BMP files (.bmp)|.bmp|GIF files (.gif)|.gif”.

  • style (long) – The window style, see FC_ flags.

  • pos (wx.Point) – Initial position.

  • size (wx.Size) – Initial size.

  • name (string) – Control name.

Return type:

None



Create(self, parent, id=ID_ANY, defaultDirectory='', defaultFilename='', wildCard=FileSelectorDefaultWildcardStr, style=FC_DEFAULT_STYLE, pos=DefaultPosition, size=DefaultSize, name=FileCtrlNameStr)¶

Create function for two-step construction.

See wx.FileCtrl for details.

Parameters:
  • parent (wx.Window)

  • id (wx.WindowID)

  • defaultDirectory (string)

  • defaultFilename (string)

  • wildCard (string)

  • style (long)

  • pos (wx.Point)

  • size (wx.Size)

  • name (string)

Return type:

bool

Returns:

True if the control was successfully created or False if creation failed.


static GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL)¶
Parameters:

variant (WindowVariant)

Return type:

wx.VisualAttributes


GetDirectory(self)¶

Returns the current directory of the file control (i.e. the directory shown by it).

Return type:

str


GetFilename(self)¶

Returns the currently selected filename.

For the controls having the FC_MULTIPLE style, use GetFilenames instead.

Return type:

str


GetFilenames(self)¶

Returns a list of filenames selected in the control. This function should only be used with controls which have the wx.``wx.FC_MULTIPLE`` style, use GetFilename for the others.

Return type:

List[str]


GetFilterIndex(self)¶

Returns the zero-based index of the currently selected filter.

Return type:

int


GetPath(self)¶

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:

str


GetPaths(self)¶

Returns a list of the full paths (directory and filename) of the files chosen. This function should only be used with controlss which have the wx.``wx.FC_MULTIPLE`` style, use GetPath for the others.

Return type:

List[str]


GetWildcard(self)¶

Returns the current wildcard.

Return type:

str


SetDirectory(self, directory)¶

Sets(changes) the current directory displayed in the control.

Parameters:

directory (string)

Return type:

bool

Returns:

Returns True on success, False otherwise.


SetFilename(self, filename)¶

Selects a certain file.

Parameters:

filename (string)

Return type:

bool

Returns:

Returns True on success, False otherwise


SetFilterIndex(self, filterIndex)¶

Sets the current filter index, starting from zero.

Parameters:

filterIndex (int)

Return type:

None


SetPath(self, path)¶

Changes to a certain directory and selects a certain file.

If path includes the directory part, it must exist, otherwise False is returned and nothing else is done.

Parameters:

path (string)

Return type:

bool

Returns:

Returns True on success, False otherwise


SetWildcard(self, wildCard)¶

Sets the wildcard, which can contain multiple file types, for example: “BMP files (.bmp)|.bmp|GIF files (.gif)|.gif”.

Parameters:

wildCard (string)

Return type:

None


ShowHidden(self, show)¶

Sets whether hidden files and folders are shown or not.

Parameters:

show (bool)

Return type:

None


Properties¶
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


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4