namespace lc::ui::api
The Coordinate GUI widget allows the user to select a coordinate either by selecting the point using the mouse or by entering the coordinate into the widget. Clicking on the select point button allows the user to select a point using the mouse.
Constructs an Coordinate GUI widget.
local coord1 = gui.Coordinate("Coordinate1")
Used to get the current value of the coordinate widget or set it to a desired value. A lc::geo::Coordinate object is returned/expected by the widget.
local point1 = coord1:value() lineBuilder:setLastPoint(point1)
coord1:setValue(lc.geo.Coordinate(24,52))
Add a finish callback which is called when the user presses enter after entering the coordiante or clicks somewhere else and the input gui loses focus. This is different from the dialog widget finish callback.
coord1:addFinishCallback(function() message("Finished entering coordinate") end)
Add an on change callback which is called when the user types anything i.e. on any change to the coordinate input.
coord1:addOnChangeCallback(function() message(tostring(coord1:value())) end)
namespace lc::ui::api
The entity picker gui widget allows the user to select an entity by dragging their mouse and selecting the required entities which are then added to the entity list. Selecting an entity from the list highlights it in the cadmdichild so the user can see which entity it refers to.
Constructs an Entity Picker GUI widget.
local entity1 = gui.EntityPicker("Entity1")
Get a list of all the entity selected using the entity picker widget. It returns a list of cadentity shared pointers.
local entities = entity1:value()
An entity list is passed in as a parameter and all these entities are added to the list (unless entity is already added to the list).
entity1:setValue(entitiesList)
Add callback for when an entity is selected in the entity list.
entity1:addCallback(function(selectedEntity) message("An entity has been selected in the list") end)
Add an entity to the entity list.
entity1:addEntity(lineEntity)
Constructs a Number GUI widget.
local number1 = gui.Number("Number1")
Gets the value of the number widget.
local val = number1:value()
Sets the number widget value.
number1:setValue(2.4)
Add callback for when the number is changed
number1:addCallback(function(num) message(tostring(num)) end)
namespace lc::ui::api
The slider gui widget is used for values that could use a slider input.
Constructs a Slider GUI Widget.
local slider1 = gui.Slider("Slider1")
Gets the value of the slider widget. Returns a double value.
local val = slider1:value()
Sets the slider widget value. Expects a double parameter.
slider1:setValue(2.4)
Add callback for when the slider value is changed.
slider1:addCallback(function(num) message(tostring(num)) end)