本文整理汇总了C++中CChildFrame::MDIMaximize方法的典型用法代码示例。如果您正苦于以下问题:C++ CChildFrame::MDIMaximize方法的具体用法?C++ CChildFrame::MDIMaximize怎么用?C++ CChildFrame::MDIMaximize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CChildFrame
的用法示例。
在下文中一共展示了CChildFrame::MDIMaximize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShowStaticView
BOOL CStaticDoc::ShowStaticView( CRuntimeClass * pViewClass, BOOL bMaximized )
{
if( NULL == pViewClass )
return FALSE;
CChildFrame * pChildFrame = NULL;
POSITION pos = GetFirstViewPosition( );
CView * pView = NULL;
while( pView = GetNextView(pos) )
{
if( pView->IsKindOf( pViewClass ) )
{
pChildFrame = DYNAMIC_DOWNCAST( CChildFrame, pView->GetParentFrame() );
ASSERT( pChildFrame );
if( pChildFrame )
break;
}
}
if( NULL == pChildFrame )
{
// create frame
pChildFrame = CChildFrame::CreateNewFrame( this );
ASSERT( pChildFrame );
if( pChildFrame )
{
// create view
CCreateContext context;
context.m_pCurrentDoc = this;
context.m_pCurrentFrame = pChildFrame;
context.m_pLastView = NULL;
context.m_pNewDocTemplate = NULL;
context.m_pNewViewClass = pViewClass;
CView * pNewView = DYNAMIC_DOWNCAST(CView,pChildFrame->CreateView( &context, AFX_IDW_PANE_FIRST));
if( pNewView )
{
pChildFrame->SetActiveView( pNewView );
pNewView->OnInitialUpdate( );
}
// if no active child frame, maximize this frame
CMainFrame * pMainFrame = AfxGetMainFrame();
if( pMainFrame )
{
CFrameWnd * pActiveFrame = AfxGetMainFrame()->GetActiveFrame();
if( !pActiveFrame || !pActiveFrame->IsKindOf(RUNTIME_CLASS(CChildFrame)) )
pChildFrame->MDIMaximize();
}
}
}
if( pChildFrame )
{
// activate it
pChildFrame->MDIActivate();
if( bMaximized )
pChildFrame->MDIMaximize();
else
pChildFrame->ShowWindow( SW_SHOW );
}
return TRUE;
}