User Tools

Site Tools


Sidebar

Introduction

* Home

Documentation & help

LibreCAD Community

Help on DokuWiki

Temporary shorcuts

dev:v3:gui_api:dialog:inputgui2

This is an old revision of the document!


Input GUI Widgets II


Coordinate GUI Class


Github Link

 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.


Constructor


Description

Constructs an Coordinate GUI widget.

Examples

  •  local coord1 = gui.CoordinateGUI("Coordinate1") 

Get and Set Values


Description

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.

Examples

  •  local point1 = coord1:value()
     lineBuilder:setLastPoint(point1) 
  •  coord1:setValue(lc.geo.Coordinate(24,52)) 

Add Finish Callback


Description

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.

Examples

  •  coord1:addFinishCallback(function() message("Finished entering coordinate") 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 coordinate input.

Examples

  •  coord1:addOnChangeCallback(function() message(tostring(coord1:value())) end) 

dev/v3/gui_api/dialog/inputgui2.1594276355.txt.gz · Last modified: 2020/07/09 06:32 by jedi18