import win.ui;
/*DSG{{*/
var winform = win.form(text="菜单实例";right=759;bottom=469;bgcolor=15780518;max=false)
winform.add(
plus1={cls="plus";text="Button";left=31;top=31;right=137;bottom=83;z=1};
plus10={cls="plus";text="Button";left=626;top=110;right=732;bottom=162;z=10};
plus11={cls="plus";text="Button";left=31;top=189;right=137;bottom=241;z=11};
plus12={cls="plus";text="Button";left=180;top=189;right=286;bottom=241;z=12};
plus13={cls="plus";text="Button";left=329;top=189;right=435;bottom=241;z=13};
plus14={cls="plus";text="Button";left=477;top=189;right=583;bottom=241;z=14};
plus15={cls="plus";text="Button";left=626;top=189;right=732;bottom=241;z=15};
plus16={cls="plus";text="Button";left=31;top=268;right=137;bottom=320;z=16};
plus17={cls="plus";text="Button";left=180;top=268;right=286;bottom=320;z=17};
plus18={cls="plus";text="Button";left=329;top=268;right=435;bottom=320;z=18};
plus19={cls="plus";text="Button";left=477;top=268;right=583;bottom=320;z=19};
plus2={cls="plus";text="Button";left=180;top=31;right=286;bottom=83;z=2};
plus20={cls="plus";text="Button";left=626;top=268;right=732;bottom=320;z=20};
plus21={cls="plus";text="Button";left=31;top=347;right=137;bottom=399;z=21};
plus22={cls="plus";text="Button";left=180;top=347;right=286;bottom=399;z=22};
plus23={cls="plus";text="Button";left=329;top=347;right=435;bottom=399;z=23};
plus24={cls="plus";text="Button";left=477;top=347;right=583;bottom=399;z=24};
plus25={cls="plus";text="Button";left=626;top=347;right=732;bottom=399;z=25};
plus3={cls="plus";text="Button";left=329;top=31;right=435;bottom=83;z=3};
plus4={cls="plus";text="Button";left=477;top=31;right=583;bottom=83;z=4};
plus5={cls="plus";text="Button";left=626;top=31;right=732;bottom=83;z=5};
plus6={cls="plus";text="Button";left=31;top=110;right=137;bottom=162;z=6};
plus7={cls="plus";text="Button";left=180;top=110;right=286;bottom=162;z=7};
plus8={cls="plus";text="Button";left=329;top=110;right=435;bottom=162;z=8};
plus9={cls="plus";text="Button";left=477;top=110;right=583;bottom=162;z=9}
)
/*}}*/
//按钮菜单实例
import process;
import godking.message;
import win.ui.css;
var css =win.ui.css();
import thread;
winform_thmsg = function(){
thread.invoke(
function(winform){
import godking.message;
winform.msgInfo("正在打开 ... ",1000)
},winform
)
}
var menuTab = eval(string.load("C:\Users\Administrator\Desktop\config\menu.txt"));
var 按键数 =25;
for(i=1;按键数){
if menuTab.program[i] {
var prog = string.match(menuTab.program[i],".*\\(.*)");
if !#prog prog = menuTab.program[i];
winform["plus"+i].text = prog;
winform["plus"+i].oncommand= function(id,event){
var prog = null;
for i,v in table.eachIndex(menuTab.program){
if string.match(v,"@"++owner.text) {
prog =v;
break;
}
}
winform_thmsg();
var pid = process.execute(prog);
if !pid winform.msgInfo("文件不存在!")
}
winform["plus"+i].skin(css.primary);
css.hoverZoom( winform["plus"+i] ,1.3);
} else {
winform["plus"+i].text = " ";
winform["plus"+i].skin(css.danger);
}
}
//winform.plus3.background
winform.show();
win.loopMessage();