How do I implement a Recent Files Menu?


Author
Message
Arthur Warren
Arthur Warren
Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)
Group: Forum Members
Posts: 9, Visits: 1
This is driving me crazy.

I have a class derived from NDiagramOptionMenuCommand (call it MRUCommand), and another one inheriting from NDiagramButtonCommand (call it MRUItemCommand).

I'm creating a number of MRUItemCommand instances, with the data I need for later, and adding these to the Commander.Commands collection off the commandbar manager. Each MRUItemCommand gets its own commandID, starting from 700.

I'm creating the MRUCommand, and it's setting base.Items to the array of command ids that I've just created.

I've added the MRUCommand to the file menu - it shows up, but none of the sub items do.

What am I missing to get this thing to display properly?

Thanks,
Herb.
Pavel Vladov
Pavel Vladov
Forum Member (34 reputation)Forum Member (34 reputation)Forum Member (34 reputation)Forum Member (34 reputation)Forum Member (34 reputation)Forum Member (34 reputation)Forum Member (34 reputation)Forum Member (34 reputation)Forum Member (34 reputation)
Group: Forum Members
Posts: 33, Visits: 2
Hello Herb, have you implemented correctly the GetSelectedItemImageInfo method of the diagram option menu command? If yes, please send me an e-mail (my e-mail is pavel@nevron.com) with you sample project and I'll tell you what are you missing.

Best Regards,
Pavel Vladov
Arthur Warren
Arthur Warren
Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)
Group: Forum Members
Posts: 9, Visits: 1
I got it.

I was implementing GetSelectedItemImageInfo correctly - what I was missing was forcing the framework to recreate the menus after I'd altered the commands.

For future reference, what I did:
1) Create the commands for the sub-menu items, add them to the CommandBarsManager
2) Create the menu item, have it return the command ids of the commands created in step 1
3) Add the menu item to the CommandBarsManager
4) Recreate all the command bars:

NControlHelper.BeginUpdate( commandBarsMgr.ParentControl );
commandBarsMgr.Recreate();
NControlHelper.EndUpdate( commandBarsMgr.ParentControl, true );

I'm not thrilled with the last step - is there any way to just recreate the main menu - the other command bars will not be affected by this change.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search