Print Page | Close Window

Toolbars and menu

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=638
Printed Date: 28-Apr-2025 at 2:04am


Topic: Toolbars and menu
Posted By: BillG
Subject: Toolbars and menu
Date Posted: 29-Dec-2007 at 12:20pm

How do I change the items in the Main Menu?  How do I add a toolbar to the are under the menu?




Replies:
Posted By: Bill Jensen
Date Posted: 02-Jan-2008 at 12:53pm

In CAB, global extensions to the UI are handled by registering UIExtensionSites with the workitem.  I believe David Platt covers them in detail in his book.  If you don't have it, you should get it.  See my list of CAB resources in this thread:

http://www.ideablade.com/forum/forum_posts.asp?TID=573 - http://www.ideablade.com/forum/forum_posts.asp?TID=573
 
In IdeaBlade.Cab, the shell layout views (defined in the Views\Layout folder of IdeaBlade.Cab.DotNet or IdeaBlade.Cab.DevEx in the CabanaLib solution) register the main menu bar using the constant UIExtensionSiteNames.MainMenu.   In the DevEx version, this is a "Bar" that can hold both menu items and widgets of various types.  In the DotNet version, it is a MenuBar.
 
For an example of extending the main menu, see the "Extend Menu" region of the SplashModuleController in the Cabana solution.  The code is commented out, but it shows the basic principles.
 
Neither shell layout version registers a separate tool bar as an extension site.  To do this, you'd need to make a copy of the appropriate ShellLayoutView in your Foundation module, change the namespace and add a tool bar and the code to register it (UIExtensionSiteNames already contains the constant "MainToolBar").  You'd then need to register YOUR shell layout view in place of the standard ShellLayoutView.  Do this in the ViewFactoryService (in your Foundation module) with something like:
 

// Register application-specific views here ...

// RegisterViewType<Views.MyViewType>(ViewNames.MyView);

UnregisterViewType(ViewNames.ShellLayout);

RegisterViewType<MyShellLayoutView>(ViewNames.ShellLayout);

UIExtensionSites work, but we feel they are one of the weaker areas of CAB and we have not incorporated many examples into Cabana.
 
Hope this helps a bit.
 
Bill Jensen
IdeaBlade
 



Print Page | Close Window