Example #1
0
void CAutoClickDoc::ShowWindow()
{
	POSITION pos = GetFirstViewPosition();
	CView* pView = GetNextView(pos);
	if (pView != NULL)
	{
		CFrameWnd* pFrameWnd = pView->GetParentFrame();
		pFrameWnd->ActivateFrame(SW_SHOW);
		pFrameWnd = pFrameWnd->GetParentFrame();
		if (pFrameWnd != NULL)
			pFrameWnd->ActivateFrame(SW_SHOW);
	}
}
void CMsgView::OnContextMenu(CWnd *pWnd, CPoint point) 
{
    CFrameWnd *pFrame;
    CMenu menu;
    CMenu *pPopupMenu;
    int nStart;
    int nEnd;
    UINT uiEnable;

    // make sure window is active

    pFrame = GetParentFrame ();
    ASSERT (pFrame != NULL);
    if (pFrame != NULL)
    {
        pFrame->ActivateFrame ();
    };

    if (!menu.LoadMenu (IDR_COMPILEVW_POPUP))
    {
        return;
    }
    pPopupMenu = menu.GetSubMenu (0);
    ASSERT (pPopupMenu != NULL);
    if (pPopupMenu == NULL)
    {
        return;
    }
    GetEditCtrl().GetSel(nStart, nEnd);
    uiEnable = (nStart == nEnd) ? MF_DISABLED | MF_GRAYED : MF_ENABLED;
    pPopupMenu->EnableMenuItem(IDM_MSG_COPY, uiEnable);
    pPopupMenu->TrackPopupMenu (TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, this);
}
Example #3
0
CDocument *CDocManager::OpenDocumentFile( LPCTSTR lpszFileName )
/**************************************************************/
{
    POSITION                    position = m_templateList.GetHeadPosition();
    CDocTemplate                *pSelected = NULL;
    CDocTemplate::Confidence    nSelConfidence = CDocTemplate::noAttempt;
    while( position != NULL ) {
        CDocTemplate *pTemplate = (CDocTemplate *)m_templateList.GetNext( position );
        ASSERT( pTemplate != NULL );
        
        CDocument                   *pMatch = NULL;
        CDocTemplate::Confidence    nConfidence = pTemplate->MatchDocType( lpszFileName,
                                                                           pMatch );
        if( nConfidence > nSelConfidence ) {
            nSelConfidence = nConfidence;
            pSelected = pTemplate;
            if( nConfidence == CDocTemplate::yesAlreadyOpen ) {
                ASSERT( pMatch != NULL );
                POSITION viewPos = pMatch->GetFirstViewPosition();
                if( viewPos != NULL ) {
                    CView *pView = pMatch->GetNextView( viewPos );
                    CFrameWnd *pFrame = pView->GetParentFrame();
                    ASSERT( pFrame != NULL );
                    pFrame->ActivateFrame();
                }
                return( pMatch );
            }
        }
    }
    if( pSelected == NULL ) {
        return( NULL );
    }
    return( pSelected->OpenDocumentFile( lpszFileName ) );
}
Example #4
0
// ****************************************************************************
//
//  Function Name:	RWindowView::ActivateView( )
//
//  Description:		Activate the view
//
//  Returns:			Nothing
//
//  Exceptions:		None
//
// ****************************************************************************
//
void RWindowView::ActivateView( )
	{
	GetCWnd( ).SetForegroundWindow( );
	CFrameWnd*	pParentFrame	= GetCWnd( ).GetParentFrame();
	if( pParentFrame->GetParentFrame( ) )
		if ( pParentFrame->GetParentFrame( )->GetActiveFrame() != pParentFrame )
			pParentFrame->ActivateFrame( );
	}
Example #5
0
void CGuiApp:: raisekids(CMultiDocTemplate *doc_temp)
{
  POSITION pos_doc_temp = doc_temp->GetFirstDocPosition();
  while (pos_doc_temp) {
    CDocument *doc = doc_temp->GetNextDoc(pos_doc_temp);
    POSITION p =  doc->GetFirstViewPosition();
    while (p)
      {
	CView *view = doc->GetNextView (p);
	//      view->GetParentFrame()->SetParent(crap);
	CFrameWnd *f = (CFrameWnd *)(view->GetParentFrame());
	f->ActivateFrame(SW_SHOWNORMAL);
      } 
  }
}
Example #6
0
void CNTU_OCCT_v2Doc::ActivateFrame(CRuntimeClass* pViewClass,int nCmdShow)
{
	POSITION position = GetFirstViewPosition();
	while (position != (POSITION)NULL)
	{
		CView* pCurrentView = (CView*)GetNextView(position);
		if(pCurrentView->IsKindOf(pViewClass) )
		{
			ASSERT_VALID(pCurrentView);
			CFrameWnd* pParentFrm = pCurrentView->GetParentFrame();
			ASSERT(pParentFrm != (CFrameWnd *)NULL);
			// simply make the frame window visible
			pParentFrm->ActivateFrame(nCmdShow);
		}
	}
}