add show_checkbox_dialog

This commit is contained in:
Evgeny
2021-08-28 09:27:09 +03:00
parent 6714963c60
commit 6b61550277
3 changed files with 4 additions and 2 deletions

View File

@@ -51,7 +51,8 @@ First line<br/> Second line
* `ui:show_dialog(title, text, [button1_text], [button2_text])` - show dialog, the first argument is the title, the second is the text, button1\_text is the name of the first button, button2\_text is the name of the second button;
* `ui:show_edit_dialog(title, [text], [default_value])` - show the dialog with the input field: title - title, text - signature, default\_value - standard value of the input field;
* `ui:show_checkbox_dialog (title, lines, [index])` - show a dialog with a choice: title - title, lines - table of lines, index - index of the default value;
* `ui:show_radio_dialog (title, lines, [index])` - show a dialog with a choice: title - title, lines - table of lines, index - index of the default value;
* `ui:show_checkbox_dialog(title, lines, [table])` - show dialog with selection of several elements: title - title, lines - table of lines, table - table default values.
Dialog button clicks should be processed in the `on_dialog_action(number)` callback, where 1 is the first button, 2 is the second, and -1 is the "closed" button if no buttons were specified. `ui:show_edit_dialog()` returns the text in the `on_dialog_action(text)` callback.

View File

@@ -52,6 +52,7 @@ First line<br/>Second line
* `ui:show_dialog(title, text, [button1_text], [button2_text])` - показать диалог; первый аргумент - заголовок, второй - текст, button1\_text - имя первой кнопки, button2\_text - имя второй кнопки;
* `ui:show_edit_dialog(title, [text], [default_value])` - показать диалог с полем ввода: title - заголовок, text - подпись, default\_value - стандартное значения поля ввода;
* `ui:show_radio_dialog(title, lines, [index])` - показать диалог с выбором: title - заголовок, lines - таблица строк, index - индекс дефолтового значения;
* `ui:show_checkbox_dialog(title, lines, [table])` - показать диалог с выбором нескольких элементов: title - заголовок, lines - таблица строк, table - таблица дефолтовых значений.
Нажатия на кнопки диалога должны обрабатываться в колбеке `on_dialog_action(number)`, где 1 - это первая кнопка, 2 - вторая, а -1 - нажатие кнопки "закрыть", если никакие кнопки не были указаны. `ui:show_edit_dialog()` возвращает текст в колбек `on_dialog_action(text)`.

View File

@@ -4,7 +4,7 @@ end
function on_click()
dialog_items = { "One", "Two", "Three" }
ui:show_checkbox_dialog("Title", dialog_items, 2)
ui:show_checkbox_dialog("Title", dialog_items, { 1, 3})
end
function on_dialog_action(tab)