/****************************************************************************** Function Name : vDisplayWarningLineNumber Input(s) : eMESSAGEFROM eMsgFrom, UINT unLineNo Output : - Functionality : Scrolls to the line number spaecified and highlights the same. Member of : CFileView Friend of : - Author(s) : Date Created : ******************************************************************************/ void CFileView::vDisplayWarningLineNumber( eMESSAGEFROM eMsgFrom, UINT unLineNo) { // Get document CFunctionEditorDoc* pomSrcFileDoc = omGetDocument(); // Doc is valid if(pomSrcFileDoc != nullptr) { // Main frame is valid and // function called from COutWnd class if (eMsgFrom == OUTWND) { // Get child window, active may be // "COutWnd" CFrameWnd* pMainFrame = (CFrameWnd*)CWnd::FromHandle(CGlobalObj::sm_hWndMDIParentFrame); CMDIChildWnd* pChild = ( CMDIChildWnd*) pMainFrame->GetActiveFrame(); CString omStrText = ""; BOOL bInLoop = TRUE; do { // Get next window pChild = (CEditFrameWnd*) pChild->GetWindow(GW_HWNDNEXT); if(pChild != nullptr ) { // Get Window caption pChild->GetWindowText(omStrText); // check the title of child window, // if matches, activate my window it if (omStrText == omGetDocument()->GetTitle()) { bInLoop = FALSE; } } else { bInLoop = FALSE; } } while (bInLoop); if (pChild != nullptr) { pChild->MDIActivate(); } } // Update document with the line no pomSrcFileDoc->m_lCurrentWarningLineNum = unLineNo; // Scroll to the line specified vGoToLine( unLineNo ); // refresh the view Invalidate(TRUE); } // end of if(pomSrcFileDoc) }
void CMDITabsDialogBar::_GoBackForward(bool fForward) { CFrameWnd *pBack = _GetNextPrev(fForward); if (pBack) { _fNavigatingViaTravelLog = true; CMDIChildWnd *pActive = static_cast<CMDIChildWnd*>(pBack); pActive->MDIActivate(); _fNavigatingViaTravelLog = false; } }
void CMDITabsDialogBar::OnSelChange(NMHDR *pnmhdr, LRESULT *lResult) { int iActive = GetCurSel(); if (iActive != -1) { TCITEM tcitem; tcitem.mask = TCIF_PARAM; if (GetItem(iActive, &tcitem)) { CMDIChildWnd *pActive = reinterpret_cast<CMDIChildWnd*>(tcitem.lParam); //pActive->ActivateFrame(); // This glitches maximized windows, so use MDIActivate pActive->MDIActivate(); } } }