User Tools

Site Tools


Sidebar

Introduction

* Home

Documentation & help

LibreCAD Community

Help on DokuWiki

Temporary shorcuts

dev:v3:gui_api:dialog:inputgui3

Input GUI Widgets III


Text GUI Class


Github Link

 namespace lc::ui::api 

The Text GUI widget allows the user to enter data in a text format.


Constructor


Description

Constructs an Text GUI widget.

Examples

  •  local text1 = gui.Text("Text1") 

Get and Set Values


Description

Used to get and set the desired value for the text widget. Data of type string is returned.

Examples

  •  local textval = text1:value() 
  •  text1:setValue("SomeText") 

Add Finish Callback


Description

Add a finish callback which is called when the user presses enter after entering the text or clicks somewhere else and the input gui loses focus. This is different from the dialog widget finish callback.

Examples

  •  text1:addFinishCallback(function() message("Finished entering text") end) 

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 text input.

Examples

  •  text1:addOnChangeCallback(function(newtext) message(tostring(newtext)) end) 

Color Picker GUI Class


Github Link

 namespace lc::ui::api 

The Color Picker GUI widget allows the user to enter color data by choosing it visually.


Constructor


Description

Constructs a Color GUI widget.

Examples

  •  local color1 = gui.Color("Color1") 

Get and Set Values


Description

Used to get and set the desired value for the color widget. Data of type lc::Color is returned. setValue expects a lc::Color as parameter.

Examples

  •  local col = color1:value() 
  •  color1:setValue(lc.Color(1,1,1)) 

Add Callback


Description

Adds a callback which is called whenever a color is selected in the color gui widget.

Examples

  •  color1:addCallback(function(col) message("Color picked") end) 

Horizontal Group GUI Class


Github Link

 namespace lc::ui::api 

The Horizontal Group GUI widget allows the user to store the input gui widgets in a horizontal layout.


Constructor


Description

Constructs a Horizontal Group GUi widget. The input gui widgets in the group are added to the final value table but not the horizontal group.

Examples

  •  local horiz1 = gui.HorizontalGroup("Horizontal1") 

Add Input GUI Widget


Description

Add an Input GUI widget to the horizontal group. Expects a key and gui widget as parameters.

Examples

  •  local angle1 = gui.Angle("Angle1") 
     horiz1:addWidget("angle1", angle1) 

RadioButton Group GUI Class


Github Link

 namespace lc::ui::api 

The RadioButton Group GUI widget allows the user to store the radio buttons in a group so that only one radio button can be selected in the group.


Constructor


Description

Constructs a RadioButton Group GUI class.

Examples

  •  local radiogroup1 = gui.RadioGroup("RadioGroup1") 

Add Radio Button


Description

Add an RadioButton GUI widget to the radio group. Expects a key and radiobutton as parameters.

Examples

  •  local radio1 = gui.RadioButton("Radio1") 
     radiogroup1:addButton("radio1", radio1) 

dev/v3/gui_api/dialog/inputgui3.txt · Last modified: 2020/07/10 03:49 by jedi18