Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Switching MDI menus in full screen mode
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Switching MDI menus in full screen mode

 Post Reply Post Reply
Author
Message
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: Switching MDI menus in full screen mode
    Posted: 04 March 2008 at 5:08am
Hi;
I've implemented a fullscreen mode into my MDI application that has different document types. Each document type has its own menu resource.
I'm also using CTXPTabClientWnd as the workspace for my child windows.
 
Now, when I'm in fullscreen mode and tab to another document type, then switch back from fullscreen mode, the menu does not change to the currently selected documents type. It's still the menu that was active when I entered fullscreen mode.
 
To switch between normal and fullscreen mode I use code found in the VisualStudion GUI example of the toollkit:
 
void CMainFrame::OnShowFullScreen()
{
bFullScreen_ ^= 1;
CXTPPropExchangeXMLNode px(FALSE, 0, _T("Settings"));
CXTPPropExchangeXMLNode* pxLayoutSave = DYNAMIC_DOWNCAST(CXTPPropExchangeXMLNode, px.GetSection(_T("FullScreenLayout")));
ASSERT(pxLayoutSave);
// Save current layout
if (pxLayoutSave != 0)
{
ExchangeLayout(pxLayoutSave, FALSE);
}
// If Full screen layout exists
if (pFullScreenLayout_.get() && pFullScreenLayout_->IsSectionExists(_T("CommandBars")))
{
// Set it
pFullScreenLayout_->SetLoading(TRUE);
ExchangeLayout(pFullScreenLayout_.get(), FALSE);
}
// Else create new fullscreen layout. Hide all toolbars and DockingPanes.
else
{
for (int i = 0; i < GetCommandBars()->GetCount(); i++)
{
CXTPToolBar* pToolBar = GetCommandBars()->GetAt(i);
pToolBar->SetVisible(/*(pToolBar->GetType() == xtpBarTypeMenuBar) || */(pToolBar->GetBarID() == IDR_TOOLBAR_FULLSCREEN));
if (pToolBar->IsVisible()) {
CXTPEmptyRect rect;
GetCommandBars()->DockCommandBar(pToolBar, rect, GetCommandBars()->GetDockBar(xtpBarTop));
}
}
_paneManager.CloseAll();
}
// Save old layout
pFullScreenLayout_.reset(pxLayoutSave);
if (bFullScreen_)
{
GetWindowRect(&rcMainFrame_);
ModifyStyle(WS_CAPTION|WS_THICKFRAME, 0);
// Now resize the main window
CRect rcScreen = XTPMultiMonitor()->GetScreenArea(this);
int cxBorder = ::GetSystemMetrics(SM_CXBORDER);
int cyBorder = ::GetSystemMetrics(SM_CYBORDER);
SetWindowPos(NULL, rcScreen.left - cxBorder, rcScreen.top - cyBorder,
rcScreen.Width() + cxBorder * 2, rcScreen.Height() + cyBorder * 2, SWP_NOZORDER);
m_wndStatusBar.ShowWindow(SW_HIDE);
}
else
{
ModifyStyle(0, WS_CAPTION|WS_THICKFRAME);
MoveWindow(&rcMainFrame_);
m_wndStatusBar.ShowWindow(SW_SHOW);
}
RecalcLayout(TRUE);
}
 
I know that it has something to do with storing/restoring the current layout, but I don't know how to react when the user tabs between documents.
Does anyone know what I have to do in this case?
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 10 March 2008 at 6:48am
Hi;
If someone is interrested in this:
 
Calling OnUpdateFrameMenu(0) after closing full screen mode did it.
 
Thanks to Oleg!
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022
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.109 seconds.