This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
dev:v3:gui_api:dialog:inputgui1 [2020/07/09 04:56] – jedi18 | dev:v3:gui_api:dialog:inputgui1 [2020/07/09 06:24] – jedi18 | ||
---|---|---|---|
Line 51: | Line 51: | ||
<code cpp-qt> namespace lc::ui::api </ | <code cpp-qt> namespace lc::ui::api </ | ||
- | The Angle GUI class is used to enter an angle. Angle can be toggled between radians and degrees by clicking on the Rad/Deg button or by using the appropriate functions. | + | The Angle GUI class is used to enter an angle. Angle can be toggled between radians and degrees by clicking on the Rad/Deg button or by using the appropriate functions. Needs to be added to the dialog widget to be used. |
---- | ---- | ||
- | ==== Label ==== | + | ==== Constructor |
---- | ---- | ||
Line 61: | Line 61: | ||
=== Description === | === Description === | ||
- | Get and set label for the Input GUI widget. | + | Constructs an angle gui widget. |
=== Examples === | === Examples === | ||
- | * <code lua> | + | * <code lua> |
- | * <code lua> input1: | + | |
---- | ---- | ||
- | ==== Enable | + | ==== Get and Set Values |
---- | ---- | ||
Line 76: | Line 75: | ||
=== Description === | === Description === | ||
- | Enable or disable | + | Used to get the current value of the angle widget |
+ | |||
+ | //Note:- Always returns and expects the value to be in **RADIANS** . If the current display mode is in degrees, the angle is converted to degrees and displayed. When retrieving the mode dosen' | ||
=== Examples === | === Examples === | ||
- | * <code lua> | + | * <code lua> |
- | * <code lua> | + | * <code lua> |
+ | ---- | ||
+ | |||
+ | ==== To Degrees ==== | ||
+ | |||
+ | ---- | ||
+ | |||
+ | === Description === | ||
+ | |||
+ | Used to switch the display mode to degrees, if the value is in radians it is automatically converted and shown in degrees. | ||
+ | |||
+ | === Examples === | ||
+ | |||
+ | * <code lua> angle1: | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== To Radians ==== | ||
+ | |||
+ | ---- | ||
+ | |||
+ | === Description === | ||
+ | |||
+ | Used to switch the display mode to radians, if the value is in degrees it is automatically converted and shown in radians. | ||
+ | |||
+ | === Examples === | ||
+ | |||
+ | * <code lua> angle1: | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Add Finish Callback ==== | ||
+ | |||
+ | ---- | ||
+ | |||
+ | === Description === | ||
+ | |||
+ | Add a finish callback which is called when the user presses enter after entering the angle or clicks somewhere else and the input gui loses focus. This is different from the dialog widget finish callback. | ||
+ | |||
+ | === Examples === | ||
+ | |||
+ | * <code lua> angle1: | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Add On Change Callback ==== | ||
+ | |||
+ | ---- | ||
+ | |||
+ | === Description === | ||
+ | |||
+ | Add an on change callback which is called when the user types anything i.e. on any change to the input. | ||
+ | |||
+ | === Examples === | ||
+ | |||
+ | * <code lua> angle1: | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Button GUI Class ===== | ||
+ | |||
+ | ---- | ||
+ | |||
+ | [[https:// | ||
+ | <code cpp-qt> namespace lc::ui::api </ | ||
+ | |||
+ | The Button GUI class is used to add a button to the dialog widget. Callbacks can be added to the button which is called when the button is clicked. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Constructor ==== | ||
+ | |||
+ | ---- | ||
+ | |||
+ | === Description === | ||
+ | |||
+ | Constructs an button gui widget | ||
+ | |||
+ | === Examples === | ||
+ | |||
+ | * <code lua> local button1 = gui.ButtonGUI(" | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Add Callback ==== | ||
+ | |||
+ | ---- | ||
+ | |||
+ | === Description === | ||
+ | |||
+ | Add a callback to be called whenever the user clicks on the button. | ||
+ | |||
+ | === Examples === | ||
+ | |||
+ | * <code lua> button1: | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Checkbox GUI Class ===== | ||
+ | |||
+ | ---- | ||
+ | |||
+ | [[https:// | ||
+ | <code cpp-qt> namespace lc::ui::api </ | ||
+ | |||
+ | The Checkbox GUI class is used to add a checkbox to the dialog widget. Callbacks can be added to the checkbox which is called when the checkbox is checked or unchecked. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Constructor ==== | ||
+ | |||
+ | ---- | ||
+ | |||
+ | === Description === | ||
+ | |||
+ | Constructs an checkbox gui widget | ||
+ | |||
+ | === Examples === | ||
+ | |||
+ | * <code lua> local check1 = gui.CheckBoxGUI(" | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Add Callback ==== | ||
+ | |||
+ | ---- | ||
+ | |||
+ | === Description === | ||
+ | |||
+ | Add a callback to be called whenever the user checks or unchecks the checkbox.Passes in a bool representing whether the button is checked or not. | ||
+ | |||
+ | === Examples === | ||
+ | |||
+ | * <code lua> check1: | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Set checked and Is checked ==== | ||
+ | |||
+ | ---- | ||
+ | |||
+ | === Description === | ||
+ | |||
+ | Check if the checkbox is checked or set the checkbox to be checked/ | ||
+ | |||
+ | === Examples === | ||
+ | |||
+ | * <code lua> local isChecked = check1: | ||
+ | * <code lua> check1: | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== ComboBox GUI Class ===== | ||
+ | |||
+ | ---- | ||
+ | |||
+ | [[https:// | ||
+ | <code cpp-qt> namespace lc::ui::api </ | ||
+ | |||
+ | The ComboBox GUI class is used to add a combobox to the dialog widget. Callbacks can be added to the checkbox which is called when a element is selected, the name of the selected element is passed as a parameter to the callback. | ||
+ | ---- | ||
+ | |||
+ | ==== Constructor ==== | ||
+ | |||
+ | ---- | ||
+ | |||
+ | === Description === | ||
+ | |||
+ | Constructs an combobox gui widget | ||
+ | |||
+ | === Examples === | ||
+ | |||
+ | * <code lua> local combo1 = gui.ComboBoxGUI(" | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Add Callback ==== | ||
+ | |||
+ | ---- | ||
+ | |||
+ | === Description === | ||
+ | |||
+ | Add a callback to be called whenever selects an element from the combobox.Passes in a string representing the name of the selected element in the combobox. | ||
+ | |||
+ | === Examples === | ||
+ | |||
+ | * <code lua> combo1: | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Get and Set Values ==== | ||
+ | |||
+ | ---- | ||
+ | |||
+ | === Description === | ||
+ | |||
+ | Used to get the current element string of the combobox widget or set it to a desired element. If the user attempts to set an element that does not exist in the combobox, nothing happens. | ||
+ | Element can also be set by specifying the index of the element to be selected. | ||
+ | |||
+ | |||
+ | === Examples === | ||
+ | |||
+ | * <code lua> local val = combo1: | ||
+ | * <code lua> combo1: | ||
+ | * <code lua> combo1: | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Add Item ==== | ||
+ | |||
+ | ---- | ||
+ | |||
+ | === Description === | ||
+ | |||
+ | Add an item to the combobox, if index is not specified it is added to the end of the combobox list. | ||
+ | |||
+ | |||
+ | === Examples === | ||
+ | |||
+ | * <code lua> combo1: | ||
+ | * <code lua> combo1: | ||
+ | |||
+ | ---- |