Table Dialog.UserTable

Functions and variables in MyrScript's Dialog.UserTable

Summary

FieldTypeSummary
LexiconLexiconLexicon attached to the Dialog
smDialogSMDialogReference to SMDialog object.
Return typeFunction and summary
 DrawContent(Dialog dlg)
Redraws the entire dialog.
stringFocus(Dialog dlg, btn)
Set the focus, if possible, to a Component or a DialogItem that accepts it.
MapGetAllComponents(Dialog dlg)
Get all components as a Map.
ComponentGetComponent(Dialog dlg, string name)
Retrieve an component from its name
ComponentGetComponentUnderMouse(Dialog dlg)
Get the component under mouse pointer
 HideAllPanels(Dialog dlg)
Hide all panels
 HidePanel(Dialog dlg, string name)
Hide a panel
 MovePanel(Dialog dlg, string name, number x, number y, boolean avoidOutside, boolean allowSymetry)
Move a panel to a new position
 ShowPanel(Dialog dlg, string name)
Show a panel

Fields

SMDialog Dialog.UserTable.smDialog

Reference to SMDialog object.

In most case, this is useless as SMDialog callable methods after Dialog.Init() are exposed in Dialog.UserTable.

Lexicon Dialog.UserTable.Lexicon

Lexicon attached to the Dialog

Functions

Dialog.UserTable.GetAllComponents(Dialog dlg)

Get all components as a Map.

Use this to iterate over all components, not to add/remove them!

ParameterTypeDefaultDescription
dlgDialog dlg
Return
Map: Map of components name => Component table
Error
if dlg is omitted

Dialog.UserTable.HidePanel(Dialog dlg, string name)

Hide a panel

ParameterTypeDefaultDescription
dlgDialog dlg
namestring Name of the panel
Error
if dlg is omitted
See
SMDialog:hidePanel

Dialog.UserTable.HideAllPanels(Dialog dlg)

Hide all panels

ParameterTypeDefaultDescription
dlgDialog dlg
Error
if dlg is omitted
See
SMDialog:hideAllPanels

Dialog.UserTable.ShowPanel(Dialog dlg, string name)

Show a panel

ParameterTypeDefaultDescription
dlgDialog dlg
namestring Name of the panel
Error
if dlg is omitted
See
SMDialog:showPanel

Dialog.UserTable.MovePanel(Dialog dlg, string name, number x, number y, boolean avoidOutside, boolean allowSymetry)

Move a panel to a new position

ParameterTypeDefaultDescription
dlgDialog dlg
namestring Name of the panel
xnumber Horizontal position
ynumber Vertical position
avoidOutsideboolean Ensure that the panel is fully visible within dialog area, this may change x,y position
allowSymetryboolean If avoidOutside then x,y can be any corner of the panel, instead of default left top
Error
if dlg is omitted
See
SMDialog:movePanel

Dialog.UserTable.Focus(Dialog dlg, btn)

Set the focus, if possible, to a Component or a DialogItem that accepts it.

ParameterTypeDefaultDescription
dlgDialog dlg
btn nilComponent or DialogItem object or name (string). If nil, focus will not change.
Return
string: The focused Component or DialogItem's name, or nil if no focus.
Error
if dlg is omitted
See
SMDialog:focus

Dialog.UserTable.GetComponentUnderMouse(Dialog dlg)

Get the component under mouse pointer

ParameterTypeDefaultDescription
dlgDialog dlg
Return
Component: nil if no component under mouse pointer
Error
if dlg is omitted
See
SMDialog:getComponentUnderMouse

Dialog.UserTable.GetComponent(Dialog dlg, string name)

Retrieve an component from its name

ParameterTypeDefaultDescription
dlgDialog dlg
namestring Name of the component
Return
Component: A Component or nil if not found
Error
if dlg is omitted
See
SMDialog:getComponent

Dialog.UserTable.DrawContent(Dialog dlg)

Redraws the entire dialog.

It calls Dialog.DrawContent() but need to set a value before. If you call directly Dialog.DrawContent(), components will be missing!

ParameterTypeDefaultDescription
dlgDialog dlg
Error
if dlg is omitted