void CContentView::OnActivateView( BOOL bActivate, CView* pActivateView, CView* pDeactiveView ) { CView *pView = (CView*)GetDescendantWindow( NC_IDW_OUTLINER ); // The default implementation is to give the focus to RDF tree view( NC_IDW_OUTLINER). // If we can not find a RDF tree view, we will call the base class to set focus properly. if (pView) pView->SetFocus(); else CView::OnActivateView(bActivate, pActivateView,pDeactiveView); }
void CSideBar::SwitchFocusBack() { CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd; // Get the active MDI child window. CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame(); // Get the active view attached to the active MDI child // window. CView *pView = pChild->GetActiveView(); pView->SetFocus(); }
void CContentView::OnSetFocus ( CWnd * pOldWnd ) { CView *pView = (CView*)GetDescendantWindow( NC_IDW_OUTLINER ); if (pView) pView->SetFocus(); }