Rebar Menu

Share your advanced PureBasic knowledge/code with the community.
klaver
Enthusiast
Enthusiast
Posts: 147
Joined: Wed Jun 28, 2006 6:55 pm
Location: Schröttersburg

Rebar Menu

Post by klaver »

Image

Hi, I've made this nice menu because I like this kind of things in other programs.

http://www.freewebtown.com/tbiu/RbMenu.zip

Hope you will like it. It's tested only on WinXP so the icons would (possibly will) look ugly on older OS because of the XP transparency used.

There's a TODO thing: the menus should dymically change while moving the cursor when activated. Hope you will help me to do this.
All improvements are welcome.
eesau
Enthusiast
Enthusiast
Posts: 589
Joined: Fri Apr 27, 2007 12:38 pm
Location: Finland

Post by eesau »

This is exactly the same what I'm going to do with my own Office-style menus (search the forums for the code if interested). Remember though, that with toolbar/rebar-type menus you have to implement keyboard navigation of menus, which is a bit problematic. Here are the keys that should be implemented:

F10 -- for activating the menu.
Left and right arrows -- for moving between main item and menu sub-items.
Up and down arrows -- for moving between menu sub-items, down arrow also for activating a particular main item in the menu.
Alt-key -- for activating underscores.
Enter -- for selecting the current menu item, also expands sub-items in the menu.
Esc -- for cancelling keyboard navigation.

Implementing keyboard navigation is absolutely essential, because not everyone uses a mouse. And some people find it easier to navigate by keyboard even if they have a mouse.

Here is an article (MSDN) that explains keyboard navigation in toolbar/rebar -menus. Hope it helps.
Post Reply