Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - unable to switch menus between views
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

unable to switch menus between views

 Post Reply Post Reply
Author
Message
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 Topic: unable to switch menus between views
    Posted: 08 June 2005 at 11:02pm
Please show CMainFrame::OnCreate
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
bevpet View Drop Down
Newbie
Newbie
Avatar

Joined: 01 April 2005
Location: Canada
Status: Offline
Points: 39
Post Options Post Options   Thanks (0) Thanks(0)   Quote bevpet Quote  Post ReplyReply Direct Link To This Post Posted: 08 June 2005 at 11:34pm

hi,

probably missing something again with the xtreme toolkit.

simple problem, i want to display a different menu when one of my other forms is displayed, but for some reason its not, i'm guessing there must another call i need to make to activate the menu i want besides having this :

// Register the application's document templates. Document templates

// serve as the connection between documents, frame windows and views.

m_pDocTemplateStartPage = new CMultiDocTemplate(

IDR_MAINFRAME,

RUNTIME_CLASS(CStartPageDoc),

RUNTIME_CLASS(CChildFrame),

RUNTIME_CLASS(CStartPageView));

AddDocTemplate(m_pDocTemplateStartPage);

//  main menu is above

////////////////////////////////////////////////////////////

m_pDocTemplateBrowserPage = new CMultiDocTemplate(

IDR_IE_MENU,

RUNTIME_CLASS(CStartPageDoc),

RUNTIME_CLASS(CChildFrame),

RUNTIME_CLASS(CBrowserView));

AddDocTemplate(m_pDocTemplateBrowserPage);

 

// this is class is a simple browser with the IE toolbar i'd like to so

// as the maintool bar is getting too cluttered.

//////////////////////////////////////////////////////////// /////////////////

 

any help on the above appreciated or where to look in the docs for the solution appreciated.

thanks

Peter

 

Back to Top
bevpet View Drop Down
Newbie
Newbie
Avatar

Joined: 01 April 2005
Location: Canada
Status: Offline
Points: 39
Post Options Post Options   Thanks (0) Thanks(0)   Quote bevpet Quote  Post ReplyReply Direct Link To This Post Posted: 10 June 2005 at 5:11pm

Hi Oleg,

