List of all members | Public Member Functions | Public Attributes
FileSelector Class Reference

FileSelector widget. More...

+ Inheritance diagram for FileSelector:

Public Member Functions

 FileSelector (string name)
 creates an FileSelector widget on the user inteface. More...
 
void next ()
 selects the previous path
 
void prev ()
 selects the next path
 

Public Attributes

bool allowDnD
 should we allow file DnD
 
number alpha
 transparency value between 0.0 and 1.0
 
string arrowColour
 arrow colour. It can be either a named colour like "blue" or "red" or an hexadecimal string in RGB ("#FF00CC") or ARGB ("#3C00FECD") format
 
string backgroundColour
 background colour. It can be either a named colour like "blue" or "red" or an hexadecimal string in RGB ("#FF00CC") or ARGB ("#3C00FECD") format
 
string basepath
 root path for the file selector
 
table bounds
 widget bounding rect {x,y,width,height}
 
function changed
 callback function used by child widgets to be notified of changes
 
int columnWidth
 width of each columns
 
bool displayExtension
 should we display file extension
 
string displayName
 widget display name
 
bool enabled
 boolean flag to enable / disable the widget
 
string filepath
 current file path
 
string filetype
 pattern for allowed file extensions ex: '*.txt;*.json'
 
string fillStyle
 fill style: 'gloss' or 'solid'
 
string font
 path to custom font file
 
number fontSize
 font size
 
int height
 widget height in pixels
 
string highlightColour
 selected path highlight colour. It can be either a named colour like "blue" or "red" or an hexadecimal string in RGB ("#FF00CC") or ARGB ("#3C00FECD") format
 
bool interceptsMouseClicks
 boolean flag to toggle mouse handling on widget
 
bool invertColourOnSelection
 should we invert selected path colour scheme
 
string name
 widget name
 
function pathActivated
 callback invoked when a path is activated
 
function pathSelected
 callback invoked when a path is selected
 
bool persistent
 flag to tell if the widget values should be serialized when saving. True by default. Persistent widgets will call their changed function on reload
 
table position
 widget position {x,y}
 
int rowHeight
 height of each rows
 
string scrollBarBackgroundColour
 scrollBar background colour. It can be either a named colour like "blue" or "red" or an hexadecimal string in RGB ("#FF00CC") or ARGB ("#3C00FECD") format
 
string scrollBarThumbColour
 scrollBar thumb colour. It can be either a named colour like "blue" or "red" or an hexadecimal string in RGB ("#FF00CC") or ARGB ("#3C00FECD") format
 
string scrollBarTrackColour
 scrollBar track colour. It can be either a named colour like "blue" or "red" or an hexadecimal string in RGB ("#FF00CC") or ARGB ("#3C00FECD") format
 
bool showLabel
 show widgets label if any
 
table size
 widget size {width, height}
 
string textColour
 text colour. It can be either a named colour like "blue" or "red" or an hexadecimal string in RGB ("#FF00CC") or ARGB ("#3C00FECD") format
 
string tooltip
 widget tooltip, default is name
 
bool visible
 boolean flag to toggle widget visibility
 
int width
 widget width in pixels
 
int x
 x position in pixels
 
int y
 y position in pixels
 

Detailed Description

FileSelector widget.

Creates a FileSelector widget on the user inteface.

fs = FileSelector("fs")
fs.filepath = getLocation("Script")
fs.columnWidth = 180
fs.rowHeight = 20
fs.x = 0
fs.y = 0
fs.width = 720
fs.height = 360
fs.filetype = "*.*"
function fs:pathSelected()
print("selected:", self.filepath)
end
function fs:pathActivated()
print("activated:", self.filepath)
end

Constructor & Destructor Documentation

FileSelector::FileSelector ( string  name)

creates an FileSelector widget on the user inteface.

Parameters
namethe name to give to the widget