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

Numeric input widget. More...

Inheritance diagram for NumBox:
ParamWidget Widget

Public Member Functions

 NumBox (string name, number def, number min, number max, bool integer)
 creates a numbox widget on the user interface.
 
void setValue (number value, bool callChangedCallback=true)
 
void setRange (number min, number max)
 

Public Attributes

number value
 the widget's value
 
number min
 the widget's minimum value
 
number max
 the widget's maximum value
 
number default
 the widget's default value
 
number fontSize
 font size
 
string font
 path to custom font file
 
string align
 text alignement: "centred" | "left"| "right" | "top" | "bottom" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight"
 
int paramId
 parameter id
 
string backgroundImage
 path to background image
 
string backgroundColour
 background colour: colour string that defines the desired colour.
 
string textColour
 text colour: colour string that defines the desired
 
string displayText
 custom text to display in place of the standard value display.
 
- Public Attributes inherited from ParamWidget
Mapper::Type mapper
 Mapper type, default is Mapper.Linear.
 
Unit::Type unit
 Unit type, default is Unit.Generic.
 
- 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

Numeric input widget.

creates a numbox widget on the user interface.

n = NumBox("numbox", 0.5, 0.0, 1.0, false)
n.changed = function(self)
print("numbox changed", self.value)
end
number value
the widget's value
Definition ui.cpp:1321
NumBox(string name, number def, number min, number max, bool integer)
creates a numbox widget on the user interface.
function changed
callback function used by child widgets to be notified of changes
Definition ui.cpp:776

Constructor & Destructor Documentation

◆ NumBox()

NumBox::NumBox ( string name,
number def,
number min,
number max,
bool integer )

creates a numbox widget on the user interface.

Parameters
namethe name to give to the widget
defdefault and initial value
minminimum value
maxmaximum value
integeroptional default is false

Member Function Documentation

◆ setRange()

void NumBox::setRange ( number min,
number max )
Parameters
minminimum value
maxmaximum value

◆ setValue()

void NumBox::setValue ( number value,
bool callChangedCallback = true )
Parameters
valuethe new widget's value
callChangedCallbackcall the changed callback function if true

Member Data Documentation

◆ backgroundColour

string NumBox::backgroundColour

background colour: colour string that defines the desired colour.

It can be either a named colour like "blue" or "red" or an hexadecimal string in RGB ("#FF00CC") or ARGB ("#3C00FECD") format

◆ displayText

string NumBox::displayText

custom text to display in place of the standard value display.

To revert to the standard behaviour, leave it empty.

◆ textColour

string NumBox::textColour

text colour: colour string that defines the desired

colour. It can be either a named colour like "blue" or "red" or an hexadecimal string in RGB ("#FF00CC") or ARGB ("#3C00FECD") format