import fonts.fontAwesome;
import win.ui;
/*DSG{{*/
frmIconText = win.form(text="aardio工程2";right=1019;bottom=679;bgcolor=15793151;border="none")
frmIconText.add(
caption={cls="bkplus";text="aardio工程2";left=67;top=9;right=185;bottom=27;color=6052956;dl=1;dt=1;font=LOGFONT(h=-14);z=7};
custom={cls="custom";left=83;top=40;right=1022;bottom=679;bgcolor=16777215;db=1;dl=1;dr=1;dt=1;z=4};
logo={cls="bkplus";text='\uF0D1';left=35;top=7;right=64;bottom=32;color=6450008;dl=1;dt=1;font=LOGFONT(h=-18;name='FontAwesome');z=6};
nav1={cls="plus";text="首页";left=0;top=48;right=85;bottom=128;bkBottom=3;bkLeft=7;bkRight=8;bkTop=2;border={color=-65536};color=16777215;dl=1;dt=1;font=LOGFONT(name='FontAwesome');iconStyle={font=LOGFONT(h=-37;name='FontAwesome');padding={bottom=20}};iconText='\uF007';notify=1;textPadding={bottom=10};valign="bottom";x=0.5;y=0.2;z=3};
nav2={cls="plus";text="关于";left=0;top=129;right=85;bottom=209;bkBottom=3;bkLeft=7;bkRight=8;bkTop=2;border={color=-65536};color=16777215;dl=1;dt=1;font=LOGFONT(name='FontAwesome');iconStyle={font=LOGFONT(h=-37;name='FontAwesome');padding={bottom=20}};iconText='\uF086';notify=1;textPadding={bottom=10};valign="bottom";x=0.5;y=0.2;z=5};
navBar={cls="bkplus";left=0;top=37;right=83;bottom=681;bgcolor=4961168;db=1;dl=1;dt=1;z=1};
titleBar={cls="bkplus";left=0;top=0;right=1022;bottom=38;bgcolor=6318930;dl=1;dr=1;dt=1;forecolor=16777215;linearGradient=180;z=2}
)
/*}}*/

import win.ui.tabs;
var tbs = win.ui.tabs( 
	frmIconText.nav1,
	frmIconText.nav2,
);

tbs.skin({
	background={
		active=0xFFFFFFFF;
		default=0x00FFFFFF;
		hover=0x38FFFFFF
	};
	color={
		default=0xFFFFFFFF; 
	};
	checked={
		background={default=0xFFFFFFFF;};
		color={default=0xFF42A875;};
	}
})


tbs.add({
	text="反馈";
	iconText='\uF0E0';
})

import win.ui; 
var frmPage1 = win.form(text="纯文字界面示例";right=684;bottom=469;bgcolor=16777215;border="none";exmode="none";)
frmPage1.add(
btnSetLogoColor={cls="plus";text="定制窗口左上角图标颜色";left=11;top=410;right=170;bottom=448;db=1;dl=1;z=4};
btnSetNavColor={cls="plus";text="定制导航栏背景色";left=346;top=410;right=481;bottom=448;db=1;dl=1;z=1};
btnSetNavIconColor={cls="plus";text="定制导航图标颜色";left=499;top=410;right=636;bottom=448;db=1;dl=1;z=3};
btnSetTitleBarColor={cls="plus";text="定制标题栏背景色";left=188;top=410;right=328;bottom=448;db=1;dl=1;z=2}
)
import style.main;
for(hwnd,ctrl in frmPage1.eachControlEx("plus") ){
	ctrl.skin(style.main.button);
} 

frmPage1.show() 
tbs.loadForm(1,frmPage1); 

var templateConfig = {
	templateColor_logo_color = "6450008";
	templateColor_navBar_bgcolor = "4961168";
	templateColor_titleBar_bgcolor = "6318930";
	templateColor_navButton_color = "0xFF42A875";
}

import win.dlg.ctrlColor;
frmPage1.btnSetNavColor.oncommand = function(id,event){
    var argb = win.dlg.ctrlColor(frmIconText.navBar);
	templateConfig.templateColor_navBar_bgcolor = tostring(gdi.rgbReverse( argb )) 
}

frmPage1.btnSetTitleBarColor.oncommand = function(id,event){
    var argb = win.dlg.ctrlColor(frmIconText.titleBar)
	templateConfig.templateColor_titleBar_bgcolor = tostring(gdi.rgbReverse( argb )) 
}

frmPage1.btnSetLogoColor.oncommand = function(id,event){
    var argb =  win.dlg.ctrlColor(frmIconText.logo,"argbColor");
    templateConfig.templateColor_logo_color = tostring(gdi.rgbReverse(argb))  
}

frmPage1.btnSetNavIconColor.oncommand = function(id,event){
	import win.ui.ctrl.pick;
	var picker = win.ui.ctrl.pick(frmIconText);
	picker.setColor(tbs.selStrip.color) 
	
	picker.onColorChange = function(argb){
		templateConfig.templateColor_navButton_color = string.format("0x%08x", argb)  
		
		tbs.skin({
			background={
				active=0xFFFFFFFF;
				default=0x00FFFFFF;
				hover=0x38FFFFFF
			};
			color={
				default=0xFFFFFFFF; 
			};
			checked={
				background={default=0xFFFFFFFF;};
				color={default=argb;};
			}
		})
	}
	picker.doModal(frmIconText) 
}

tbs.selIndex = 1;
 
frmIconText.getTemplatePath = function(){
	return io.fullpath("/template/plus/icon/") 
}

frmIconText.getTemplateConfig = function(){
	return templateConfig 
}

frmIconText.enableDpiScaling();
frmIconText.show();

win.loopMessage();
return frmIconText;
