LUALoriotPro WEB site

LoriotPro scripting documentation
Extensions for LUA language

Table of contents Search function

Print the current page Mail this  link UTUBE Channel version française

lpav.SetBrush - Change the background color of the selected object

LoriotPro has extended the LUA sripting language by providing its own LUA libraries. The new functions provided are dedicated to the creation of monitoring and SNMP automation application.

Syntax

result=lpav.SetBrush(r,g,b);

Description

Change the background color of the default (selected) object.

Remark

The background color of dynamic objects is controled by the graphical object filters configuration of this object.

Parameters

r - The red component (0 – 255)
g - The green component (0 – 255)
b - The blue component (0 – 255)

Use the Color Picker to get a color set for your script.

Return Values

result=1 if ok, nil if error

Example

lp_value = 0;
lp_buffer ="error";

dofile(lp.GetPath().."/config/script/loriotinit.lua");

zz=LPAV_OBJ_FILL_RECT;

-- Créé des objects r s
k=0;
for i=0,20 do
lpav.Insert(10*i,1,9,9,zz);
if (k==0) then lpav.SetRef(1,"r"); k=1; else lpav.SetRef(1,"s"); k=0; end
lpav.SetBrush(0,i*5,i*10);
lpav.SetFontName("courrier");
lpav.SetName(i);
end

lp.Trace("fin");
lpav.RefreshMap();





www.loriotpro.com