Table Dialog.UserTable
Functions and variables in MyrScript's Dialog.UserTable
Summary
Field | Type | Summary |
---|---|---|
Lexicon | Lexicon | Lexicon attached to the Dialog |
smDialog | SMDialog | Reference to SMDialog object. |
Return type | Function and summary |
---|---|
DrawContent(Dialog dlg) Redraws the entire dialog. | |
string | Focus(Dialog dlg, btn) Set the focus, if possible, to a Component or a DialogItem that accepts it. |
Map | GetAllComponents(Dialog dlg) Get all components as a Map. |
Component | GetComponent(Dialog dlg, string name) Retrieve an component from its name |
Component | GetComponentUnderMouse(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.
Functions
Dialog.UserTable.GetAllComponents(Dialog dlg)
Get all components as a Map.
Use this to iterate over all components, not to add/remove them!
Parameter | Type | Default | Description |
---|---|---|---|
dlg | Dialog | dlg |
Dialog.UserTable.HidePanel(Dialog dlg, string name)
Hide a panel
Parameter | Type | Default | Description |
---|---|---|---|
dlg | Dialog | dlg | |
name | string | Name of the panel |
- Error
- if dlg is omitted
- See
- SMDialog:hidePanel
Dialog.UserTable.HideAllPanels(Dialog dlg)
Hide all panels
Parameter | Type | Default | Description |
---|---|---|---|
dlg | Dialog | dlg |
- Error
- if dlg is omitted
- See
- SMDialog:hideAllPanels
Dialog.UserTable.ShowPanel(Dialog dlg, string name)
Show a panel
Parameter | Type | Default | Description |
---|---|---|---|
dlg | Dialog | dlg | |
name | string | 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
Parameter | Type | Default | Description |
---|---|---|---|
dlg | Dialog | dlg | |
name | string | Name of the panel | |
x | number | Horizontal position | |
y | number | Vertical position | |
avoidOutside | boolean | Ensure that the panel is fully visible within dialog area, this may change x,y position | |
allowSymetry | boolean | 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.
Parameter | Type | Default | Description |
---|---|---|---|
dlg | Dialog | dlg | |
btn | nil | Component 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
Parameter | Type | Default | Description |
---|---|---|---|
dlg | Dialog | 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
Parameter | Type | Default | Description |
---|---|---|---|
dlg | Dialog | dlg | |
name | string | 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!
Parameter | Type | Default | Description |
---|---|---|---|
dlg | Dialog | dlg |
- Error
- if dlg is omitted