diff --git a/README.md b/README.md index f0766d7..e93fb9f 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,8 @@ First line
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. diff --git a/README_ru.md b/README_ru.md index f5b8348..8ca1d9a 100644 --- a/README_ru.md +++ b/README_ru.md @@ -52,6 +52,7 @@ First line
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)`. diff --git a/samples/checkbox-dialog-sample.lua b/samples/checkbox-dialog-sample.lua index 853aec5..89ebdb9 100644 --- a/samples/checkbox-dialog-sample.lua +++ b/samples/checkbox-dialog-sample.lua @@ -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)