uvi-script
Musical event scripting with Lua

Panel widget. More...

Inheritance diagram for Panel:
Widget

Public Member Functions

 Panel (string name)
 creates a Panel widget on the user interface.
 

Public Attributes

string backgroundImage
 path to background image. Supports Retina @2x variants.
 
string backgroundColour
 background colour.
 
- Public Attributes inherited from Widget
string name
 widget name, given at construction (read-only)
 
string displayName
 widget display name
 
string displayText
 custom text to display in place of the standard value display, on widgets that show one.
 
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
 
int w
 alias of width
 
int h
 alias of height
 
table size
 widget size {width, height}
 
table position
 widget position {x,y}
 
table pos
 alias of position
 
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

Panel widget.

creates a Panel widget on the user interface.

Panel offers the widget creation functions (Knob, Slider...) as methods. In order to add sub-widgets, just call those functions on an existing Panel instance. Every constructor is available this way except SVG and ParameterValue, which exist as global functions only.

Note
A panel with no backgroundImage paints a translucent black rounded fill ("3f000000") by default, so a panel used only to group widgets darkens what is under it – set backgroundColour to "00000000" for those. A panel also takes the clicks over its whole area, so a widget placed under it (rather than in it) no longer responds there. Setting interceptsMouseClicks to false on a panel turns off the clicks of every widget inside it as well.
local panel = Panel("panel")
panel.x = 5
panel.y = 5
panel.width = 710
panel.height = 120
panel:Button("foo")
panel:OnOffButton("onoff", false)
panel:Knob("knob", 0, 0, 1)
panel:Slider("slider", 0, 0, 1)
panel:Label("label")
panel:NumBox("NumBox", 0, 0, 1)
panel:Menu("Menu", {"one", "two", "three"})
panel:Table("table", 24, 0, 0, 1)
panel.backgroundColour = "3f000000"
local panel2 = panel:Panel("panel2")
panel2.bounds = {5, 95, 700, 20}
stateless transient button.
Definition ui.cpp:1036
Knob widget.
Definition ui.cpp:1763
text label widget.
Definition ui.cpp:1303
Menu widget.
Definition ui.cpp:1359
Numeric input widget.
Definition ui.cpp:1624
2 states boolean button.
Definition ui.cpp:1128
Panel widget.
Definition ui.cpp:2234
string backgroundColour
background colour.
Definition ui.cpp:2244
Panel(string name)
creates a Panel widget on the user interface.
Horizontal or vertical slider widget.
Definition ui.cpp:1687
Table widget.
Definition ui.cpp:1556
int x
x position in pixels
Definition ui.cpp:979
int height
widget height in pixels
Definition ui.cpp:982
table bounds
widget bounding rect {x,y,width,height}
Definition ui.cpp:988
int y
y position in pixels
Definition ui.cpp:980
int width
widget width in pixels
Definition ui.cpp:981

Constructor & Destructor Documentation

◆ Panel()

Panel::Panel ( string name)

creates a Panel widget on the user interface.

Parameters
namethe name to give to the widget

Member Data Documentation

◆ backgroundColour

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