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 dialog)
Redraws the entire dialog.
stringFocus(Dialog dialog, btn)
Set the focus, if possible, to a button or a dialog item that accepts it.
MapGetAllPaletteButtons(Dialog dialog)
Get all palette buttons as a Map.
ButtonGetPaletteButton(Dialog dialog, string name)
Retrieve an palette button from its name
ButtonGetPaletteButtonUnderMouse(Dialog dialog)
Get the palette button under mouse pointer
 HideAllPanels(Dialog dialog)
Hide all panels
 HidePanel(Dialog dialog, string name)
Hide a panel
 MovePanel(Dialog dialog, string name, number x, number y, bool avoidOutside, bool allowSymetry)
Move a panel to a new position
 ShowPanel(Dialog dialog, 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.GetAllPaletteButtons(Dialog dialog)

Get all palette buttons as a Map.

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

ParameterTypeDefaultDescription
dialogDialog  
Return
Map: Map of buttons name => Button table
Error
if dialog is omitted

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

Hide a panel

ParameterTypeDefaultDescription
dialogDialog  
namestring Name of the panel
Error
if dialog is omitted
See
SMDialog:hidePanel

Dialog.UserTable.HideAllPanels(Dialog dialog)

Hide all panels

ParameterTypeDefaultDescription
dialogDialog  
Error
if dialog is omitted
See
SMDialog:hideAllPanels

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

Show a panel

ParameterTypeDefaultDescription
dialogDialog  
namestring Name of the panel
Error
if dialog is omitted
See
SMDialog:showPanel

Dialog.UserTable.MovePanel(Dialog dialog, string name, number x, number y, bool avoidOutside, bool allowSymetry)

Move a panel to a new position

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

Dialog.UserTable.Focus(Dialog dialog, btn)

Set the focus, if possible, to a button or a dialog item that accepts it.

ParameterTypeDefaultDescription
dialogDialog  
btn nilButton or DialogItem object or name (string). If nil, focus will not change.
Return
string: The focused Button or DialogItem's name, or nil if no focus.
Error
if dialog is omitted
See
SMDialog:focus

Dialog.UserTable.GetPaletteButtonUnderMouse(Dialog dialog)

Get the palette button under mouse pointer

ParameterTypeDefaultDescription
dialogDialog  
Return
Button: nil if no button under mouse pointer
Error
if dialog is omitted
See
SMDialog:getPaletteButtonUnderMouse

Dialog.UserTable.GetPaletteButton(Dialog dialog, string name)

Retrieve an palette button from its name

ParameterTypeDefaultDescription
dialogDialog  
namestring Name of the button
Return
Button: A button or nil if not found
Error
if dialog is omitted
See
SMDialog:getPaletteButton

Dialog.UserTable.DrawContent(Dialog dialog)

Redraws the entire dialog.

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

ParameterTypeDefaultDescription
dialogDialog  
Error
if dialog is omitted