Print Page | Close Window

Switching MDI menu’s

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=43
Printed Date: 02 May 2024 at 4:40pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Switching MDI menu’s
Posted By: PaulM
Subject: Switching MDI menu’s
Date 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




Replies:
Posted By: Oleg
Date Posted: 09 June 2003 at 8:47am

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



Posted By: stuebing
Date 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


Posted By: Oleg
Date Posted: 03 November 2003 at 11:46pm

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



Posted By: stuebing
Date 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


Posted By: Felipe
Date 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;

...


 

 




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net