Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Switching MDI menu’s
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Switching MDI menu’s

 Post Reply Post Reply
Author
Message
PaulM View Drop Down
Newbie
Newbie


Joined: 26 May 2003
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote PaulM Quote  Post ReplyReply Direct Link To This Post Topic: Switching MDI menu’s
    Posted: 02 June 2003 at 2:50pm

Hi Oleg,

What is the best method for switching the menu's for MDI windows?  IE where would you suggest I place the code and provide an example.  I noticed the sample app's always deal with one menu for the application and don't deal with swapping the menus for different views.  Actually, I would suggest you do this for the Visual Studio 7 app example.  When the child window is closed, show how the menu would change the IDR_MAINFRAME.

 

Paul

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 09 June 2003 at 8:47am

Sorry, Paul. It's not implemented in current version.

Back to Top
stuebing View Drop Down
Newbie
Newbie


Joined: 29 October 2003
Location: Germany
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote stuebing Quote  Post ReplyReply Direct Link To This Post Posted: 29 October 2003 at 3:59am
Hi,

I'm currently evaluating XTP 8.51 using VC++ 6.0 and this non-support for switching MDI menus is nearly a show stopper

My MDI application has about 4 different document types and has to switch the mainframe menu according to the currently active MDI window.

Is there some work-around to stay with XTP?

Andreas
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 03 November 2003 at 11:46pm

Please wait ToolkitPro 8.60 it has some new functions for MDI menus.

Back to Top
stuebing View Drop Down
Newbie
Newbie


Joined: 29 October 2003
Location: Germany
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote stuebing Quote  Post ReplyReply Direct Link To This Post Posted: 07 November 2003 at 9:57am
Hi,

currently I'm switching menus "by hand" using the following approach:

     CMenu m
     m.Attach(newMenuHandle);
     m_pMenuBar->GetControls()-& gt;RemoveAll();
     for (int i = 0; i != m.GetMenuItemCount(); ++i)
     {
           m_pMenuBar->GetControls()->AddMenuItem(&m, i);
     }
     m.Detach();
     SetMenu(0);

As I do not need real MDI-automagic-switching it is working ok for me.

Bye,
    Andreas
Back to Top
Felipe View Drop Down
Groupie
Groupie


Joined: 08 August 2003
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote Felipe Quote  Post ReplyReply Direct Link To This Post Posted: 13 November 2003 at 12:41am

Hil, I do this in my app:

void CMainFrame::ActivateXXXMenus()
{
 if (m_nPreviousMenuBar != IDR_XXXMENU)
 {

  CXTPCommandBar* pMenuBar1 = GetCommandBars()->GetMenuBar();
  if (pMenuBar1 == NULL) return;

  pMenuBar1->SetSelected(-1);
  pMenuBar1->SetTitle("XXX Menu");
  pMenuBar1->GetControls()->RemoveAll();
  ((CXTPMenuBar*) pMenuBar1)->LoadMenuBar(IDR_XXXMENU);
  m_nPreviousMenuBar = IDR_XXXMENU;

...


 

 

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.