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.

Are You Still there?

I'm newbie in C#, got to fix someone code with your library used.
Than I've found your sample Bankshell to run. I've build and run your sample then try to click all of features in it. I'm trying to toggle "use tabbed MDI" button, try to configure it with debug and found this exception :

"System.InvalidOperationException was unhandled
Message="Starting a second message loop on a single thread is not a valid operation. Use Form.ShowDialog instead."
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at CABDevExpress.XtraFormApplication`2.Start() in D:\@Project\DevLynx\Dev CabDevExpress\CABDevExpress.ExtensionKit\XtraFormApplication.cs:line 20
at Microsoft.Practices.CompositeUI.CabApplication`1.Run()
at BankShell.BankShellApplication.Main() in D:\@Project\DevLynx\Dev CabDevExpress\QuickStarts\BankTeller\BankShell\BankShellApplication.cs:line 38
InnerException: "

what exactly the problem? how i can fix it?

thanks in advance,



Re: Are You Still there?

I'm still here, but no longer working with CAB for the past two and a half years. I have transferred the CAB DevExpress Extensions administration over to another developer.

With that said, I downloaded the latest source from codeplex (dated 22 Feb 2010) and could not reproduce your error. Could you give me specific steps to reproduce?



Re: Are You Still there?

hi lynx,

I've downloaded the latest code last night, and work perfectly this time.
what exactly the problem with CABDevExpress.ExtensionKit (build 07/15/2008 8:13 PM / http://cabdevexpress.codeplex.com/releases/view/14614) with CABDevExpress-46685 (build 03/30/2010)?
the problem in CABDevExpress.ExtensionKit (build 07/15/2008 8:13 PM/ http://cabdevexpress.codeplex.com/releases/view/14614) also show up in my app.

Thanks & Regards,