import win.ui;
/*DSG{{*/
mainForm = win.form(text="zhushou";right=559;bottom=421)
mainForm.add(
edit={cls="edit";text="8";left=106;top=46;right=166;bottom=71;edge=1;num=1;z=4};
edit2={cls="edit";text="8";left=104;top=80;right=196;bottom=105;edge=1;num=1;z=6};
groupbox={cls="groupbox";text="设置区";left=14;top=8;right=544;bottom=335;edge=1;z=1};
plus={cls="plus";text="开始任务";left=27;top=351;right=139;bottom=391;bgcolor=8421376;color=16777215;font=LOGFONT(h=-14);z=2};
spin={cls="spin";left=174;top=82;right=194;bottom=102;z=7};
static={cls="static";text="窗口数:";left=36;top=49;right=95;bottom=71;center=1;transparent=1;z=3};
static3={cls="static";text="关机时间:";left=38;top=82;right=97;bottom=104;center=1;transparent=1;z=5}
)
/*}}*/
mainForm.spin.buddy = mainForm.edit2;
mainForm.spin.setRange(0,23); //一定要设置数值的上下限
mainForm.spin.pos = 0;//设置数值
mainForm.spin.inc = 1;//设置每次点击箭头的增减量(步长)
//处理spin事件
mainForm.spin.oncommand = function(id,event,pos){
if( pos && event == 0x4/*_SB_THUMBPOSITION*/ ){
mainForm.text = "spin" + mainForm.edit2.text
}
}
//处理spin事件通知,将要改变值之前触发
mainForm.spin.onnotify = function(id,code,ptr){
if(code==0xFFFFFD2E/*_UDN_DELTAPOS*/){
var nmUpDown = ..raw.convert(ptr, {
struct hdr = ::NMHDR();
int pos; //当前位置
int delta; //位置的增减量,单击向上箭头此值为负数
} );
}
}
//spin绑定的文本框事件
mainForm.edit2.oncommand = function(id,event){
if( event = 0x200/*_EN_KILLFOCUS*/ ){
mainForm.text = "spin" + mainForm.edit2.text
}
}
mainForm.show();
return win.loopMessage();