|
// MDIChildFrameImpl.cpp: implementation of the CMDIChildFrameImpl class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "MDIChildFrameImpl.h"
#include "View.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CView* CMDIFrameBase::GetActiveView()
{
return m_pViewActive;
}
CDocument* CMDIFrameBase::GetActiveDocument()
{
CView* pView = GetActiveView();
return pView != NULL ? pView->GetDocument() : NULL;
}
void CMDIFrameBase::SetActiveView(CView* pViewNew, BOOL bNotify)
{
CView* pViewOld = m_pViewActive;
if (pViewNew == pViewOld)
return; // do not re-activate if SetActiveView called more than once
// deactivate the old one
if (pViewOld != NULL)
pViewOld->OnActivateView(FALSE, pViewNew, pViewOld);
// if the OnActivateView moves the active window,
// that will veto this change
if (m_pViewActive != NULL)
return; // already set
m_pViewActive = pViewNew;
// activate
if (pViewNew != NULL && bNotify)
pViewNew->OnActivateView(TRUE, pViewNew, pViewOld);
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Jozef Božek is currently a software engineer at bring-it-together s.r.o. in area of large scale infomation systems and mobile applications development.
He has been developing in C++ nearly full time since 2000, in Java since 2004 and in Objective-C since 2009. He is programming using Java EE SDK, iOS SDK, COM/DCOM, MFC, ATL, STL and so on