Type | Description | |||
DefaultTemplate as Variant | A String expression that defines the properties/methods to be generated. If missing, the control's automatically generates code for all properties. | |||
String | A String expression that indicates the x--script code. |
Here's how the x-script generated could look as:
Font { Size = 7.8 } ShortcutKeyPadding = "3,0,3,0" Items { Add("",2,10) { EditWidth = 40 GroupPopup = 3 Items { Add("Item <br><c><b>1",0,20) { EditWidth = 40 } Add("Item <br><c><b>2",0,30) { EditWidth = 40 } Add("Item <br><c><b>3",0,40) { EditWidth = 40 } } } } Refresh()
for toolbar control such as:
Most of our UI components provide a Template page that's accessible in design mode. No matter what programming language you are using, you can have a quick view of the component's features using the WYSWYG Template editor.
The control's Template page helps user to initialize the control's look and feel in design mode, using the x-script language that's easy and powerful. The Template page displays the control on the left side of the page. On the right side of the Template page, a simple editor is displayed where user writes the initialization code. The control's look and feel is automatically updated as soon as the user types new instructions. The Template script is saved to the container persistence ( when Apply button is pressed ), and it is executed when the control is initialized at runtime. Any component that provides a WYSWYG Template page, provides a Template property. The Template property executes code from a string ( template string ).
The Template or x-script is composed by lines of instructions. Instructions are separated by "\n\r" ( newline characters ) or ";" character. The ; character may be available only for newer versions of the components.
An x-script instruction/line can be one of the following:
The x-script may uses constant expressions as follow:
Also , the template or x-script code may support general functions as follows: