Print Page | Close Window

Adding to main 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=450
Printed Date: 28-Mar-2025 at 6:14am


Topic: Adding to main menu?
Posted By: orcities
Subject: Adding to main menu?
Date Posted: 24-Sep-2007 at 10:37am
How do you add menu items to the main menu?



Replies:
Posted By: Bill Jensen
Date Posted: 01-Oct-2007 at 5:03pm
Hi Dan,
 
Welcome back.
 
The main menu is defined in the DevExShellLayoutView or DotNetShellLsyoutView (in their respective IdeaBlade.Cab assemblies) and is registered with the root workitem as a UIExtension site in the view's RegisterUIExtensionSites() method. 
Examples of adding items to the main menu may be found in:
 
DevExShellLayoutViewPresenter (read UIElementBuilider for an example of reading menu information from App.config)
 
and
 
DotNetShellLayoutViewPresenter (examples of adding menu items at several registered UIExtensionSites.
 
Does this help?
 
BillJ


Posted By: orcities
Date Posted: 03-Oct-2007 at 11:13am
Kind of. I see you can add them. But how do you envoke their controls/forms.
 
If the do pop up forms can they be done in any way? Can we have the forms added to the Workspace?
 
Also, where is the Skins I can't find them in the app.config. So I don't know where they are implmented. I really want to just choose one.
 
 


Posted By: orcities
Date Posted: 03-Oct-2007 at 11:15am
I see the BonusSkins.Register. But how do I just do one of them.


Posted By: Bill Jensen
Date Posted: 04-Oct-2007 at 10:25am
But how do you envoke their controls/forms.
 
Attach a handler to the command object invoked by the menu item.  It turns out that the CAB framework provides an attribute that accomplishes this, as in this example from FoundationModule.cs:
 

/// <summary>Called when the user asks to show the Help | About.</summary>

[CommandHandler(CommandNames.HelpAbout)]

public void OnHelpAbout(object sender, EventArgs e) {

ShowHelpAbout();

}

If the do pop up forms can they be done in any way? Can we have the forms added to the Workspace?
 
See my discussion with Mykel in the thread "Displaying Forms Modally".
 
I see the BonusSkins.Register. But how do I just do one of them.
 
I'm not sure I understand the question.  I'm not an expert on DevEx, but the bonus skins are registered in ShellApplication.cs.  Then, in DevExShwllLayoutViewPresenter.cs, a new instance of SkinMenu is added to the main menu UIExtensionSite.  The SkinMenu handles selection of skins (without the use of the command pattern).
 
Bill J.


Posted By: orcities
Date Posted: 04-Oct-2007 at 10:29am
I do not wish to have the skin menu. I want to choose just one skin. Setting the skin at the shell does not seem to work.


Posted By: Bill Jensen
Date Posted: 04-Oct-2007 at 10:43am
Well, it looks to me like you need to be sure the bonus skins are registered, then call

UserLookAndFeel.Default.SetSkinStyle(skinName);

Is this what you're doing?



Posted By: orcities
Date Posted: 04-Oct-2007 at 10:51am
I have tried setting the look and feel on the shell as well as the DevExShellLayout and it hasn't worked.
 
Where do you suggest putting this.


Posted By: orcities
Date Posted: 04-Oct-2007 at 11:12am
Nevermind. Got it. I had to add the ShellViewPresenter to my project. Then I add the UserLookAndFeel to that.



Print Page | Close Window