![]() |
Custom Menus |
Post Reply
|
| Author | |
MacW
Senior Member
Joined: 26 June 2007 Status: Offline Points: 253 |
Post Options
Thanks(0)
Quote Reply
Topic: Custom MenusPosted: 20 July 2007 at 12:20pm |
|
Hi,
I keep all menus in my application in an external XML resource file (to support multi-language applications). My resource manager gives me a CMenu object when I load a menu. I want to set this as the main frame menu in my XTP application, and also use dynamic menus for my document templates. This all works beautifully as long as I use the standard menus provides by the MFC. I can set the mainframe menu, and use the GetDefaultMenu virtual in my document classes to switch menus at runtime. When all documents are closed, the MFC takes care that the default mainframe menu is restored. This works only so-so since I switched to XTP command bars. To set the main frame menu, I copied some code from a XTP sample. This seems to set the correct menu, but I'm not sure if this is enough, or the right way to do it.
At runtime, the MDI document templates replace this menu as usual. But when all documents are closed, XTP does not properly restore the standard mainframe menu. The menu set by the last document template remains even if there is no document anymore.
I know how to do this correctly with the MFC. I need to know how to do this with XTP. I've already searched the class list documentation, and also the samples you provide to no avail. The "one line per method" documentation on command bars unfortunately does not help much to understand how to use your classes ![]() |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |