uvi-script
Musical event scripting with Lua
Loading...
Searching...
No Matches
FileSelector Class Reference

FileSelector widget. More...

Inheritance diagram for FileSelector:
Widget

Public Member Functions

 FileSelector (string name)
 creates a FileSelector widget on the user interface.
 
void prev ()
 selects the next path
 
void next ()
 selects the previous path
 

Public Attributes

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

Detailed Description

FileSelector widget.

Creates a FileSelector widget on the user interface.

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
int columnWidth
width of each columns
Definition ui.cpp:1815
string filepath
current file path
Definition ui.cpp:1782
FileSelector(string name)
creates a FileSelector widget on the user interface.
string filetype
pattern for allowed file extensions ex: '.txt;.json'
Definition ui.cpp:1783
int rowHeight
height of each rows
Definition ui.cpp:1816
function pathActivated
callback invoked when a path is activated
Definition ui.cpp:1822
function pathSelected
callback invoked when a path is selected
Definition ui.cpp:1821
int x
x position in pixels
Definition ui.cpp:760
int height
widget height in pixels
Definition ui.cpp:763
int y
y position in pixels
Definition ui.cpp:761
int width
widget width in pixels
Definition ui.cpp:762
string getLocation(string location)

Constructor & Destructor Documentation

◆ FileSelector()

FileSelector::FileSelector ( string name)

creates a FileSelector widget on the user interface.

Parameters
namethe name to give to the widget

Member Data Documentation

◆ arrowColour

string FileSelector::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

◆ backgroundColour

string FileSelector::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

◆ highlightColour

string FileSelector::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

◆ scrollBarBackgroundColour

string FileSelector::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

◆ scrollBarThumbColour

string FileSelector::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

◆ scrollBarTrackColour

string FileSelector::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

◆ textColour

string FileSelector::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