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.ShiftPosition - Move the slected 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.ShiftPosition (x,y) ;
result = lpav.ShiftPosition (x,y,x1,y1) ;

Description

Change the position of a graphical object on the Active View. The size of the object can also be changed with this function.

Remark

Graphical object coordinates can't be negative. X and Y coordinate are always attache to the uper left corner of the Active View drawing area.

Parameters

X - The horizontal shift in pixel from the current position to the new position
Y - The vertical shift in pixel from the current position to the new position

x1 - The horizontal size sift in pixel from the current size to the new size
y1 - The horizontal size sift in pixel from the current size to the new size

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_ANALOGIC_METER_01;

-- Créé des objects r s
k=0;
for i=0,20 do
lpav.Insert(10*i,1,9,9,zz);
lpav.SetBrush(0,255,0);
lpav.SetFontName("Mistral");
lpav.SetName(i);
lpav.SetClipart( lp.GetPath().."/card/vumeters/vumeter8.emf");
lpav.SetOption(LPAV_UNIT,"%");
if i==5 then lpav.ShiftPosition(0,20)
else
lpav.ShiftPosition(10,10*i);
end
end
lpav.RefreshMap();
lp_buffer ="ok";




www.loriotpro.com