• skip to content

Wiki

User Tools

  • Admin
  • Log In

Site Tools

  • Recent Changes
  • Media Manager
  • Sitemap
Trace:

dev:v3:gui_api:dialog:inputgui1

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dev:v3:gui_api:dialog:inputgui1 [2020/07/09 05:09] – jedi18dev:v3:gui_api:dialog:inputgui1 [2020/07/10 03:56] (current) – jedi18
Line 65: Line 65:
 === Examples === === Examples ===
  
-  * <code lua> local angle1 = gui.AngleGUI("Angle1") </code>+  * <code lua> local angle1 = gui.Angle("Angle1") </code>
  
 ---- ----
Line 138: Line 138:
 === Examples === === Examples ===
  
-  * <code lua> angle1:addOnChangeCallback(function() message(tostring(dialog1:value())) end) </code>+  * <code lua> angle1:addOnChangeCallback(function() message(tostring(angle1:value())) end) </code> 
 + 
 +---- 
 + 
 +===== Button GUI Class ===== 
 + 
 +---- 
 + 
 +[[https://github.com/LibreCAD/LibreCAD_3/blob/master/lcUI/widgets/guiAPI/buttongui.h|Github Link]] 
 +<code cpp-qt> namespace lc::ui::api </code> 
 + 
 +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.Button("button1") </code> 
 + 
 +---- 
 + 
 +==== Add Callback ==== 
 + 
 +---- 
 + 
 +=== Description === 
 + 
 +Add a callback to be called whenever the user clicks on the button. 
 + 
 +=== Examples === 
 + 
 +  * <code lua> button1:addCallback(function() message("Button Clicked") end) </code> 
 + 
 +---- 
 + 
 +===== RadioButton GUI Class ===== 
 + 
 +---- 
 + 
 +[[https://github.com/LibreCAD/LibreCAD_3/blob/master/lcUI/widgets/guiAPI/radiobuttongui.h|Github Link]] 
 +<code cpp-qt> namespace lc::ui::api </code> 
 + 
 +The RadioButton GUI class is used to add a RadioButton to a radio group of the dialog widget. Callbacks can be added to the button which is called when the radiobutton is checked. 
 + 
 +---- 
 + 
 +==== Constructor ==== 
 + 
 +---- 
 + 
 +=== Description === 
 + 
 +Constructs a radiobutton gui widget. 
 + 
 +=== Examples === 
 + 
 +  * <code lua> local radio1 = gui.RadioButton("radio1") </code> 
 + 
 +---- 
 + 
 +==== Add Callback ==== 
 + 
 +---- 
 + 
 +=== Description === 
 + 
 +Add a callback to be called whenever the user clicks on the button toggling it's checked state. 
 + 
 +=== Examples === 
 + 
 +  * <code lua> radio1:addCallback(function(toggled) message(tostring(toggled)) end) </code> 
 + 
 +---- 
 + 
 +==== Checked and Set Checked ==== 
 + 
 +---- 
 + 
 +=== Description === 
 + 
 +Used to get and the set the value of the radio button i.e. toggle the checked state of the radio button. 
 + 
 + 
 +=== Examples === 
 + 
 +  * <code lua> local val = radio1:checked() </code> 
 +  * <code lua> radio1:setChecked(false) </code> 
 + 
 +---- 
 + 
 +===== Checkbox GUI Class ===== 
 + 
 +---- 
 + 
 +[[https://github.com/LibreCAD/LibreCAD_3/blob/master/lcUI/widgets/guiAPI/checkboxgui.h|Github Link]] 
 +<code cpp-qt> namespace lc::ui::api </code> 
 + 
 +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.CheckBox("check1") </code> 
 + 
 +---- 
 + 
 +==== 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:addCallback(function(checked) message("Checkbox is checked - " .. tostring(checked)) end) </code> 
 + 
 +---- 
 + 
 +==== Set checked and Is checked ==== 
 + 
 +---- 
 + 
 +=== Description === 
 + 
 +Check if the checkbox is checked or set the checkbox to be checked/unchecked. 
 + 
 +=== Examples === 
 + 
 +  * <code lua> local isChecked = check1:checked() </code> 
 +  * <code lua> check1:setChecked(true) </code> 
 + 
 +---- 
 + 
 +===== ComboBox GUI Class ===== 
 + 
 +---- 
 + 
 +[[https://github.com/LibreCAD/LibreCAD_3/blob/master/lcUI/widgets/guiAPI/comboboxgui.h|Github Link]] 
 +<code cpp-qt> namespace lc::ui::api </code> 
 + 
 +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.ComboBox("combo1") </code> 
 + 
 +---- 
 + 
 +==== 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:addCallback(function(selected) message("Selected Element - " .. tostring(selected)) end) </code> 
 + 
 +---- 
 + 
 +==== 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:value() </code> 
 +  * <code lua> combo1:setValue("Element1") </code> 
 +  * <code lua> combo1:setValue(0) </code> 
 + 
 +---- 
 + 
 +==== 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:addItem("Element1", 2) </code> 
 +  * <code lua> combo1:addItem("Element2") </code>
  
 ---- ----
dev/v3/gui_api/dialog/inputgui1.1594271350.txt.gz · Last modified: 2020/07/09 05:09 by jedi18

Page Tools

  • Show page
  • Old revisions
  • Backlinks
  • Export to PDF
  • Rename Page
  • Back to top
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki