使用MyGeneration创建模板:介绍(翻译)
原文信息
- 原文地址
- 原文作者信息:
- Justin Greenwood
- MyGeneration Software
- http://www.mygenerationsoftware.com
- April 26, 2004
系统需求:
- Microsoft Windows 2000/XP
- Microsoft .Net Framework 1.1/更高
- MDAC 2.7/更高
- MyGeneration
概观
这是一个使用 MyGeneration 开发模板的基本的介绍。如果你安装了 MyGeneration ,并且对 MyGeneration 感到迷惑的话,这里是一个很好的教你使用 MyGeneration 的教程。这个教程将教会你使用 MyGeneration 创建基本的 JScript 或 VBScript 的模板。
创建模板
- 打开 MyGeneration
- 从菜单中选择File->New->JScript Template或者File->New->VBScript Template
填充模板属性 - 你可以通过点击 Property 按钮查看或编辑模板的属性
按照如下的显示填充属性窗体

保存模板
- 选择File->Save As...保存模板
输入UI接口代码
通过切换到Interface Code的Tab页面,可以编辑接口代码。这里的接口代码在运行时,将会生成一个窗体,提示用户输入一个名称,而用户输入的名称将会替换掉“Hello World”中的World。
JScript
//In the interface code segment, the setup function
//is the initial function call.
function setup()
{
//Set the form title bar to say "Hello World!!"
ui.Title = "Hello World!!"; //Set the height and width of the form in pixels
ui.Height = 150;
ui.Width = 340; //Add a label and a textbox to the form.
ui.AddLabel("lblName", "Enter a Name:", "Enter a name below");
ui.AddTextBox("txtName", "World", "Enter a name in here"); //The number of times to repeat "Hellow World!!"
input.item("timesToRepeat") = 10; //Tells MyGeneration to display the form. If this is
//set to false. MyGeneration skips displaying the
//form, but retains any changes made in the interface
//code segment.
ui.ShowGUI = true;
}
VBScript
'In the interface code segment, the setup function
'is the initial function call.
Sub setup()
'Set the form title bar to say "Hello World!!"
ui.Title = "Hello World!!" 'Set the height and width of the form in pixels
ui.Height =
ui.Width = 'Add a label and a textbox to the form.
ui.AddLabel "lblName", "Enter a Name:", "Enter a name below"
ui.AddTextBox "txtName", "World", "Enter a name in here" 'The number of times to repeat "Hellow World!!"
input.item("timesToRepeat") =
'Tells MyGeneration to display the form. If this is
'set to false. MyGeneration skips displaying the
'form, but retains any changes made in the interface
'code segment.
ui.ShowGUI = true
End Sub
测试UI接口
如果你想测试一下前面输入的内容的结果,你就需要执行模板。点击工具栏的Execute按钮(绿色的播放按钮),你将看到如下的结果

