Package gui :: Package input_elements :: Module file :: Class File_element
[hide private]
[frames] | no frames]

Class File_element

source code

A single file element for the multiple file input GUI element.

Instance Methods [hide private]
 
__init__(self, default='', parent=None, index=None, wildcard=u'*', style=1, padding=3, height_spacer=1, width_spacer=2, height_element=27, preview=True)
Set up the file GUI element.
source code
str
GetValue(self)
Return the file name.
source code
 
SetValue(self, value)
Set up the list of file.
source code
 
preview_file(self, event=None)
Preview a file.
source code
 
select_file(self, event=None)
Select a file.
source code
Method Details [hide private]

__init__(self, default='', parent=None, index=None, wildcard=u'*', style=1, padding=3, height_spacer=1, width_spacer=2, height_element=27, preview=True)
(Constructor)

source code 

Set up the file GUI element.

Parameters:
  • default (str) - The default value of the element.
  • parent (wx.Panel instance) - The parent GUI element.
  • index (int) - The index of the file element, to display its sequence number in the GUI element.
  • wildcard (String) - The file wildcard pattern. For example for opening PDB files, this could be "PDB files (*.pdb)|*.pdb;*.PDB".
  • style (long) - The dialog style. To open a single file, set to wx.FD_OPEN. To open multiple files, set to wx.FD_OPEN|wx.FD_MULTIPLE. To save a single file, set to wx.FD_SAVE. To save multiple files, set to wx.FD_SAVE|wx.FD_MULTIPLE.
  • padding (int) - Spacing to the left and right of the widgets.
  • height_spacer (int) - The amount of spacing to add below the field in pixels.
  • width_spacer (int) - The amount of spacing to add horizontally between the TextCtrl and buttons in pixels.
  • height_element (int) - The height in pixels of the GUI element.
  • preview (bool) - A flag which if true will allow the file to be previewed.

GetValue(self)

source code 

Return the file name.

Returns: str
The file name.

SetValue(self, value)

source code 

Set up the list of file.

Parameters:
  • value (list of str or None) - The list of values to add to the list.

preview_file(self, event=None)

source code 

Preview a file.

Parameters:
  • event (wx event) - The wx event.

select_file(self, event=None)

source code 

Select a file.

Parameters:
  • event (wx event) - The wx event.