//AAuto控件演示
//AAuto界面演示//演示基本控件

/************************************
Author		: ECranesoft Lab
Time		: March 17, 2010
Version		: V1.0.0.01
Description : This demonstrated the AAuto UI.
************************************/


import win.ui; 
import win.ui.menu;
import win.ole.image;
/*DSG{{*/
var winform = win.form(parent=...; bgcolor=15919331;bottom=441;text="AAuto Form";left=0;title="AAuto Form";exmode="";min=1;style=0;right=535;top=0;cls="AFORM" )
winform.add( 
picturebox2={ bgcolor=10921638;bottom=398;color=0;text="picturebox2";left=0;top=397;acceptfiles=1;tabstop=1;z=0;right=536;cls="picturebox" };
progress={ bgcolor=14215660;z=1;color=0;right=475;left=57;cls="progress";bottom=310;max=100;text="progress";top=290;acceptfiles=1;transparent=1;min=0;edge=1;tabstop=1 };
button3={ cls="button";bgcolor=14215660;bottom=431;color=0;text="<上一步(&B)";left=286;multiline=1;top=409;acceptfiles=1;transparent=1;z=2;right=360;tabstop=1;hide=1 };
button5={ cls="button";bgcolor=14215660;bottom=430;color=0;text="取消(&C)";left=452;multiline=1;top=409;acceptfiles=1;transparent=1;z=3;right=519;tabstop=1;hide=1 };
static1={ transparent=1;bgcolor=14215660;notify=1;color=16711680;right=182;left=20;bottom=429;top=413;acceptfiles=1;tabstop=1;text="http://www.ecranesoft.com";z=4;cls="static" };
groupbox2={ hide=1;bgcolor=15919331;bottom=383;color=0;text="操作";left=290;right=507;top=76;acceptfiles=1;tabstop=1;z=5;transparent=1;edge=1;cls="groupbox" };
button={ cls="button";bgcolor=14215660;bottom=189;color=0;text="添加一项(ADD)";left=340;multiline=1;top=158;acceptfiles=1;transparent=1;z=6;right=446;tabstop=1;hide=1 };
picturebox={ transparent=1;bgcolor=14215660;bottom=76;color=0;text="picturebox";left=-1;right=533;top=0;image=$"\.res\logo.bmp";acceptfiles=1;z=7;tabstop=1;cls="picturebox" };
groupbox={ hide=1;bgcolor=15919331;bottom=386;color=0;text="显示数据";left=22;right=262;top=76;acceptfiles=1;tabstop=1;z=8;transparent=1;edge=1;cls="groupbox" };
combobox={ bgcolor=14215660;color=0;right=236;left=50;mode="dropdown";hide=1;
items={  };bottom=346;text="combobox";cls="combobox";top=326;acceptfiles=1;z=9;tabstop=1;edge=1;transparent=1 };
button2={ cls="button";bgcolor=14215660;bottom=263;color=0;text="删除(DEL)";left=340;multiline=1;top=232;acceptfiles=1;transparent=1;z=10;right=446;tabstop=1;hide=1 };
edit={ bgcolor=16777215;bottom=128;color=0;text="请输入内容...";left=314;right=481;top=106;acceptfiles=1;z=11;tabstop=1;cls="edit";edge=1;hide=1 };
static={ bgcolor=14215660;bottom=113;color=255;text="快手AAuto:";left=25;tabstop=1;top=71;acceptfiles=1;transparent=1;right=155;z=12;cls="static" };
static2={ bgcolor=14215660;bottom=180;color=0;text="    是由一鹤软件耗时四年开发新一代编程语言。完美支持静态类型、动态类型，完美支持COM、DLL API、REMOTE EXE CALL API。主要面向小型轻量快速开发应用，专用于模拟自动化、web自动化、自动化测试、机器人程序开发。";left=42;tabstop=1;top=106;acceptfiles=1;transparent=1;right=482;z=13;cls="static" };
button6={ cls="button";bgcolor=14215660;bottom=342;color=0;text="清空全部";left=340;multiline=1;top=311;acceptfiles=1;transparent=1;z=14;right=446;tabstop=1;hide=1 };
static5={ bgcolor=14215660;bottom=281;color=0;right=320;left=107;z=15;top=260;acceptfiles=1;transparent=1;text="";tabstop=1;cls="static" };
static4={ bgcolor=14215660;bottom=282;color=0;text="路径：";left=69;tabstop=1;top=261;acceptfiles=1;transparent=1;right=105;z=16;cls="static" };
static3={ bgcolor=14215660;bottom=269;color=0;text="安装路径";left=67;tabstop=1;top=239;acceptfiles=1;transparent=1;right=163;z=17;cls="static" };
groupbox3={ bgcolor=15919331;bottom=364;color=0;right=497;left=31;top=196;acceptfiles=1;z=18;text="安装演示";tabstop=1;edge=1;cls="groupbox" };
button4={ tabstop=1;bgcolor=14215660;bottom=431;color=0;right=440;left=366;multiline=1;top=409;acceptfiles=1;transparent=1;text="开始(&B)";z=19;cls="button" };
listbox={ bgcolor=16777215;vscroll=1;color=0;right=240;left=54;hide=1;bottom=280;text="listbox";cls="listbox";top=97;acceptfiles=1;tabstop=1;
items={  };hscroll=1;edge=1;z=20 }
)
/*}}*/

