lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> I don't think you can have runtime access to a control's list of properties
> (including events) to automate Lua binding when needed;

Yes you can, Object Inspector does that. But there are restrictions. The main 'stopper' is the number of params the function would need. It would be great if you only had one type of event ieg: TNotifyEvent which only receives one parameter: 'Sender'. That way you could have an automated VCL->Lua binding at runtime using the RTTI (Run Time Type Information)

> something should be made before compile time, e.g. a sort of specialized tolua to generate Lua
> bindings for all known controls.

Maybe we could start a 'PascalToLua' (not only Delphi, FreePascalCompiler should be supported too) project. My knowledge about RTTI is not as good as I would like, but we could make some research and try to find the best approach.
It would be nicer if we had specialized classes to handle within lua and 
not try to be Full-VCL-Compatible. Because while you are handling simple 
properties such as String, Integer, Float etc all works fine, but if you 
try to complicate it a little bit you will have to handle sets, enums and 
interfaces (Which is not a nice thing. Believe me).
At this point, I'm pondering about create a Pascal project like LuaCheia or 
LuaX or even a translation of the Lua to Pascal (which will be much easier 
to be done in FPC because of it's compatibly with C). But I don't know if 
the work will be worthy it. Specially because the synchronization with Lua 
changes (not so difficult using a diff tool).


Romulo