Top | Previous | Next |
Using Templates |
Creating and using templates is very simple, and should be familiar to anyone who has designed Vision windows before. You should have the project you'd like to add a template to open in the Designer before you begin.
Creating a New Template To create a new Template, right-click on the Templates node of the Project Browser, or choose File > New > New Template from the Designer's menu bar. This will create a new template.
Once you create a template, it will open the template master for design in the window workspace. To rename your template, click on it in the Project Browser and hit F2, or change the name in the property editor.
Editing a Template You can open a template for editing by double-clicking on it in the project browser, or by double-clicking any instance of that template within a window. You design your template in the same way that you design windows: by adding components to it, and configuring those components using property bindings and scripting.
There are a few differences between templates and windows from an editing perspective. Templates, unlike windows, have a transparent background by default. This can be changed simply by editing the background color of the template. Templates also do not have the concept of a "Root Container" - the template itself acts like a container.
Creating a Template Instance Once you've made your template, you can use it on any of the windows in your project. You can drag the template from the project browser into an open window, or you can right-click on the template and choose the Use In Window option, which will allow you to place the window inside a window with an additional click. The template instance can then be moved and resized like any other component. |