as requested. thank you

 if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
  return -1;

  if (!m_wndStatusBar.Create(this) ||
  !m_wndStatusBar.SetIndicators(indicators,
    sizeof(indicators)/sizeof(UINT)))
 {
  TRACE0("Failed to create the status bar\n");
  return -1;      // fail to create
 }


 theApp.GetSystemSettings(0);
 if (!InitCommandBars()) 
  return -1;

 CXTPCommandBars* pCommandBars = GetCommandBars();
 CXTPCommandBar* pMenuBar = pCommandBars->SetMenu(_T("Menu Bar"), IDR_MAINFRAME);
 pMenuBar->SetFlags(xtpFlagIgnoreSetMenuMessage);

 CXTPToolBar* pCommandBar = (CXTPToolBar*)pCommandBars->Add(_T("Standard"), xtpBarTop);
 if (!pCommandBar ||
  !pCommandBar->LoadToolBar(IDR_MAINFRAME))
 {
  TRACE0("Failed to create the main toolbar.\n");
  return -1;
 }

 pDatabaseBar = (CXTPToolBar*)pCommandBars->Add(_T("Database Navigation"), xtpBarTop);
 if (!pDatabaseBar ||
  !pDatabaseBar->LoadToolBar(IDR_TOOLBAR_DATABA SE))
 {
  TRACE0("Failed to create the database navigation toolbar.\n");
  return -1;
 }

 XTPImageManager()->SetMaskColor((COLORREF)-1); // Auto

 if (XTPImageManager()->IsAlphaIconsSupported())
 {
  XTPImageManager()->SetIcons(IDB_FAVORITES, favoritesicons,
   sizeof(favoritesicons)/sizeof(UINT), CSize(16, 16));

  XTPPaintManager()->GetIconsInfo()->bUseDis abledIcons = TRUE;
  CXTPImageManager::m_dDisabledBrightnessFactor = 2.0;
  CXTPImageManager::m_dDisabledAlphaFactor = 4.0;

 } else
 {
  CXTPOffice2003Theme::LoadModernToolbarIcons(IDR_ MAINFRAME);
  CXTPOffice2003Theme::LoadModernToolbarIcons(IDR_ MAINFRAME1);
  CXTPOffice2003Theme::LoadModernToolbarIcons(IDR_ TOOLBAR_WEB);
  CXTPOffice2003Theme::LoadModernToolbarIcons(IDR_ TOOLBAR_DATABASE);
 }
 XTPImageManager()->SetIcons(IDR_MAINFRAME);
 XTPImageManager()->SetIcons(IDR_TOOLBAR_WEB);
 XTPImageManager()->SetIcons(IDR_TOOLBAR_DATABASE);

 CXTPToolBar* pWebBar = (CXTPToolBar*)pCommandBars->Add(_T("Web"), xtpBarTop);
 if (!pWebBar ||
  !pWebBar->LoadToolBar(IDR_TOOLBAR_WEB))
 {
  TRACE0("Failed to create the web browser toolbar.\n");
  return -1;
 }

 LoadCommandBars(_T("CommandBars"));
 CCustomizePageTools::LoadTools("UserTools");

 GetDockingPaneManager()->InstallDockingPanes(this);
 m_paneManager.SetTheme((XTPDockingPanePaintTheme)theAp p.m_nPaneTheme);
 m_paneManager.SetAlphaDockingContext(TRUE);
 m_paneManager.SetShowDockingContextStickers(TRUE);

 CXTPDockingPaneLayout layoutNormal(GetDockingPaneManager());
 if (layoutNormal.Load(_T("NormalLayout")))
 {
  GetDockingPaneManager()->SetLayout(&layou tNormal);
 }
 else
 {
  CXTPDockingPane* paneOutput = GetDockingPaneManager()->CreatePane(
   ID_VIEW_OUTPUT_VIEW, CRect(0, 0, 210, 140), xtpPaneDockBottom);

  CXTPDockingPane* paneFindInFilesView = GetDockingPaneManager()->CreatePane(
   ID_VIEW_FINDINFILES_VIEW, CRect(0, 0, 210, 140), xtpPaneDockBottom);

  CXTPDockingPane* paneHelpView = GetDockingPaneManager()->CreatePane(
   ID_VIEW_DYNAMICHELP_VIEW, CRect(0, 0, 210, 140), xtpPaneDockRight);

  CXTPDockingPane* paneTasksView = GetDockingPaneManager()->CreatePane(
   ID_VIEW_TASKS_VIEW, CRect(0, 0, 210, 140), xtpPaneDockBottom);

  GetDockingPaneManager()->AttachPane(paneOutpu t, paneTasksView);
  GetDockingPaneManager()->AttachPane(paneFindI nFilesView, paneTasksView);

  paneTasksView->Select();
  }

 if (!CreateTaskPanel()) return FALSE;

 pCommandBars->GetCommandBarsOptions()->animation Type =   (XTPAnimationType)theApp.m_bxtpAnimateWindowsDef ault;
 pCommandBars->GetCommandBarsOptions()->bAlwaysSh owFullMenus = theApp.m_bAlwaysShowFullMenus;
 pCommandBars->GetCommandBarsOptions()->bDblClick Float = TRUE;
 pCommandBars->HideCommands(uHideCmds, _countof(uHideCmds));

 int nIDIcons[] = { // assign to menu/pane/tab item id
  XTPIDCUSTOMIZE, ID_VIEW_PROPERTIESWINDOW, 0, ID_VIEW_OUTPUT_VIEW,
  0, 0, ID_VIEW_TASKS_VIEW, 0, 0, 0, 0, ID_VIEW_FINDINFILES_VIEW, 0, 0,
  0, ID_VIEW_DYNAMICHELP_VIEW
 };

 GetDockingPaneManager()->SetIcons(IDB_BITMAP_PANELI CONS, nIDIcons,
  sizeof(nIDIcons)/sizeof(nIDIcons[0]), RGB(0, 255, 0));

 VERIFY(m_MTIClientWnd.Attach(this, TRUE));
 m_MTIClientWnd.GetPaintManager()->m_bShowIcons = TRUE;
 m_MTIClientWnd.SetAllowReorder(theApp.m_bAllowReorder[0]);
 m_MTIClientWnd.EnableToolTips();

 CXTPTabPaintManager* pTabPaintManager = new CXTPTabPaintManager();
 pTabPaintManager->SetColor(XTPTabColorStyle(theApp. m_nxtpTabColor[0]));
 pTabPaintManager->SetAppearance(XTPTabAppearanceSty le(theApp.m_nxtpTabAppearance[0]));
 pTabPaintManager->m_bOneNoteColors = theApp.m_bOneNoteColors[0];
 pTabPaintManager->m_bHotTracking = theApp.m_bHotTracking[0];
 pTabPaintManager->m_bShowIcons = theApp.m_bShowIcons[0];
 pTabPaintManager->m_szIcon = theApp.m_bLargeIcons[0]? CSize(32, 32): CSize(16, 16);
 pTabPaintManager->m_bBoldSelected = theApp.m_bBoldSelected[0];
 pTabPaintManager->m_bStaticFrame = theApp.m_bShowStaticFrame[0];
 pTabPaintManager->m_bOneNoteColors = theApp.m_bOneNoteColors[0];
 pTabPaintManager->m_bHotTracking = theApp.m_bHotTracking[0];
 pTabPaintManager->m_clientFrame = XTPTabClientFrame(theApp.m_nClientFrameStyle[0]);
 pTabPaintManager->SetLayout(XTPTabLayoutStyle(theAp p.m_nxtpTabLayout[0])); 
 pTabPaintManager->SetPosition(XTPTabPosition(theApp .m_nTabPositions[0]));
 pTabPaintManager->GetAppearanceSet()->m_rcHeader Margin.SetRect(2, 6, 2, 0);
 pTabPaintManager->m_rcClientMargin.SetRect(2, 2, 2, 2);
 pTabPaintManager->m_rcButtonMargin.SetRect(4, 1, 4, 1); 

 m_MTIClientWnd.SetPaintManager(pTabPaintManager);
 
 CXTWindowPos wndPosition;
 wndPosition.LoadWindowPos(this);

 theApp.GetSystemSettings(0); // LOAD USER PREFERENCES
 theApp.GetSystemSettings(1);
 theApp.GetSystemSettings(2);
 theApp.GetSystemSettings(3);

 CXTPPaintManager::SetTheme((XTPPaintTheme)theApp.m_nPa intTheme);
 OnSwitchTheme();


 return true;
}

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: 11 June 2005 at 8:53am

There is line

pMenuBar->SetFlags(xtpFlagIgnoreSetMenuMessage);

that don't make it. Remove it.

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
bevpet View Drop Down
Newbie
Newbie
Avatar

Joined: 01 April 2005
Location: Canada
Status: Offline
Points: 39
Post Options Post Options   Thanks (0) Thanks(0)   Quote bevpet Quote  Post ReplyReply Direct Link To This Post Posted: 11 June 2005 at 9:18am

appreciated,

thanks Oleg,

Peter

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.156 seconds.