📄 menu.gml
字号:
#ifndef MENU_GML
#define MENU_GML
<style>
.menu_Icon:text{
pos=2,0;
font=Webdings,16,16,400;anti=1;color=R123G255B255;
src=8;
//filltext={bar(0,0,40,40,#333399);Circlelight(6,6,13,#333399);Circlelight(6,6,5,#AAAAAA);};
//bk=shadow(#006666,250,0,0,2);
clip=0;
//ctrl=loopt(1,alpha,0,255,12,20);
}
.menu_item:text{
showStyle=0;
color=#BBFFFF;
autopos=true;
// font=宋体,6,14,000;
icon=" ";
OnCreate={<menu_Icon src="$[icon]";>
<: if=(pid.maxw<width)?{pid.oldmaxw=*pid.maxw;pid.maxw=(width+10);};pid.eve=refSize;>
};
OnMouseOver={<: bk=round4_3(#AAAABB,2,#BBBBAA);color=#99FFFF>};
OnMouseOut={<: bk=null;color=#BBFFFF>};
OnRButtonUp={<: pid.show=0;>};
OnClick={<:$[toid] eve=$[toeve];>};
}
.menu_item_close:menu_item{
src="返回";
OnCreate#3={<menu_Icon src="q";>
};
OnCreate={<: &desktop.canback=1;&desktop.exitbtn=$[id];from=*regstr(from,"root");fromname=*regstr(fromname,"root");bwnd=*&desktop.bwnd;eve=set>};
OnSet={<: if=(bwnd==1)?{src=" 关闭";OnClick=window.close();}:{switch(fromname){
case "root":src=" 关闭";OnClick=window.close();break;
case "croot":src=" 关闭";OnClick=window.close();break;
default:src=" 返回->$[fromname]";OnClick={<: eve=tryExit;>};
}};
if=(width<100)?{width=100;};
if=(pid.maxw<width)?{pid.oldmaxw=*pid.maxw;pid.maxw=(width+10);pid.refSize;};
&desktop.isgameing=0;
>
};
OntryExit={<: if=(&desktop.isgameing)?{<msgdlg eve=show,2,现在您正在游戏中\r\n如果关闭就会自动离开游戏,$[id],关闭,继续玩></msgdlg>}:{eve=ExitNow;};>};
On关闭={<: &desktop.myid.eve=CloseG;eve=ExitNow>};
OnExitNow={<:desktop exec=$[from];>};
}
.menu:div{
autopos=true;
// bk=color(#EFEBEF);
autosubpos=vert(3,3,1,1);
// draw={wv();rect(-1,-1,width+1,height+1,#D6D2CE);};
bk=roundhalf(#EEEEFF,4,#FFFFEE);
maxw=100;oldmaxw=0;
OnAddMenuItem={<menu_item toid=$[ep1];toeve=$[ep2];
switch(pid.ep3){
case "$[ep2]":icon=" ";break;
default: icon="$[ep3]";
};src=" $[ep0]";
>
};
// OnDelMenuItem={<: enumsub(txtsrc,$[ep0])={<: del=1;>};>};
OnrefSize={<: show=0;ctrl#ref=loopcmd(1,10,1,{<: oldmaxw=*maxw;enumsub={<: width=*pid.maxw;>};ctrl#ref2=loopcmd(1,10,1,{<: show=1;>});>});>};
Ongetmmsg={<: pid=desktop;pos=$[&desktop.mousepos];mousemsg=1;>};
OnCreate#hidme={<: ctrl#hidme=loopcmd(1,100,1,{<: eve=getmmsg;>});>};
Onlbuttondownend={<: eve=hidme;>};
Onrbuttondownend={<: eve=hidme;>};
Onhidme={<: del=1;>};
Onshowme={<: pos=$[&desktop.mousepos];ctrl#hidme=loopcmd(1,100,1,{<: show=1;>});>};
}
</style>
#ifdef MAINGML
<menu pos=100,100;
>
</menu>
<: Onrbuttondown2={<: menuid=new menu{pos=$[mousepos];ctrl=loopcmd(5,100,1,{<: eve=addMenuItem,中文,toid,toeve;>});
};>};
Onrbuttondown={<: &mainmenu.eve=showme;>};
>
<menu name=mainmenu;show=0;Onhidme={<: show=0;>};>
<menu_item src=sssssssssss;>
<menu_item src=sssssssssss;>
<menu_item src=sssssssssss;>
<menu_item src=sssssssssss;>
</menu>
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -