📄 menubar.js
字号:
Class('App.linb_UI_MenuBar', 'linb.Com',{
Instance:{
//base Class for linb.Com
base:["linb.UI", "linb.Coder"],
//requried class for the App
required:["linb.UI.Button", "linb.UI.PopMenu", "linb.UI.MenuBar", "linb.UI.Block"],
iniComponents:function(){
// [[code created by jsLinb UI Builder
var host=this, children=[], append=function(child){children.push(child.get(0))};
append((new linb.UI.PopMenu)
.host(host,"popmenu2")
.setItems([{"id":"a", "caption":"item a", "tips":"item a"}, {"id":"b", "caption":"itemb", "tips":"item b", "sub":[{"id":"itema1", "caption":"itema", "tips":"item a"}, {"id":"itemb1", "caption":"itemb", "tips":"item b", "sub":[{"id":"itemc11", "caption":"itemc", "tips":"item c"}, {"id":"itemd11", "caption":"itemd", "tips":"item d"}]}, {"id":"itemc1", "caption":"itemc", "tips":"item c"}, {"id":"itemd1", "caption":"itemd", "tips":"item d", "sub":[{"id":"itemc11", "caption":"itemc", "tips":"item c"}, {"id":"itemd11", "caption":"itemd", "tips":"item d"}]}]}, {"id":"itemc", "caption":"itemc", "tips":"item c"}, {"id":"itemd", "caption":"itemd", "tips":"item d"}, {"id":"iteme", "caption":"iteme"}, {"id":"itemf", "caption":"itemf"}, {"id":"itemg", "caption":"itemg"}, {"id":"itemh", "caption":"itemh"}, {"id":"itemi", "caption":"itemi"}, {"id":"itemj", "caption":"itemj"}, {"id":"itemk", "caption":"itemk"}, {"id":"iteml", "caption":"iteml"}, {"id":"itemm", "caption":"itemm"}, {"id":"itemn", "caption":"itemn"}, {"id":"itemo", "caption":"itemo"}, {"id":"itemp", "caption":"itemp"}])
.onMenuSelected("_popmenu2_onmenuselected")
);
append((new linb.UI.PopMenu)
.host(host,"popmenu1")
.setItems([{"id":"itema", "caption":"itema", "tips":"item a"}, {"type":"split"}, {"id":"itemb", "caption":"itemb", "tips":"item b"}, {"id":"itemc", "caption":"itemc", "tips":"item c"}, {"id":"itemd", "caption":"itemd", "tips":"item d"}])
.onMenuSelected("_popmenu1_onmenuselected")
);
append((new linb.UI.Block)
.host(host,"block1")
.setLeft(40)
.setTop(20)
.setWidth(520)
.setHeight(120)
.setBorder(true)
.setResizer(true)
);
host.block1.append((new linb.UI.MenuBar)
.host(host,"menubar1")
.setItems([{"id":"file", "caption":"File", "sub":[{"id":"newproject", "caption":"New Project", "image":"img/App.gif", "imagePos":"-32px top"}, {"id":"openproject", "caption":"Open Project", "add":"Ctrl+Alt+O", "image":"img/App.gif", "imagePos":"-48px top"}, {"id":"closeproject", "caption":"Close Project"}, {"type":"split"}, {"id":"save", "caption":"Save", "image":"img/App.gif", "imagePos":"-80px top"}, {"id":"saveall", "caption":"Save All", "add":"Ctrl+Alt+S", "image":"img/App.gif", "imagePos":"-96px top"}]}, {"id":"tools", "caption":"Tools", "sub":[{"id":"command", "caption":"Command Window", "image":"img/App.gif", "imagePos":"-112px top"}, {"id":"spy", "caption":"Components Spy", "image":"img/App.gif", "imagePos":"-128px top"}]}, {"id":"build", "caption":"Build", "sub":[{"id":"debug", "caption":"Debug", "image":"img/App.gif", "imagePos":"top left", "add":"F9"}, {"id":"release", "caption":"Release", "image":"img/App.gif", "imagePos":"-64px top", "add":"Ctrl+F9"}, {"type":"split"}, {"id":"setting", "caption":"Build Setting"}]}, {"id":"help", "caption":"Help", "sub":[{"id":"Forum", "caption":"forum"}, {"type":"split"}, {"id":"License", "caption":"License"}, {"type":"split"}, {"id":"about", "caption":"About"}]}])
.setAutoShowTime(0)
.onMenuSelected("_menubar1_onmenuselected")
);
append((new linb.UI.Block)
.host(host,"block26")
.setLeft(40)
.setTop(160)
.setWidth(520)
.setHeight(120)
.setBorder(true)
.setResizer(true)
);
host.block26.append((new linb.UI.MenuBar)
.host(host,"menubar5")
.setItems([{"id":"file", "caption":"File", "sub":[{"id":"newproject", "caption":"New Project", "image":"img/App.gif", "imagePos":"-32px top"}, {"id":"openproject", "caption":"Open Project", "add":"Ctrl+Alt+O", "image":"img/App.gif", "imagePos":"-48px top"}, {"id":"closeproject", "caption":"Close Project"}, {"type":"split"}, {"id":"save", "caption":"Save", "image":"img/App.gif", "imagePos":"-80px top"}, {"id":"saveall", "caption":"Save All", "add":"Ctrl+Alt+S", "image":"img/App.gif", "imagePos":"-96px top"}]}, {"id":"tools", "caption":"Tools", "sub":[{"id":"command", "caption":"Command Window", "image":"img/App.gif", "imagePos":"-112px top"}, {"id":"spy", "caption":"Components Spy", "image":"img/App.gif", "imagePos":"-128px top"}]}, {"id":"build", "caption":"Build", "sub":[{"id":"debug", "caption":"Debug", "image":"img/App.gif", "imagePos":"top left", "add":"F9"}, {"id":"release", "caption":"Release", "image":"img/App.gif", "imagePos":"-64px top", "add":"Ctrl+F9"}, {"type":"split"}, {"id":"setting", "caption":"Build Setting"}]}, {"id":"help", "caption":"Help", "sub":[{"id":"Forum", "caption":"forum"}, {"type":"split"}, {"id":"License", "caption":"License"}, {"type":"split"}, {"id":"about", "caption":"About"}]}])
.onMenuSelected("_menubar1_onmenuselected")
);
return children;
// ]]code created by jsLinb UI Builder
},
_menubar1_onmenuselected:function (profile, popPro, item, src) {
linb.message(item.id+' selected.')
}
}
});
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -