|
|
'Recent' Command Bar
It's an extension to the WTL Command Bar - giving it a MS Office 2000 look. It has support for that "only show recent menu-items" thing Microsoft likes so much.
This control has been under construction for quite some time now. It's still not
perfect, but at least it's useable now.
The problem with building it was that the WTL Command Bar modifies the existing
menu instead of recreating a copy with the new owner-drawn style.
I guess Nenad Stefanovic (author of WTL) decided to do this to be able to preserve existing owner-drawn items and the likes,
but it would have helped a lot if the menus were recreated from scratch instead.
Anyway, the final shoot-out came down to getting separators right.
My solution to this problem requires you to not use separators in the resource editor,
but use a regular menu-item with the string "-" (without the quotes) instead.
The control will turn the separators back on at runtime.
Sigh, why did Bill Gates decide to send How to use itYou simply use CRecentCommandBarCtrl instead of the CCommandBarCtrl control class.You should also add a list of menu-items to display when the menus first pop up...
When the user selects an item, it is automatically added to the list of items displayed. In addition, the next time the menu is shown, it displays the compact menu again. You can override the menu display-mode with the SetShowRecent() method.
And remember, don't use separators. Use a - character instead! Source Code DependenciesMicrosoft WTL 3.1 LibrarySee AlsoMenu SampleDownload Files
Written by Bjarke Viksoe. Article submitted 7/6/2001.
|
|||