import win.ui; /*DSG{{*/ mainForm = win.form(text="Ovplayer播放器";right=1145;bottom=686;bgcolor=4208437;border="none") mainForm.add( closeButton={cls="plus";left=1106;top=13;right=1131;bottom=38;background="\res\Images\sys_close.png";dr=1;dt=1;notify=1;repeat="repeat-x";z=9}; custom={cls="custom";text="custom";left=0;top=50;right=1146;bottom=687;ah=1;aw=1;bgcolor=8421376;db=1;dl=1;dr=1;dt=1;z=12}; maxButton={cls="plus";left=1076;top=13;right=1101;bottom=38;background="\res\Images\sys_max.png";dr=1;dt=1;notify=1;repeat="repeat-x";z=8}; minButton={cls="plus";left=1046;top=13;right=1071;bottom=38;background="\res\Images\sys_min.png";dr=1;dt=1;notify=1;repeat="repeat-x";z=7}; modelPlus1={cls="plus";text="播放器";left=148;top=1;right=284;bottom=50;background="\res\Images\sys_tab_bkg.png";clipBk=false;color=12632256;dl=1;dt=1;font=LOGFONT(name='微软雅黑';h=-16);notify=1;repeat="repeat-x";z=2}; modelPlus2={cls="plus";text="影视库";left=284;top=1;right=420;bottom=50;background="\res\Images\sys_tab_bkg.png";clipBk=false;color=12632256;dl=1;dt=1;font=LOGFONT(name='微软雅黑';h=-16);notify=1;repeat="repeat-x";z=4}; plus={cls="plus";left=1007;top=0;right=1009;bottom=51;background="\res\Images\sys_split.png";clipBk=false;dr=1;dt=1;repeat="center";z=5}; plus2={cls="plus";left=0;top=0;right=140;bottom=51;background="\res\Images\logo.png";clipBk=false;dl=1;dt=1;repeat="center";z=1}; plus4={cls="plus";left=144;top=0;right=146;bottom=51;background="\res\Images\sys_split.png";clipBk=false;dl=1;dt=1;repeat="center";z=3}; searchButton={cls="plus";left=950;top=12;right=979;bottom=41;background="\res\Images\sys_search.png";clipBk=false;dr=1;dt=1;notify=1;repeat="repeat-x";transparent=1;z=11}; searchText={cls="plus";text="足球小将翼";left=776;top=13;right=980;bottom=42;align="left";background="\res\Images\sys_input.png";bkBottom=4;bkLeft=13;bkRight=32;bkTop=3;clipBk=false;color=12632256;dr=1;dt=1;editable=1;font=LOGFONT(name='微软雅黑');paddingLeft=17;paddingRight=33;paddingTop=7;transparent=1;z=10}; setButton={cls="plus";left=1016;top=13;right=1041;bottom=38;background="\res\Images\sys_setting.png";dr=1;dt=1;notify=1;repeat="repeat-x";z=6} ) /*}}*/
import gdip.bitmap; import win.ui.tabs;
/*顶部左侧导航皮肤{{*/ //至少要添加2个创建好的选项卡(作为设计模板,创建成功后可清除) var tbs = win.ui.tabs(mainForm.modelPlus1,mainForm.modelPlus2); //指定选项卡的外观样式 tbs.skin( background = { //这里上下顺序很重要,切记! //focus = gdip.bitmap("\res\Images\sys_tab_bkg.png").clone(136*2,0,136,48); hover = gdip.bitmap("\res\Images\sys_tab_bkg.png").clone(136,0,136,48); active = gdip.bitmap("\res\Images\sys_tab_bkg.png").clone(136*2,0,136,48); default = gdip.bitmap("\res\Images\sys_tab_bkg.png").clone(0,0,136,48); //disabled = gdip.bitmap("/res/images/btn-hover.png").clone(0,137*3,137,48); }; color = { default = 0xFFc0c0c0; hover = 0xFF06c9a9; active = 0xFF06c9a9; } checked = { background = { //这里上下顺序很重要,切记! default设置默认选中样式 //focus = gdip.bitmap("\res\Images\sys_tab_bkg.png").clone(136*2,0,136,48); hover = gdip.bitmap("\res\Images\sys_tab_bkg.png").clone(136*2,0,136,48); active = gdip.bitmap("\res\Images\sys_tab_bkg.png").clone(136*2,0,136,48); default = gdip.bitmap("\res\Images\sys_tab_bkg.png").clone(136*2,0,136,48); //disabled = gdip.bitmap("/res/images/btn-hover.png").clone(0,137*3,137,48); }; color = { default = 0xFF06c9a9; hover = 0xFF06c9a9; active = 0xFF06c9a9; } } ) tbs.add({ text="看动漫"; hasCloseButton = true; },"\其他窗口\shipinku.aardio" ) //也可以用下面的代码自定义关闭按钮的外观样式 tbs.closeButton.skin( background = { hover = 0xFFe35c51; active = 0xFF8f241b; default = 0x99FFCC66; } color = { hover = 0xFFFFFFFF; active = 0xFFEEEEEE; default = 0xCCFFFFFF; } ) //可以自定义关闭按钮在选项卡上的显示位 tbs.beforeShowCloseButton = function(strip,rcStrip,rcCloseButton){ return rcStrip.right - 15, rcStrip.top; } //给模版项添加加载的窗体 tbs.loadForm(1,"\其他窗口\player.aardio"); tbs.loadForm(2,"\其他窗口\shipinku.aardio");
//默认选中 tbs.selIndex = 1; /*}}*/ /*顶部右侧皮肤{{*/ var setButtonSkin = { background = { hover = gdip.bitmap("\res\Images\sys_setting.png").clone(25,0,25,25); active = gdip.bitmap("\res\Images\sys_setting.png").clone(25,0,25,25); default = gdip.bitmap("\res\Images\sys_setting.png").clone(0,0,25,25); }; } var minButtonSkin = { background = { hover = gdip.bitmap("\res\Images\sys_min.png").clone(25,0,25,25); active = gdip.bitmap("\res\Images\sys_min.png").clone(25,0,25,25); default = gdip.bitmap("\res\Images\sys_min.png").clone(0,0,25,25); }; } var maxButtonSkin = { background = { hover = gdip.bitmap("\res\Images\sys_max.png").clone(25,0,25,25); active = gdip.bitmap("\res\Images\sys_max.png").clone(25,0,25,25); default = gdip.bitmap("\res\Images\sys_max.png").clone(0,0,25,25); }; checked = { background = { hover = gdip.bitmap("\res\Images\sys_recovery.png").clone(25,0,25,25); active = gdip.bitmap("\res\Images\sys_recovery.png").clone(25,0,25,25); default = gdip.bitmap("\res\Images\sys_recovery.png").clone(0,0,25,25); }; } } var closeButtonSkin = { background = { hover = gdip.bitmap("\res\Images\sys_close.png").clone(25,0,25,25); active = gdip.bitmap("\res\Images\sys_close.png").clone(25,0,25,25); default = gdip.bitmap("\res\Images\sys_close.png").clone(0,0,25,25); }; } mainForm.setButton.skin( setButtonSkin ); mainForm.minButton.skin( minButtonSkin ); mainForm.maxButton.skin( maxButtonSkin ); mainForm.closeButton.skin( closeButtonSkin ); /*}}*/ /*顶部右侧基本功能{{*/ mainForm.minButton.oncommand = function(id,event){ mainForm.show(0x6/*_SW_MINIMIZE*/); }
mainForm.maxButton.oncommand = function(id,event){ mainForm.maxButton.checked = mainForm.hitmax() }
mainForm.closeButton.oncommand = function(id,event){ mainForm.close(); } /*}}*/ /*搜索框皮肤{{*/ var searchSkin = { background = { hover = gdip.bitmap("\res\Images\sys_search.png").clone(34,0,34,29); active = gdip.bitmap("\res\Images\sys_search.png").clone(34,0,34,29); default = gdip.bitmap("\res\Images\sys_search.png").clone(0,0,34,29); }; } mainForm.searchButton.skin( searchSkin ) //使其能够响应通知 mainForm.searchButton.setParent( mainForm.searchText ) /*}}*/
mainForm.setButton.oncommand = function(id,event){ var frmChild,wb = mainForm.loadForm("\其他窗口\setList.aardio"); var x,y,cx,cy = win.getPos(mainForm.setButton.hwnd,true); frmChild.setPos(x+cx/2-frmChild.width/2,y+cy); frmChild.show(); }
mainForm.wndproc = function(hwnd,message,wParam,lParam){ select( message ) { case 0x201/*_WM_LBUTTONDOWN*/{ mainForm.hitCaption(); } else{ } } }
mainForm.searchButton.oncommand = function(id,event){ mainForm.msgbox(mainForm.searchText.text); } //供其他界面调用 mainForm.recFun = function(){ mainForm.maxButton.oncommand(); }
import win.ui.resizeBorder; win.ui.resizeBorder(mainForm,3); import win.ui.minmax; win.ui.minmax(mainForm,1000,500); import win.ui.shadow; win.ui.shadow(mainForm,,5);
//mainForm.enableDpiScaling(); mainForm.show();
return win.loopMessage();
|