See CHANGES for detailed list of changes and new features
VCLBuilder a small GUI tool writtem in Lua which helps you to build quickly a form and convert it to lua script.
DragAndDrop, PropertyEditor, EventEditor, and many more features...
You can find VCLBuilder at the 'vclbuilder' folder.
J.
Version 0.6.0 released...
Works like a charm on Raspberry Pi 3!
Now supports Lua 5.3 (5.1 and 5.2)
Compiled with latest Lazarus 1.6 with FPC 3.0
Enjoy!
Here is a small application, which dynamically builds a form for the script parameter inputs.
The script should contain the input fields description.
The script location is the ./scripts folder (see FileListBox1.Directory property)
~~~~~~
:::lua
-- SAMPLE SCRIPT
-- vcltype; label; valueproperty; [defaultvalue]; [length]; [listitems]
-- space required for empty param value!
-- @ARGS
-- Edit;Text parameter;text; ;100
-- FileNameEdit;Output filename;filename;deafult.txt;260
-- DateEdit;From date;text; ;100
-- CheckBox;Click this;checked; ;true
-- ComboBox;Resolution;text; ;100;low|medium|high
-- @ENDARGS... read more
Version 0.5.0 finally released...
Don't forget to read the docs; many changes in new version!
Please share with me your experiences with the new version...
thanks, j.
The component event function earlier stored as string property but from 0.5.0 version this feature changed to lua_CFunction.
But be careful with the new feature be sure the function was defined before referenced!
~~~~~~~~~~~~
require "vcl"
form = VCL.Form()
form._ = {
caption="Event Test", onClick=function(s) VCL.ShowMessage(s.name) end
}
form:ShowModal()
Lazarus has some interesting examples, one of this is the XMLReader.
But who wants waste time to make gui forms with script language? Much easier to make it with a standard formdesigner and just load it on runtime...
-Use "Save Form as XML" option in Lazarus Ide on a form.
-Check the XML, remove any 'binary' tags. ( yes, this is a bug in lazarus ide )
-Finally write your lua script in 5 mins. or less... read more
Here is a basic app skeleton with menus, actions, toolbars etc.
~~~~~~~~~~~~~~~~~~~~~
-- VCLua Demo Application
-- ******
-- VCLua 0.4.3 application
-- Lua version 5.2.x required
-- Copyright (C) 2014 Hi-Project Ltd.
-- ******
_VCLUA_NAME = "VCLua Demo Application"
_VCLUA_VERSION = "1.0"
_VCLUA_APPID = "demo"
package.cpath=package.cpath..";lib/?.dll;lib/?.so"... read more
Component properties can be managed in two basic ways
require "vcl"
form = VCL.Form()
-- single property
form.width=200
-- modify multiple properties with lua table
form._ = {name="TestForm", caption="Simple Form for Testing", left=100, top=100}
The table of properties allows to use subtables too
form._ = { name="TestForm",
caption="Simple Form for Testing",
left=100,
top=100,
font = {
color = 0,
size = 12,
style = "[fsBold, fsItalic]",
}
}
Simple VCLua form
require "vcl"
form = VCL.Form()
form:ShowModal()