Menu

VCLua / Blog: Recent posts

VCLua V0.6.1 and VCLBuilder v1.0 released

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.

Posted by Janos Bali 2016-11-17

VCLua 0.6.0

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!

Posted by Janos Bali 2016-10-05

Small, dinamically generated GUI for Lua scripts

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

Posted by Janos Bali 2014-06-06

VCLua version 0.5.0 relased

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.

Posted by Janos Bali 2014-06-04

Event handling changes

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()

Posted by Janos Bali 2014-04-17 Labels: Event

XMLReader example in VCLua 0.5.x

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

Posted by Janos Bali 2014-04-10 Labels: XMLFormToLua TreeView LoadXML

Application skeleton

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

Posted by Janos Bali 2014-04-07 Labels: application menu toolbar actions

Using Component properties

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]",
            }
         }
Posted by Janos Bali 2014-04-07 Labels: form property font

Creating simple form / application

Simple VCLua form

require "vcl"
form = VCL.Form()
form:ShowModal()
Posted by Janos Bali 2014-04-07 Labels: form