import win.ui;
/*DSG{{*/
var winform = win.form(text="Base64编码解码";right=759;bottom=469;parent=...)
winform.add(
button={cls="button";text='Base64编码\u2193';left=197;top=222;right=293;bottom=252;dt=1;z=3};
button2={cls="button";text='Base64解码\u2191';left=313;top=222;right=409;bottom=252;dt=1;z=4};
button3={cls="button";text='清空密文\u2193';left=465;top=222;right=561;bottom=252;dt=1;z=7};
button4={cls="button";text='清空明文\u2191';left=581;top=222;right=677;bottom=252;dt=1;z=8};
editA={cls="edit";text="这是测试文本";left=23;top=34;right=738;bottom=207;aw=1;dl=1;dr=1;dt=1;edge=1;multiline=1;z=1};
editB={cls="edit";left=24;top=271;right=739;bottom=444;ah=1;aw=1;db=1;dl=1;dr=1;dt=1;edge=1;multiline=1;z=2};
static={cls="static";text="原文本:";left=24;top=13;right=101;bottom=28;dl=1;dt=1;transparent=1;z=5};
static2={cls="static";text="编码后文本:";left=25;top=250;right=102;bottom=265;dl=1;dt=1;transparent=1;z=6}
)
/*}}*/

import crypt.bin;
winform.button.oncommand = function(id,event){
	//编码
	if(#winform.editA.text){
		winform.editB.text = crypt.bin.encodeBase64( winform.editA.text);
	}
}

winform.button2.oncommand = function(id,event){
	//解码
	if(#winform.editB.text){
		winform.editA.text = crypt.bin.decodeBase64(winform.editB.text);
	}
}

winform.button3.oncommand = function(id,event){
	winform.editB.text = "";
}

winform.button4.oncommand = function(id,event){
	winform.editA.text = "";
}

winform.enableDpiScaling();
winform.show();

win.loopMessage();
return winform;