Tools [examples]

You can extend the Lianja App Builder with your own or third party supplied tools.

The “Tools” menu in the Lianja App Builder system MenuBar contains custom tools that can extend Lianja’s functionality.

There is an example tool called “google_charts” in the lianja\tools directory.

This particular extension is only a few lines of code and allows you to interactively build URL’s that use Google charts which can be embedded into WebView sections. You can substitute data into the URL as you navigate data using { … } macros and the charts will change dynamically.

The lifecycle of a Tool

  • Create the tool in the scripting language of your choice in a directory with a unique name.
  • Create a tool.xml file to describe it in the same directory as the tool.
<?xml version="1.0"?>
<tool>
  <caption>Google Charts</caption>
  <icon>:/images/app</icon>
  <command>do main</command>
  <output>false</output>
  <loadatstartup>true</loadatstartup>
  <refreshfiles>false</refreshfiles>
  <extension>both</extension>
</tool>

In this example main.prg is a tool written in Lianja/VFP.

//
// Sample tools plugin for Lianja
//
myobj = createobject("webview")
myobj.url = "https://developers.google.com/chart/interactive/docs/gallery"
Lianja.addTool(myobj, "Google Charts")

https://www.lianja.com/doc/index.php/Tools_and_Extensibility


 

Advertisements