Difference between revisions of "Meta Views"

From VirindiPlugins
Jump to: navigation, search
(Created page with "= 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, se...")
 
 
Line 26: Line 26:
 
When copying your XML make sure there are no line breaks, otherwise it will not paste properly.
 
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="testy 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>
+
  <?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>

Latest revision as of 16:58, 10 December 2016

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>