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 dialog) Redraws the entire dialog. | |
string | Focus(Dialog dialog, btn) Set the focus, if possible, to a button or a dialog item that accepts it. |
Map | GetAllPaletteButtons(Dialog dialog) Get all palette buttons as a Map. |
Button | GetPaletteButton(Dialog dialog, string name) Retrieve an palette button from its name |
Button | GetPaletteButtonUnderMouse(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.
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!
Parameter | Type | Default | Description |
---|---|---|---|
dialog | Dialog |
Dialog.UserTable.HidePanel(Dialog dialog, string name)
Hide a panel
Parameter | Type | Default | Description |
---|---|---|---|
dialog | Dialog | ||
name | string | Name of the panel |
- Error
- if dialog is omitted
- See
- SMDialog:hidePanel
Dialog.UserTable.HideAllPanels(Dialog dialog)
Hide all panels
Parameter | Type | Default | Description |
---|---|---|---|
dialog | Dialog |
- Error
- if dialog is omitted
- See
- SMDialog:hideAllPanels
Dialog.UserTable.ShowPanel(Dialog dialog, string name)
Show a panel
Parameter | Type | Default | Description |
---|---|---|---|
dialog | Dialog | ||
name | string | 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
Parameter | Type | Default | Description |
---|---|---|---|
dialog | Dialog | ||
name | string | Name of the panel | |
x | number | Horizontal position | |
y | number | Vertical position | |
avoidOutside | bool | Ensure that the panel is fully visible within dialog area, this may change x,y position | |
allowSymetry | bool | 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.
Parameter | Type | Default | Description |
---|---|---|---|
dialog | Dialog | ||
btn | nil | Button 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
Parameter | Type | Default | Description |
---|---|---|---|
dialog | Dialog |
- 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
Parameter | Type | Default | Description |
---|---|---|---|
dialog | Dialog | ||
name | string | 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!
Parameter | Type | Default | Description |
---|---|---|---|
dialog | Dialog |
- Error
- if dialog is omitted