输入模板代码
通过切换到Template Code Tab页,可以查看和编辑模板代码。如下的代码将生成一个显示10各Hello Name!!!的HTML页面。
JScript
<html>
<body>
<% for (var i = 0; i < input.item("timesToRepeat"); i++) { %>
<br>Hello <%= input.item("txtName") %>!!
<% } %>
</body>
</html>
VBScript
<html>
<body>
<% For i = to input.item("timesToRepeat") %>
<br>Hello <%= input.item("txtName") %>!!
<% Next %>
</body>
</html>
执行完成的模板
- 执行模板之前,保存模板
- 点击执行按钮,执行后的结果如下:
<html>
<body>
<br>Hello World!!
<br>Hello World!!
<br>Hello World!!
<br>Hello World!!
<br>Hello World!!
<br>Hello World!!
<br>Hello World!!
<br>Hello World!!
<br>Hello World!!
<br>Hello World!!
</body>
</html>
结束语
希望通过这个教程,你看到了 MyGeneration 通过你的指尖在键盘上的敲打而显现的强大的力量。当你开始熟悉 MyGeneration 之后,我建议你做如下的事情:
- 查看安装 MyGeneration 时附带的模板,我从哪儿学到了很多;
- 研究 Zeus 的API文档以及 MyMeta ;
- 思考一下,在你的工作中哪些需要使用 MyGeneration ,发现这些,你将会吃惊的发现,以前很多耗时的工作, MyGeneration 会使它们变得轻而易举。
使用MyGeneration创建模板:介绍(翻译)的更多相关文章
- Aurelia 创建模板
今天介绍一下Aurelia创建模板的三种方式. 模板既可以作为页面也可以作为组件. 1. View+View Model Aurelia的模板通常由一个html文件和一个同名的ts或js文件组成,文件 ...
- Sitecore CMS中创建模板
如何在Sitecore CMS中创建模板. 在/sitecore/templates选择应创建模板的文件夹中. 注意:在多站点项目中,通常会在模板所属的网站名称的/sitecore/templates ...
- Django项目的创建与介绍.应用的创建与介绍.启动项目.pycharm创建启动项目.生命周期.三件套.静态文件.请求及数据.配置Mysql完成数据迁移.单表ORM记录的增删改查
一.Django项目的创建与介绍 ''' 安装Django #在cmd中输入pip3 #出现这个错误Fatal error in launcher: Unable to create process ...
- LATEX学习和IEEE Tran模板介绍
目录 软件的选择 IEEE 模板下载 模板正文 图 表格 公式 算法 参考文献 Latex学习网站:http://www.latexstudio.net/page/tex-documents/ IEE ...
- Orchard之创建模板
orchard创建模板的两种基本方式: 第一种:通过候补创建(需要用到候补神器): 第二种:通过Shape Tracing创建:
- Django创建模板、URL模式、创建视图函数
1.在应用目录下创建模板(templates目录) 在模板目录下创建archive.html <!DOCTYPE html> <html lang="en"> ...
- 36.创建模板mylist
node.h #pragma once //创建模板 template <class T> class Node { public: T t;//数据 Node *pNext;//指针域 ...
- 使用powercli创建模板与克隆虚机
用powercli练练手,需从实际案例出发,本节将使用powercli写两个demo,一个是创建模板,并根据模板创建新的虚机:另一个demo是克隆虚机. [注意] 1.创建模板与克隆操作只能在vcen ...
- [人工智能]IBM Watson人工智能API|一步步创建智能微信翻译官|第一章
最近参加了IBM可认知内部创业活动,想从零创建一个微信翻译工具,这就是我的AI翻译官.
随机推荐
- SCP对拷如何连接指定端口远程主机
SCP对拷如何连接指定端口(非22端口)的远程主机 scp -P 远程端口号 本机待拷贝文件路径 远程主机用户名@远程主机地址:远程主机目的路径 注意: 1. 参数-P 的位置一定要紧跟在s ...
- Head First Servlets & JSP 学习笔记 第五章 —— 作为Web应用
初始化参数:(init-param) 初始化参数写在web.xml文件中:(写在<servlet>标签内部) <servlet> <servlet-name>Bee ...
- maven library has broken path和pom jar包导入失败
今天在打开项目的时候,在pom文件添加新的依赖文件发现很多jar都标红,显示不存在,自己查了一上午各种尝试,总结了以下的解决方法. 首先你打开File-Project Structrue-Module ...
- c# 24种设计模式
备忘录模式(Memento Pattern) 策略模式(Strategy Pattern) 抽象工厂模式(Abstract Factory Pattern) 代理模式(Proxy Pattern) 单 ...
- c# sharpsvn 客户端开发测试
1:没有工作副本,上传时会报错的. 会提示本地目录不是not a working copy 而此中文名称就是工作副本, 本地要与svn服务器公用的一个文件夹. 所以每次要checkout 然后才能 ...
- Eclipse中logcat过滤器的使用
logcat里信息繁多,用过滤器可以方便快捷的找到我们要查找的信息. 我们可以在打开Eclipse之后,选择Window –> Show View ->Other菜单,然后在Android ...
- (转)关于X64位系统IIS7下支持32位asp.net程序
最近在windows2008 x64位系统下的IIS7下部署asp.net程序. vs2005或vs2008默认的情况下是Any cpu 的也就是支持x86和x64两种系统的.可我的程序在引用了一个三 ...
- linux内核中hlist_head和hlist_node结构解析
hlist_head和hlist_node用于散列表,分表表示列表头(数组中的一项)和列表头所在双向链表中的某项,两者结构如下: 1 2 3 struct hlist_head { struct hl ...
- 探索未知种族之osg类生物---呼吸分解之事件循环二
VPM矩阵 1.V 表示摄像机的观察矩阵(View Matrix),它的作用是把对象从世界坐标系变换到摄像机坐标系.因此,对于世界坐标系下的坐标值 worldCoord(x0, y0, z0),如果希 ...
- 比较两个List列表,取得List中不同项返回
/// <summary> /// 比对模型及属性数组 /// </summary> /// <typeparam name="TM">< ...