Print Page | Close Window

Switching MDI menus in full screen mode

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=9784
Printed Date: 30 September 2024 at 3:22am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Switching MDI menus in full screen mode
Posted By: mgampi
Subject: Switching MDI menus in full screen mode
Date 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 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017



Replies:
Posted By: mgampi
Date 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 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017



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