void CCompositeView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint) { CChildFrame* pFrame = DYNAMIC_DOWNCAST( CChildFrame, GetParentFrame() ); if( !pFrame || !pFrame->IsWindowVisible() ) return; if( !GetDVController() ) return; // update the comparison doc detail sand frame CString csTitleBarText; CString csComparisonDoc = GetDVController()->GetComparisonDocController().GetComparisonDocumentTitle(); if (pFrame && !csComparisonDoc.IsEmpty()) { // do not keep setting the title text to the same stuff as it forces the tabctrl to relayout and repaint CString existingText; pFrame->GetWindowText(existingText); if (existingText != csComparisonDoc) { pFrame->GetDocument()->SetTitle(csComparisonDoc); if (csComparisonDoc.GetLength()>40) { csComparisonDoc = csComparisonDoc.Left(32); csComparisonDoc.TrimRight(L" "); csComparisonDoc += L"..."; } pFrame->SetWindowText(csComparisonDoc); } } else { // do not keep setting the title text to the same stuff as it forces the tabctrl to relayout and repaint CString existingText; pFrame->GetWindowText(existingText); if (existingText!= GetApplicationTitle()) pFrame->SetWindowText(GetApplicationTitle()); } try { if (GetDocObject()) GetDocObject()->Repaint(); } catch (...) { _ASSERTE(!_T("Catch ... How did we get here?")); } UpdateWindow(); }
void CMainFrame::OnUpdateView3dview(CCmdUI *pCmdUI) { CChildFrame *pChildFrame; CW3ZMapEditDoc *pDoc; pChildFrame = (CChildFrame*)MDIGetActive(); if (NULL != pChildFrame) { pDoc = (CW3ZMapEditDoc *)pChildFrame->GetActiveDocument(); pChildFrame = pDoc->Get3DChildFrame(); if (NULL != pChildFrame) { pCmdUI->SetCheck(pChildFrame->IsWindowVisible()); } } }
void CMainFrame::OnView3dview() { CChildFrame *pChildFrame; CW3ZMapEditDoc *pDoc; pChildFrame = (CChildFrame*)MDIGetActive(); if (NULL != pChildFrame) { pDoc = (CW3ZMapEditDoc *)pChildFrame->GetActiveDocument(); pChildFrame = pDoc->Get3DChildFrame(); if (NULL != pChildFrame) { if (TRUE == pChildFrame->IsWindowVisible()) { pChildFrame->ShowWindow(SW_HIDE); } else { pChildFrame->ShowWindow(SW_SHOWNORMAL); } } } }