uvi-script
Musical event scripting with Lua
Viewport Class Reference

Viewport widget. More...

Inheritance diagram for Viewport:
Widget

Public Member Functions

 Viewport (string name)
 creates a Viewport widget on the user interface.
 
void setViewPosition (int x, int y)
 changes the position of the viewed component
 

Public Attributes

int scrollBarThickness
 scrollBar size
 
string scrollBarThumbColour
 scrollBar thumb colour.
 
string scrollBarTrackColour
 scrollBar track colour.
 
string scrollBarBackgroundColour
 scrollBar 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

Viewport widget.

creates a Viewport widget on the user interface.

A viewport scrolls a single child: each widget created in it replaces the previous one, so create one Panel in it, size that panel to the content, and put the widgets in the panel.

local viewport = Viewport("viewport")
viewport.x = 5
viewport.y = 5
viewport.width = 100
viewport.height = 100
local panel = viewport:Panel("panel")
panel.size = {700, 700}
panel:Button("foo")
stateless transient button.
Definition ui.cpp:1036
Panel widget.
Definition ui.cpp:2234
Viewport(string name)
creates a Viewport widget on the user interface.
int x
x position in pixels
Definition ui.cpp:979
int height
widget height in pixels
Definition ui.cpp:982
table size
widget size {width, height}
Definition ui.cpp:985
int y
y position in pixels
Definition ui.cpp:980
int width
widget width in pixels
Definition ui.cpp:981

Constructor & Destructor Documentation

◆ Viewport()

Viewport::Viewport ( string name)

creates a Viewport widget on the user interface.

Parameters
namethe name to give to the widget

Member Data Documentation

◆ scrollBarBackgroundColour

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