Log in

No account? Create an account

CAB DevExpress Extension Kit Ribbon Demo

Since I have been working on the CAB DevExpress Extension Kit I have added a number of UIElementAdaptors for the Ribbon. However, there was no good example of the Ribbon control in the Extension Kit. So this past week I modified the Extension Kit demo to include the Ribbon control. I did this using a conditional compilation symbol which I would never use in this way outside of a demo. However, in this case it does a few things.
  • This method demonstrates exactly where changes need to be made within the code. You can search for "UseRibbonForm" and see both the Ribbon code and the menu code side by side. I hope that this is a good way to see how the Ribbon code is different than code for the menu.
  • It reduces the maintenance costs. When a new feature is added to the demo it will be easy to get it to work in both the menu and the Ribbon.
  • Last, it sped up the development greatly; it would have taken me a much longer time to rewrite the BankTeller demo from scratch.
Even with these advantages I wouldn't use this technique in this way in a shipping product. To compile the Ribbon, you must add "UseRibbonForm" to the conditional compilation symbol property of the BankShell and the BankTellerModule. To compile to the menu just remove this symbol.

There were a couple of changes to the BankTeller application to get the Ribbons to work. First, the Ribbon control does not work well without button images. So I had to add glyphs to the application. I added them to both the Ribbon and to the original menus. The glyphs were made using Axialis IconWorkshop and their Image Objects. Since the supplied glyphs were constructed with Axialis IconWorkshop I can distribute them in the Extension Kit. You are free to use these images in any project if you so desire. I also included in the project the icons from which the glyphs were created.I extended the MenuItemElement ConfigurationElement to handle the glyphs in the configuration file. I separated the guts of the Windows menu into it's own class so that it could be easily used by both the menu and Ribbon based forms. I then added support for dynamic creation of UIElement items. This allows me to loop through the available skins while still adhering more closely to the CAB philosophy. This dynamic UIElement creation will be my next post.

I have compiled this against DevExpress 2008v2 beta so I will check in the code when 2008v2 is officially released. Until then, you can get a copy from my site at tetzel.com.



Hello, Lynx.

I've discovered your project trying to find a solution for ribbon merging in multi-tab application. So the first thing I wanted to check was the ribbon handling, so I've downloaded the last 4th drop, added "UseRibbonForm" symbols as you noted here and built - but the demo project I got uses only menu instead of ribbons though :( By the way, searching for "UseRibbonForm" in the complete solution I found no single line referencing this symbol. Please let me know how could I get it working?

Sincerely yours,
Alex the Marrch Irbis.