devlynx (devlynx) wrote,

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

Tags: source
  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your IP address will be recorded