CustomUI Plugin API reference
API functions for creating custom user interfaces.
simUI.addConnection
simUI.addCurve
simUI.addCurveTimePoints
simUI.addCurveXYPoints
simUI.addNode
simUI.addScene3DNode
simUI.addTreeItem
Description
|
Add an item to the specified tree widget. |
Lua synopsis |
simUI.addTreeItem(int handle, int id, int item_id, table text, int parent_id=0, bool expanded=false, bool suppressEvents=true)
|
Lua parameters |
handle (int): ui handle
id (int): widget id
item_id (int): item id
text (table of string): item text fields
parent_id (int, default: 0): parent item id (0 means a toplevel item)
expanded (bool, default: false): if true, the item will be in expanded state
suppressEvents (bool, default: true): if true, no event will be generated from this call
|
Lua return values |
- |
See also
|
simUI.clearTree simUI.collapseAll simUI.expandAll simUI.expandToDepth simUI.getColumnCount simUI.removeTreeItem simUI.restoreState simUI.saveState simUI.setColumnCount simUI.setColumnHeaderText simUI.setColumnWidth simUI.setTreeSelection simUI.updateTreeItemParent simUI.updateTreeItemText simUI.getWidgetVisibility simUI.setEnabled simUI.setStyleSheet simUI.setWidgetVisibility
|
simUI.clearCurve
simUI.clearTable
simUI.clearTree
simUI.collapseAll
simUI.create
simUI.destroy
simUI.expandAll
simUI.expandToDepth
simUI.fileDialog
Description
|
Display a file dialog. |
Lua synopsis |
table result=simUI.fileDialog(int type, string title, string startPath, string initName, string extName, string ext, bool native=false)
|
Lua parameters |
type (int): type
title (string): title
startPath (string): start path
initName (string): initial file name
extName (string): the name of the extension
ext (string): the actual extension
native (bool, default: false): use OS-native file dialogs
|
Lua return values |
result (table of string): result |
See also
|
|
simUI.getCheckboxValue
simUI.getColumnCount
simUI.getComboboxItemCount
simUI.getComboboxItemText
simUI.getComboboxItems
simUI.getComboboxSelectedIndex
simUI.getCurrentEditWidget
simUI.getCurrentTab
simUI.getCurveData
simUI.getEditValue
simUI.getItem
simUI.getLabelText
simUI.getNodeInletCount
simUI.getNodeOutletCount
simUI.getNodePos
simUI.getNodeText
simUI.getPosition
simUI.getRadiobuttonValue
simUI.getRowCount
simUI.getSize
simUI.getSliderValue
simUI.getSpinboxValue
simUI.getTitle
simUI.getWidgetVisibility
Description
|
Get the visibility status of a widget. |
Lua synopsis |
bool visibility=simUI.getWidgetVisibility(int handle, int id)
|
Lua parameters |
handle (int): ui handle
id (int): widget id
|
Lua return values |
visibility (bool): true if the window is visible, false otherwise |
See also
|
simUI.setEnabled simUI.setStyleSheet simUI.setWidgetVisibility
|
simUI.growPlotRanges
simUI.growPlotXRange
simUI.growPlotYRange
simUI.hide
simUI.insertComboboxItem
simUI.insertTableColumn
Description
|
insert a column in a table widget |
Lua synopsis |
simUI.insertTableColumn(int ui, int widget, int index)
|
Lua parameters |
ui (int): the ui handle
widget (int): the widget identifier
index (int): the index (0-based) where the new column will appear
|
Lua return values |
- |
See also
|
|
simUI.insertTableRow
Description
|
insert a row in a table widget |
Lua synopsis |
simUI.insertTableRow(int ui, int widget, int index)
|
Lua parameters |
ui (int): the ui handle
widget (int): the widget identifier
index (int): the index (0-based) where the new row will appear
|
Lua return values |
- |
See also
|
|
simUI.isNodeValid
simUI.isVisible
simUI.msgBox
Description
|
Display a message box. |
Lua synopsis |
int result=simUI.msgBox(int type, int buttons, string title, string message)
|
Lua parameters |
type (int): type
buttons (int): buttons
title (string): title
message (string): message
|
Lua return values |
result (int): result |
See also
|
|
simUI.removeComboboxItem
simUI.removeConnection
simUI.removeCurve
simUI.removeNode
simUI.removeScene3DNode
simUI.removeTableColumn
Description
|
remove a column from a table widget |
Lua synopsis |
simUI.removeTableColumn(int ui, int widget, int index)
|
Lua parameters |
ui (int): the ui handle
widget (int): the widget identifier
index (int): the column index (0-based) to remove
|
Lua return values |
- |
See also
|
|
simUI.removeTableRow
Description
|
remove a row from a table widget |
Lua synopsis |
simUI.removeTableRow(int ui, int widget, int index)
|
Lua parameters |
ui (int): the ui handle
widget (int): the widget identifier
index (int): the row index (0-based) to remove
|
Lua return values |
- |
See also
|
|
simUI.removeTreeItem
simUI.replot
simUI.rescaleAxes
simUI.rescaleAxesAll
simUI.restoreState
simUI.saveState
simUI.setButtonPressed
simUI.setButtonText
simUI.setCheckboxValue
simUI.setColumnCount
simUI.setColumnHeaderText
simUI.setColumnWidth
simUI.setComboboxItems
simUI.setComboboxSelectedIndex
simUI.setCurrentEditWidget
simUI.setCurrentTab
simUI.setEditValue
simUI.setEnabled
Description
|
Enable or disable a widget. |
Lua synopsis |
simUI.setEnabled(int handle, int id, bool enabled, bool suppressEvents=true)
|
Lua parameters |
handle (int): ui handle
id (int): widget id
enabled (bool): enabled
suppressEvents (bool, default: true): if true, no event will be generated from this call
|
Lua return values |
- |
See also
|
simUI.getWidgetVisibility simUI.setStyleSheet simUI.setWidgetVisibility
|
simUI.setImageData
Description
|
Set image content using specified bitmap (RGB888) data. |
Lua synopsis |
simUI.setImageData(int handle, int id, string data, int width, int height)
|
Lua parameters |
handle (int): ui handle
id (int): id of a image widget
data (string): image byte data
width (int): width of the image
height (int): height of the image
|
Lua return values |
- |
See also
|
simUI.getWidgetVisibility simUI.setEnabled simUI.setStyleSheet simUI.setWidgetVisibility
|
simUI.setItem
simUI.setItemEditable
simUI.setItemImage
simUI.setLabelText
simUI.setLegendVisibility
simUI.setMouseOptions
simUI.setNodeInletCount
simUI.setNodeOutletCount
simUI.setNodePos
simUI.setNodeText
simUI.setNodeValid
simUI.setPlotLabels
simUI.setPlotRanges
simUI.setPlotXLabel
simUI.setPlotXRange
simUI.setPlotYLabel
simUI.setPlotYRange
simUI.setPosition
simUI.setProgress
simUI.setRadiobuttonValue
simUI.setRowCount
simUI.setRowHeaderText
simUI.setRowHeight
simUI.setScene3DNodeEnabled
simUI.setScene3DNodeFloatParam
simUI.setScene3DNodeIntParam
simUI.setScene3DNodeParam
Description
|
polymorphic version of the onSetScene3DNodeXXXParam() functions |
Lua synopsis |
simUI.setScene3DNodeParam(int ui, int widget, int nodeId, string paramName, anything paramValue)
|
Lua parameters |
ui (int): the ui handle
widget (int): the widget identifier
nodeId (int): the node id
paramName (string): the parameter name
paramValue (anything): the parameter value
|
Lua return values |
- |
See also
|
|
simUI.setScene3DNodeStringParam
simUI.setScene3DNodeVector2Param
simUI.setScene3DNodeVector3Param
simUI.setScene3DNodeVector4Param
simUI.setSize
simUI.setSliderValue
simUI.setSpinboxValue
simUI.setStyleSheet
simUI.setTableSelection
simUI.setText
simUI.setTitle
simUI.setTreeSelection
simUI.setUrl
simUI.setWidgetVisibility
Description
|
Hide or show a widget. |
Lua synopsis |
simUI.setWidgetVisibility(int handle, int id, bool visibility)
|
Lua parameters |
handle (int): ui handle
id (int): widget id
visibility (bool): true if the window is visible, false otherwise
|
Lua return values |
- |
See also
|
simUI.getWidgetVisibility simUI.setEnabled simUI.setStyleSheet
|
simUI.show
simUI.updateTreeItemParent
simUI.updateTreeItemText
Constants
Constants used in the various functions. Refer to each constant using enumName.constantName, i.e. simUI.curve_type.xy for xy constant in simUI.curve_type enum.
simUI.msgbox_type
info
question
warning
critical
|
simUI.msgbox_buttons
ok
yesno
yesnocancel
okcancel
|
simUI.msgbox_result
simUI.filedialog_type
load
load_multiple
save
folder
|
simUI.curve_type
time: a curve with an X-simple domain, i.e. y = f(x)
xy: a parametric curve, i.e. x = fx(t), y = fy(t)
|
simUI.curve_style
scatter
line
line_and_scatter
step_left: only available for 'time' curves
step_center: only available for 'time' curves
step_right: only available for 'time' curves
impulse: only available for 'time' curves
|
simUI.curve_scatter_shape
none
dot
cross
plus
circle
disc
square
diamond
star
triangle
triangle_inverted
cross_square
plus_square
cross_circle
plus_circle
peace
|
simUI.line_style
simUI.scene3d_node_type
entity
transform
camera
camera_controller_first_person
camera_controller_orbit
light_point
light_directional
light_spot
mesh_cuboid
mesh_torus
mesh_cone
mesh_cylinder
mesh_plane
mesh_sphere
mesh
material_phong
material_gooch
material_texture
material_diffuse_map
texture2d
texture_image
object_picker
|
simUI.mouse
left_button_down: left mouse button pressed
left_button_up: left mouse button released
move: mouse pointer has been moved
|
Data structures
Data structures are used to pass complex data around. Create data structures in Lua in the form of a hash table, e.g.: {line_size=3, add_to_legend=false, selectable=true}
curve_options
keyboard_modifiers
Description
|
|
Fields |
control (bool, default: false):
shift (bool, default: false):
|
See also
|
|
Script functions
Script functions are used to call some lua code from the plugin side (tipically used for event handlers).
onclickCallback
Description
|
Callback for button click event. |
Lua synopsis |
simUI.onclickCallback(int handle, int id)
|
Lua parameters |
handle (int): ui handle
id (int): the ID of the clicked button
|
Lua return values |
- |
See also
|
|
onLinkActivatedCallback
Description
|
Callback for when a link is clicked. |
Lua synopsis |
simUI.onLinkActivatedCallback(int handle, int id, string link)
|
Lua parameters |
handle (int): ui handle
id (int): the ID of the clicked button
link (string): the href attribute of the activated link
|
Lua return values |
- |
See also
|
|
onchangeIntCallback
Description
|
Callback for widget change event. |
Lua synopsis |
simUI.onchangeIntCallback(int handle, int id, int value)
|
Lua parameters |
handle (int): ui handle
id (int): the ID of the widget
value (int): the new value
|
Lua return values |
- |
See also
|
|
onchangeDoubleCallback
Description
|
Callback for widget change event. |
Lua synopsis |
simUI.onchangeDoubleCallback(int handle, int id, float value)
|
Lua parameters |
handle (int): ui handle
id (int): the ID of the widget
value (float): the new value
|
Lua return values |
- |
See also
|
|
onchangeStringCallback
Description
|
Callback for widget change event. |
Lua synopsis |
simUI.onchangeStringCallback(int handle, int id, string value)
|
Lua parameters |
handle (int): ui handle
id (int): the ID of the widget
value (string): the new value
|
Lua return values |
- |
See also
|
|
oneditingfinishedCallback
Description
|
Callback for editing finished event. |
Lua synopsis |
simUI.oneditingfinishedCallback(int handle, int id, string value)
|
Lua parameters |
handle (int): ui handle
id (int): the ID of the widget
value (string): the new value
|
Lua return values |
- |
See also
|
|
oncloseCallback
Description
|
Callback for window close event. It will be called when the user clicks the close button of the window. When an onclose callback is specified, the window will not close automatically when the user clicks the window close button. |
Lua synopsis |
simUI.oncloseCallback(int handle)
|
Lua parameters |
handle (int): the handle of the UI |
Lua return values |
- |
See also
|
|
onPlottableClickCallback
Description
|
Callback for plot widget plottableClick event. |
Lua synopsis |
simUI.onPlottableClickCallback(int handle, int id, string curve, int index, float x, float y)
|
Lua parameters |
handle (int): the handle of the UI
id (int): the ID of the plot widget
curve (string): the name of the curve
index (int): the index of the clicked point in the curve
x (float): the x value of the clicked point
y (float): the y value of the clicked point
|
Lua return values |
- |
See also
|
|
onLegendClickCallback
Description
|
Callback for plot widget legendClick event. |
Lua synopsis |
simUI.onLegendClickCallback(int handle, int id, string curve)
|
Lua parameters |
handle (int): the handle of the UI
id (int): the ID of the plot widget
curve (string): the name of the curve
|
Lua return values |
- |
See also
|
|
onCellActivateCallback
Description
|
Callback for table widget cellActivated event. |
Lua synopsis |
simUI.onCellActivateCallback(int handle, int id, int row, int column, string cellValue)
|
Lua parameters |
handle (int): the handle of the UI
id (int): the ID of the plot widget
row (int): the row index (zero based) of the activated cell
column (int): the column index (zero based) of the activated cell
cellValue (string): the value of the cell
|
Lua return values |
- |
See also
|
|
onTableSelectionChangeCallback
Description
|
Callback for table widget selectionChanged event. |
Lua synopsis |
simUI.onTableSelectionChangeCallback(int handle, int id, int row, int column)
|
Lua parameters |
handle (int): the handle of the UI
id (int): the ID of the plot widget
row (int): the row index (zero based) of the activated cell
column (int): the column index (zero based) of the activated cell
|
Lua return values |
- |
See also
|
|
onTreeSelectionChangeCallback
Description
|
Callback for tree widget selectionChanged event. |
Lua synopsis |
simUI.onTreeSelectionChangeCallback(int handle, int id, int item_id)
|
Lua parameters |
handle (int): the handle of the UI
id (int): the ID of the plot widget
item_id (int): the item id
|
Lua return values |
- |
See also
|
|
onMouseEventCallback
Description
|
Callback for a mouse event. |
Lua synopsis |
simUI.onMouseEventCallback(int handle, int id, int type, keyboard_modifiers mods, int x, int y)
|
Lua parameters |
handle (int): the handle of the UI
id (int): the ID of the widget
type (int): the mouse event type, one of the values from simUI.mouse
x (int): x coordinate of mouse pointer
y (int): y coordinate of mouse pointer
|
Lua return values |
- |
See also
|
|
onNodeAddedCallback
Description
|
Callback called when a node is added to a dataflow widget. |
Lua synopsis |
simUI.onNodeAddedCallback(int handle, int id, int nodeId, int x, int y, string text, int inlets, int outlets)
|
Lua parameters |
handle (int): the handle of the UI
id (int): the ID of the widget
nodeId (int): the ID of the node
x (int): x coordinate of the node
y (int): y coordinate of the node
text (string): node text
inlets (int): node inlet count
outlets (int): node outlet count
|
Lua return values |
- |
See also
|
|
onNodeRemovedCallback
Description
|
Callback called when a node is removed from a dataflow widget. |
Lua synopsis |
simUI.onNodeRemovedCallback(int handle, int id, int nodeId)
|
Lua parameters |
handle (int): the handle of the UI
id (int): the ID of the widget
nodeId (int): the ID of the node
|
Lua return values |
- |
See also
|
|
onNodeValidChangedCallback
Description
|
Callback called when the validity of a node is changed in a dataflow widget. |
Lua synopsis |
simUI.onNodeValidChangedCallback(int handle, int id, int nodeId, bool valid)
|
Lua parameters |
handle (int): the handle of the UI
id (int): the ID of the widget
nodeId (int): the ID of the node
valid (bool): the validity of the node
|
Lua return values |
- |
See also
|
|
onNodePosChangedCallback
Description
|
Callback called when the position of a node is changed in a dataflow widget. |
Lua synopsis |
simUI.onNodePosChangedCallback(int handle, int id, int nodeId, int x, int y)
|
Lua parameters |
handle (int): the handle of the UI
id (int): the ID of the widget
nodeId (int): the ID of the node
x (int): the x coordinate of the node
y (int): the y coordinate of the node
|
Lua return values |
- |
See also
|
|
onNodeTextChangedCallback
Description
|
Callback called when the text of a node is changed in a dataflow widget. |
Lua synopsis |
simUI.onNodeTextChangedCallback(int handle, int id, int nodeId, string text)
|
Lua parameters |
handle (int): the handle of the UI
id (int): the ID of the widget
nodeId (int): the ID of the node
text (string): the text of the node
|
Lua return values |
- |
See also
|
|
onNodeInletCountChangedCallback
Description
|
Callback called when the inlet count of a node is changed in a dataflow widget. |
Lua synopsis |
simUI.onNodeInletCountChangedCallback(int handle, int id, int nodeId, int count)
|
Lua parameters |
handle (int): the handle of the UI
id (int): the ID of the widget
nodeId (int): the ID of the node
count (int): the inlet count of the node
|
Lua return values |
- |
See also
|
|
onNodeOutletCountChangedCallback
Description
|
Callback called when the outlet count of a node is changed in a dataflow widget. |
Lua synopsis |
simUI.onNodeOutletCountChangedCallback(int handle, int id, int nodeId, int count)
|
Lua parameters |
handle (int): the handle of the UI
id (int): the ID of the widget
nodeId (int): the ID of the node
count (int): the outlet count of the node
|
Lua return values |
- |
See also
|
|
onConnectionAddedCallback
Description
|
Callback called when a connection is created in a dataflow widget. |
Lua synopsis |
simUI.onConnectionAddedCallback(int handle, int id, int srcNodeId, int srcOutlet, int dstNodeId, int dstInlet)
|
Lua parameters |
handle (int): the handle of the UI
id (int): the ID of the widget
srcNodeId (int): the ID of source the node
srcOutlet (int): the index (zero-based) of the source node outlet
dstNodeId (int): the ID of the destination node
dstInlet (int): the index (zero-based) of the destination node inlet
|
Lua return values |
- |
See also
|
|
onConnectionRemovedCallback
Description
|
Callback called when a connection is removed in a dataflow widget. |
Lua synopsis |
simUI.onConnectionRemovedCallback(int handle, int id, int srcNodeId, int srcOutlet, int dstNodeId, int dstInlet)
|
Lua parameters |
handle (int): the handle of the UI
id (int): the ID of the widget
srcNodeId (int): the ID of source the node
srcOutlet (int): the index (zero-based) of the source node outlet
dstNodeId (int): the ID of the destination node
dstInlet (int): the index (zero-based) of the destination node inlet
|
Lua return values |
- |
See also
|
|
onKeyPressCallback
Description
|
Callback called when a key is pressed in a widget. |
Lua synopsis |
simUI.onKeyPressCallback(int handle, int id, int key, string text)
|
Lua parameters |
handle (int): the handle of the UI
id (int): the ID of the widget
key (int): the integer value of the key
text (string): a textual representation of the key
|
Lua return values |
- |
See also
|
|
onScene3DObjectClickCallback
Description
|
Callback called when an object is clicked in a scene3d widget. |
Lua synopsis |
simUI.onScene3DObjectClickCallback(int handle, int id, int nodeId)
|
Lua parameters |
handle (int): the handle of the UI
id (int): the ID of the widget
nodeId (int): the ID of the object-picker
|
Lua return values |
- |
See also
|
|
|