|
-
September 11th, 2008, 06:42 AM
#1
No replacement of Main menu bar
In my MDI application,I want the main menu bar not to be replaced with the child menubar.When a child frame is opened from the mainmenu item, the additional menu items from the childmenu bar to be shifted to the main menu bar. Is it possible? If yes, Please Help
regards
-
September 11th, 2008, 06:49 AM
#2
Re: No replacement of Main menu bar
Change your MDI application into an SDI application having several child windows. This will be easier than to customize MDI menus.
-
September 11th, 2008, 06:52 AM
#3
Re: No replacement of Main menu bar
Already 90% of my project is complete,so please help
regards
-
September 11th, 2008, 07:05 AM
#4
Re: No replacement of Main menu bar
 Originally Posted by Plaban
In my MDI application,I want the main menu bar not to be replaced with the child menubar.When a child frame is opened from the mainmenu item, the additional menu items from the childmenu bar to be shifted to the main menu bar. Is it possible? If yes, Please Help
regards
What's the point in doing it that way?
-
September 11th, 2008, 07:33 AM
#5
Re: No replacement of Main menu bar
 Originally Posted by Plaban
... When a child frame is opened from the mainmenu item, the additional menu items from the childmenu bar to be shifted to the main menu bar. Is it possible?
Of course it is posiible!
But it cannon be done "magically". You will have to write code to do it:
get old menu
remove all items you don't need
load new (child frame) menu
enum its subitem, get subitem data and move to the "old" menu
destroy the old menu
set a new cretated/updated menu
redraw rhe menu bar And this process you will need to run every time you activate another document or frame.
So the main question is: why not to let the Framework replace your menus?
Victor Nijegorodov
-
September 12th, 2008, 05:26 AM
#6
Re: No replacement of Main menu bar
In the call to my child frame handler function, if I set to the main menu, it works but the problem is that after opening to the multiple child window,if I switch to any window,from the opened windows,then the main menu bar gets replaced with the child menu bar. Where should I set the menu,so that the main menu doesn't gets replaced even when switching to different open windows .
regards
-
September 12th, 2008, 05:51 AM
#7
Re: No replacement of Main menu bar
Victor Nijegorodov
-
September 13th, 2008, 02:33 AM
#8
Re: No replacement of Main menu bar
Does CDocument::GetDefaultMenu() is a member function of CDocument?If yes,how to access it.
regards
-
September 13th, 2008, 05:32 AM
#9
Re: No replacement of Main menu bar
It is written in the tutorial about CMDIChildWnd::m_hMenuShared Data member,but I am not getting data member for this class or any other base classes. Please help
regards
-
September 15th, 2008, 02:34 AM
#10
Re: No replacement of Main menu bar
 Originally Posted by Plaban
It is written in the tutorial about CMDIChildWnd::m_hMenuShared Data member,but I am not getting data member for this class or any other base classes.
Define "am not getting data member".
Have you tried to just copy/paste the code from "How to Use Multiple Menus in MFC App That Uses GetDefaultMenu" article? Doesn't it complile? Doesn't it work?
And BTW, the code sample from "INFO: Sharing Menus Between MDI Child Windows" allow you to use the same menu for all your documents! It is exactly what you asked:
 Originally Posted by Plaban
Where should I set the menu,so that the main menu doesn't gets replaced even when switching to different open windows .
Victor Nijegorodov
-
September 15th, 2008, 02:55 AM
#11
Re: No replacement of Main menu bar
Yes, "Sharing Menus Between MDI Child Windows" is the answer to my Question. But the problem is that my Menu bar contains Navigational menu items and if I open multiple MDI child windows,after closing the last opened window, the Navigational menu items of the present active window does not works. And one more question few data members as m_hMenuShared of class CMultiDocTemplate given in the "Sharing Menus Between MDI Child Windows" is not present, but still it works after I wrote the code.Why and how to get these members?
regards
-
September 15th, 2008, 03:09 AM
#12
Re: No replacement of Main menu bar
What is "Navigational menu items"?
 Originally Posted by Plaban
... few data members as m_hMenuShared of class CMultiDocTemplate given in the "Sharing Menus Between MDI Child Windows" is not present, but still it works after I wrote the code.Why and how to get these members?
If "it works" then all these data members are present. However, some of them might be undocumented, therefore not visibile in the intellisense...
Victor Nijegorodov
-
September 15th, 2008, 03:16 AM
#13
Re: No replacement of Main menu bar
 Originally Posted by VictorN
What is "Navigational menu items"?
Navigational menu items means like moving to next record with the help of CRecordSet::MoveNext ,CRecordSet::MoveFirst... These menu items does not works.
regards
-
September 15th, 2008, 03:59 AM
#14
Re: No replacement of Main menu bar
In what class do you handle CRecordSet::MoveNext ,CRecordSet::MoveFirst... actions?
Victor Nijegorodov
-
September 15th, 2008, 04:07 AM
#15
Re: No replacement of Main menu bar
 Originally Posted by VictorN
In what class do you handle CRecordSet::MoveNext ,CRecordSet::MoveFirst... actions?
In their CRecordView derived classes of the respective views.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|