This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| dev:v3:gui_api:dialog:dialogwidget [2020/07/08 06:37] – created jedi18 | dev:v3:gui_api:dialog:dialogwidget [2020/07/09 04:46] (current) – jedi18 | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| [[https:// | [[https:// | ||
| <code cpp-qt> namespace lc::ui::api </ | <code cpp-qt> namespace lc::ui::api </ | ||
| + | |||
| + | A Dialog widget object acts a parent widget containing all the input gui widgets. A finish button can be added which on being clicked retrieves the values of all the input guis in a table when the user is finished with the dialog. This table is passed in as a parameter to all the finish callbacks added to the dialog widget. | ||
| ---- | ---- | ||
| Line 9: | Line 11: | ||
| ---- | ---- | ||
| + | ==== Description ==== | ||
| + | |||
| + | Constructs a dialog widget object. This dialog widget contains all the input gui widgets. The constructor takes in a label and a mainwindow pointer as parameters. Can be constructed using the < | ||
| + | |||
| + | * Dialog Label - //string// , Current MainWindow - // | ||
| + | |||
| + | ==== Examples ==== | ||
| + | |||
| + | * <code lua> local dialog1 = gui.DialogWidget(" | ||
| + | * <code lua> local dialog1 = CreateDialogWidget(" | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== Add Input GUI Widget ===== | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ==== Description ==== | ||
| + | |||
| + | Add an input gui widget to the dialog widget. Expects a key and input widget as parameters. Key is used to retrieve the value of the input gui widget. | ||
| + | |||
| + | Note:- If button or checkbox is added, the addWidget function first adds it to a horizontal group gui widget which is then added to the dialog widget. | ||
| + | |||
| + | * Key - //string// , Input GUI Widget - // | ||
| + | |||
| + | ==== Examples ==== | ||
| + | |||
| + | * <code lua> local angle1 = gui.AngleGUI(" | ||
| + | | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== Get list of input widgets ===== | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ==== Description ==== | ||
| + | |||
| + | Returns a list of all input widgets present in the dialog widget. | ||
| + | |||
| + | ==== Examples ==== | ||
| + | |||
| + | * <code lua> local guiwidgets = dialog1: | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== Title ===== | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ==== Description ==== | ||
| + | |||
| + | Get and set title for the dialog widget | ||
| + | |||
| + | ==== Examples ==== | ||
| + | |||
| + | * <code lua> message(dialog1: | ||
| + | * <code lua> dialog1: | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== Set Finish Button ===== | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ==== Description ==== | ||
| + | |||
| + | Set a button as the finish button for the dialog widget which on being clicked will return a table of all values to all the finish lua callbacks added to the dialog widget. | ||
| + | |||
| + | * Finish button - // | ||
| + | |||
| + | ==== Examples ==== | ||
| + | |||
| + | * <code lua> dialog1: | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== Add Finish Callback ===== | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ==== Description ==== | ||
| + | |||
| + | Add a finish callback which is called whenever the user is done with the dialog and clicks on the finish button. The callback is passed in a table containing the key and value of all the input gui widgets. | ||
| + | |||
| + | * Lua Callback - // | ||
| + | |||
| + | ==== Examples ==== | ||
| + | |||
| + | * <code lua> dialog1: | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== Get keys ===== | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ==== Description ==== | ||
| + | |||
| + | Returns a list of keys of all the input gui widgets in the dialog. | ||
| + | |||
| + | ==== Examples ==== | ||
| + | |||
| + | * <code lua> local keyList = dialog1: | ||
| + | |||
| + | ---- | ||