path = io.splitpath(owner)
winform.button5.image = path.dir + ".res\button.jpg";

winform.picturebox.image = path.dir + ".res\logo.bmp";
winform.redraw();
winform.combobox.selectIndex = 0;



winform.static1.oncommand = function(id,event){
	import process;
	::ShellExecute(0, "", "http://www.ecranesoft.com/bbs", "", "", 0)
	//无返回值则继续调用默认回调函数
}//endproc

winform.button6.oncommand = function(id,event){
	//win.msgbox( winform.button6.text );
	winform.listbox.clear();
	winform.combobox.clear();
	//无返回值则继续调用默认回调函数
}//endproc

winform.button2.oncommand = function(id,event){
	//win.msgbox( winform.button2.text );
	winform.listbox.delete();
	winform.combobox.delete();
	//无返回值则继续调用默认回调函数
}//endproc
winform.button.oncommand = function(id,event){
	//win.msgbox( winform.button.text );
	var str = winform.edit.text;
	winform.listbox.add ( str );
	winform.combobox.add( str );
	winform.combobox.setsel( str );
	//无返回值则继续调用默认回调函数
}//endproc

winform.button3.oncommand = function(id,event){
	//win.msgbox( winform.button3.text );
	winform.button4.text = "开始(&B)>"
	winform.groupbox3.hide=false;
	winform.static4.hide=false;
	winform.static3.hide=false;
	winform.static2.hide=false;
	winform.static1.hide=false;
	winform.static5.hide=false;
	winform.button3.hide=1;
	winform.button5.hide=1;
	winform.button2.hide=1;
	winform.button6.hide=1;
	winform.button.hide=1;
	winform.combobox.hide=1;
	winform.groupbox2.hide=1;
	winform.groupbox.hide=1;
	winform.listbox.hide=1;
	winform.static.hide=false;
	winform.edit.hide=1;
	winform.button4.disabled = false;
	winform.redraw();
	//无返回值则继续调用默认回调函数
}//endproc
winform.button5.oncommand = function(id,event){
	//win.msgbox( winform.button5.text ); 
	if ( (win.msgboxTest("安装还未完成，您确定要退出程序吗？","AAuto界面控件演示" )) == 1)
	winform.close();
	//无返回值则继续调用默认回调函数
}//endproc

winform.button4.oncommand = function(id,event){
	//win.msgbox( winform.button4.text );
	winform.button4.text = "等待...";
	winform.static5.text = "D:\ECranesoft\...";
	winform.progress.hide=false;//显示进度条
	for(i=1;20;1){ //循还从1到10
		winform.static5.text = ""
	    winform.progress.pos += 5 ;//增加进度
	    win.delay(200);
	    winform.static5.text = "D:\ECranesoft\AAuto Studio\Bin...";
	}
	
	winform.static5.text = "完成！";
	win.delay(500);
	 
	winform.static5.text = "";
	winform.progress.pos = 0;
	winform.groupbox3.hide=1;
	winform.static4.hide=1;
	winform.static3.hide=1;
	winform.static2.hide=1;
	winform.static5.hide=1;
	winform.progress.hide=1;
	winform.button4.text = "下一步(&N)>"
	winform.button3.hide=false;
	winform.button5.hide=false;
	winform.button2.hide=false;
	winform.button6.hide=false;
	winform.button.hide=false;
	winform.combobox.hide=false;
	winform.groupbox2.hide=false;
	winform.groupbox.hide=false;
	winform.listbox.hide=false;
	winform.edit.hide=false;
	winform.static.hide=1;
	winform.button4.disabled = true;
	 
	//无返回值则继续调用默认回调函数
}//endproc
winform.show(true) 
win.loopMessage( winform );
