模仿StartEx ,把鼠标移到屏幕上方会出现MenuEx按钮,单击按钮会弹出下面的程序列表供打开,打开其中一个程序,MenuEx会自动隐藏。
拖放快捷方式或程序到MenuEx下面的程序列表会自动生成相关按钮。
主要运用BBinterface插件和ondrop功能,因为刚接触bblean,很多东西写的不好,请大家批评改正:)
好,下面说说我是怎样做的。
1、建立一个Frame,名字叫mainframe (500*260),再在mainframe 里面加入7个childframe (就是CreateChild -> Frame),名字叫dockbar,dockbar1,dockbar2……dockbar6,大小为490*34 ,为每个childframe 设置标签(control options-> caption -> static text-> entrY),如:办公,小工具,影音,网络等。Text setting 为 right (右对齐)。
2、为每个docbar设置ondrop 的动作(Control options -> ondrop -> blackbox Bro@m -> entry),里面填入@BBInterface Plugin Load [OnDockDrop] from drop2.rc
每个dockbar frame对应不同的drop文件。 例如dockbar对应drop.rc,dockbar1对应drop1.rc
3、在 bblean目录下面的plugins/bbinterface 目录建立相应的drop.rc文件。因为有7个dockbar frame 所以要建立 7 个drop.rc,名字一次为drop.rc drop1.rc drop2.rc ………… drop6.rc
引用:
[OnDockDrop]
@BBInterface Control CreateChild dockbar2 Button
@BBInterface Control SetWindowProperty $LastControl$ Y 2
@BBInterface Control SetWindowProperty $LastControl$ X $Mouse.X$-$dockbar.X$
@BBInterface Control SetWindowProperty $LastControl$ Width 32
@BBInterface Control SetWindowProperty $LastControl$ height 32
@BBInterface Control SetAgent $LastControl$ MouseUp Run "$DroppedFile$"
@BBInterface Control SetAgent $LastControl$ Image Icon "$DroppedFile$"
@BBInterface Control SetAgentProperty $LastControl$ Image Size 32
@BBInterface Control SetWindowProperty dockbar Width %+34
4、把常用的程序拖放到你的MenuEx,排好。
5、实现mainbar 的抽屉效果,设置 mainbar ,window options -> make invisible -> when control loses focus
6、建立一个button 叫MenuEx,设置自动隐藏 ,caption 设置为MenuEx ,Text Setting为right ,image 设置为你喜欢的小图标,设置动作 control option -> Left Mouse up ->bbinterface control -> make control visiable -> mainbar
好大功告成。