Meta Views

From VirindiPlugins
Jump to: navigation, search

Introduction

Meta views allow you to build command and control panels that can send actions via button click

To create a view you select the Create View meta action, set a name, and input XML

Writing the XML

To create a simple Meta View you will need to write the XML. It is advised to use notepad then copy/paste in to meta. Make sure WordWrap is disabled.

Meta Views have two controls called button and layout:

button has text, actionexpr, and setstate attributes

button and layout both have left, top, width, height, and name attributes


Sample XML for a 2 button view:

<?xml version="1.0"?>
<view width="300" height="200" title="Test View">
<control type="layout">
<control type="button" name="btnTest1" left="20" top="10" width="50" height="20" text="Button1" actionexpr="chatbox[\/vt echo Button1\!]" setstate="teststate1" />
<control type="button" name="btnTest2" left="20" top="40" width="50" height="20" text="Button2" actionexpr="chatbox[\/vt echo Hi there\!]" setstate="teststate2"/>
</control>
</view>

When copying your XML make sure there are no line breaks, otherwise it will not paste properly.

<?xml version="1.0"?><view width="300" height="200" title="Test View"><control type="layout"><control type="button" name="btnTest1" left="20" top="10" width="50" height="20" text="Button1" actionexpr="chatbox[\/vt echo Button1\!]" setstate="teststate1" /><control type="button" name="btnTest2" left="20" top="40" width="50" height="20" text="Button2" actionexpr="chatbox[\/vt echo Hi there\!]" setstate="teststate2"/></control></view>