配置读写
1 2 3 4 5 6 7 8
| import config;
if(config.zconfig.ieversion == null){ web.form.gpuRendering(true,11000); config.zconfig.ieversion = 11000; }else{ web.form.gpuRendering(true,config.zconfig.ieversion); }
|
语法
config.文件名.配置项名
打印调试
1 2 3 4 5 6
| var isDebug = false; if(isDebug){ io.open(); }
io.print("Flash是否可用:",true);
|
按钮
按钮点击事件
1 2 3
| winform.forward_btn.oncommand = function(id,event){ wb.goForward() }
|
文本框
文本框回车事件
1 2 3 4 5 6 7
| winform.url_tv.wndproc = function(hwnd,message,wParam,lParam){ if(message == 0x101 && wParam == 0xD){ var homepage = winform.url_tv.text; wb.go(homepage); } }
|
ComboBox
初始化值
1 2 3 4
| winform.combobox2.add("IE11强制"); winform.combobox2.add("IE11标准"); winform.combobox2.add("IE10强制"); winform.combobox2.add("IE10标准");
|
设置选中值
1
| winform.combobox2.text = "IE11强制";
|
设置选中项
1
| winform.combobox2.selIndex = 1;
|
注意
第一项的下标不是0是1。
组件的模式可以设置为dropdownlist,是我们常见的下拉,默认是下拉是可编辑的输入框。
事件
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| winform.combobox2.onListChange= function(){ if(owner.selText == "IE11标准"){
} if(owner.selText == "IE11强制"){
} if(owner.selText == "IE10标准"){
} if(owner.selText == "IE10强制"){
} }
|
批量添加事件
1 2 3 4 5 6 7 8 9
| winform.ridio = function(id,event){ if (owner.checked){
} } for(name,ctrl in winform.eachControl("radiobutton") ){ ctrl.oncommand = winform.ridio }
|
Plus组件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| winform.back_plus.skin( background={ default=0x00000000; hover=0x22000000; disabled=0x00000000; }
foreground={ default="/res/navi_back.png"; hover="/res/navi_back.png"; disabled="/res/navi_back2.png"; } )
winform.back_plus.oncommand = function(id,event){ wb.goBack() }
|