当前位置: 首页>>代码示例>>C++>>正文


C++ CDocument::GetFirstViewPosition方法代码示例

本文整理汇总了C++中CDocument::GetFirstViewPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ CDocument::GetFirstViewPosition方法的具体用法?C++ CDocument::GetFirstViewPosition怎么用?C++ CDocument::GetFirstViewPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CDocument的用法示例。


在下文中一共展示了CDocument::GetFirstViewPosition方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CreateDocumentWindow

CBCGPMDIChildWnd* CMainFrame::CreateDocumentWindow (LPCTSTR lpcszDocName, CObject* /*pObj*/)
{
    if (lpcszDocName != NULL && lpcszDocName [0] != '\0')
    {
        CDocument* pDoc = AfxGetApp()->OpenDocumentFile (lpcszDocName);

        if (pDoc != NULL)
        {
            POSITION pos = pDoc->GetFirstViewPosition();

            if (pos != NULL)
            {
                CView* pView = pDoc->GetNextView (pos);
                if (pView == NULL)
                {
                    return NULL;
                }

                return DYNAMIC_DOWNCAST (CBCGPMDIChildWnd, pView->GetParent ());
            }
        }
    }

    return NULL;
}
开发者ID:zxlooong,项目名称:bcgexp,代码行数:25,代码来源:MainFrm.cpp

示例2: RestoreDeviceObjects

HRESULT CDxtexApp::RestoreDeviceObjects(VOID)
{
    // Tell each view of each doc to restore
    POSITION pos = GetFirstDocTemplatePosition();
    CDocTemplate* pDocTemplate = GetNextDocTemplate( pos );

    pos = pDocTemplate->GetFirstDocPosition();
    for( ; ; )
    {
        CDocument* pDoc = NULL;
        if( pos == NULL )
            break;
        pDoc = pDocTemplate->GetNextDoc( pos );
        if( pDoc == NULL )
            break;
        POSITION posView;
        CDxtexView* pView = NULL;
        posView = pDoc->GetFirstViewPosition();
        for( ; ; )
        {
            if( posView == NULL )
                break;
            pView = (CDxtexView*)pDoc->GetNextView( posView );
            if( pView == NULL )
                break;
            pView->RestoreDeviceObjects();
        }
    }
    return S_OK;
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:30,代码来源:dxtex.cpp

示例3: SendMessageToView

// 在 Frame中发消息给View 
U32 CPluginApp_i::SendMessageToView(UINT ulMsg, WPARAM wParam, LPARAM lParam) 
{
  CWinApp* pWinApp = AfxGetApp();
  if(pWinApp)
  {
    POSITION DocTemplatePos = pWinApp->GetFirstDocTemplatePosition();
  
    //while(DocTemplatePos)
    {
	    CMultiDocTemplate* pDocTemp = (CMultiDocTemplate*)pWinApp->GetNextDocTemplate(DocTemplatePos);
    
      //  
 	    POSITION pos = pDocTemp->GetFirstDocPosition ();
  
      // Find the doc within the same doctemplate.
      while (pos)
      {
	      CDocument* pDoc     = pDocTemp->GetNextDoc (pos);
	      POSITION ViewPos    = pDoc->GetFirstViewPosition ();
	      CView* pView        = pDoc->GetNextView (ViewPos);
        if(pView)
        {
          CMDIChildWnd* pFrame = (CMDIChildWnd*)pView->GetParentFrame();
          if(pFrame == this)
          {
            //OutputDebugString("Find!\n");
            pView->SendMessage(ulMsg, wParam, lParam);
          } 
        }
      }
    }
  }
  
  return 0;
}
开发者ID:fre2003,项目名称:l3220,代码行数:36,代码来源:CPluginApp.cpp

示例4: OnWorkOffline

void CMainFrame::OnWorkOffline()
{
    CBCGPIE7DemoView::m_bWorkOffline = !CBCGPIE7DemoView::m_bWorkOffline;

    POSITION posTemplate = theApp.m_pDocManager->GetFirstDocTemplatePosition ();
    while (posTemplate != NULL)
    {
        CDocTemplate* pTemplate = theApp.m_pDocManager->GetNextDocTemplate (posTemplate);
        if (pTemplate != NULL)
        {
            POSITION posDocument = pTemplate->GetFirstDocPosition ();
            while (posDocument != NULL)
            {
                CDocument* pDocument = 	pTemplate->GetNextDoc (posDocument);
                if (pDocument != NULL)
                {
                    POSITION posView = pDocument->GetFirstViewPosition ();
                    while (posView != NULL)
                    {
                        CHtmlView* pView = DYNAMIC_DOWNCAST(CHtmlView, pDocument->GetNextView (posView));
                        if (pView != NULL)
                        {
                            pView->SetOffline (CBCGPIE7DemoView::m_bWorkOffline);
                        }
                    }
                }
            }
        }
    }
}
开发者ID:zxlooong,项目名称:bcgexp,代码行数:30,代码来源:MainFrm.cpp

示例5:

// @pymethod [<o PyCView>,...]|PyCDocument|GetAllViews|Returns a list of all views for the current document.
PyObject *
ui_doc_get_all_views(PyObject *self, PyObject *args)
{
	CDocument *pDoc;
	if (!(pDoc=PyCDocument::GetDoc(self)))
		return NULL;
	CHECK_NO_ARGS2(args,GetAllViews);
	PyObject *retList = PyList_New(0);
	GUI_BGN_SAVE;
	POSITION pos = pDoc->GetFirstViewPosition(); // @pyseemfc CDocument|GetFirstViewPosition
	GUI_END_SAVE;
	while (pos!=NULL) {
		GUI_BGN_SAVE;
		CView *pWnd = pDoc->GetNextView( pos );      // @pyseemfc CDocument|GetNextView
		GUI_END_SAVE;
		ASSERT(pWnd);	// shouldnt be possible.
		if (pWnd==NULL) {
			Py_DECREF(retList);
			RETURN_ERR("No view was available!");
		}
		PyObject *newObj = ui_assoc_object::make(UITypeFromCObject(pWnd), pWnd)->GetGoodRet();
		if (newObj==NULL) {
			Py_DECREF(retList);
			return NULL;
		}
		PyList_Append(retList, newObj);
		Py_DECREF(newObj);
	}
	return retList;
}
开发者ID:malrsrch,项目名称:pywin32,代码行数:31,代码来源:win32doc.cpp

示例6: while

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 ) );
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:34,代码来源:docmangr.cpp

示例7: OnViewDeletedrecords

void CMainFrame::OnViewDeletedrecords() 
{
	m_bShowDeletedRecords = !m_bShowDeletedRecords;
	
	CWinApp* pApp = AfxGetApp();
	ASSERT_VALID(pApp);

	// Iterate through the application's document templates list
	POSITION posTemplate = pApp->GetFirstDocTemplatePosition();
	while(posTemplate)
	{
		// For each document template object...
		CDocTemplate* pTemplate = pApp->GetNextDocTemplate(posTemplate);
		ASSERT_VALID(pTemplate);
		ASSERT_KINDOF(CDocTemplate, pTemplate);

		// Iterate through the template's document list
		POSITION posDocument = pTemplate->GetFirstDocPosition();
		while(posDocument)
		{
			// For each document object...
			CDocument* pDoc = pTemplate->GetNextDoc(posDocument);
			ASSERT_VALID(pDoc);
			ASSERT_KINDOF(CDocument, pDoc);

			// reload records
			POSITION pos = pDoc->GetFirstViewPosition();
			while (pos)
				((CDBFExplorerView *)pDoc->GetNextView(pos))->ShowRecords(m_bShowDeletedRecords);
		}
	}
}
开发者ID:tchv71,项目名称:StartPP,代码行数:32,代码来源:MainFrm.cpp

示例8: OpenView

CDrawProgView* Project::OpenView(INXString depFilename) {
	CDocument* Subsystem = AfxGetApp( )->OpenDocumentFile(depFilename);		
	// Need to initialise undo for case when the view is already open
	POSITION pos = Subsystem->GetFirstViewPosition();
	CDrawProgView* pView = (CDrawProgView*) Subsystem->GetNextView(pos);
	//pView->initUndo();
	return pView;
}
开发者ID:pdrezet,项目名称:brix,代码行数:8,代码来源:Project.cpp

示例9: gotkid

int CGuiApp::gotkid(CMultiDocTemplate *p)
{
  POSITION pdoc = p->GetFirstDocPosition();
  if (pdoc) {
    CDocument *doc = p->GetNextDoc(pdoc);
    POSITION p =  doc->GetFirstViewPosition();
    return p !=0;
  }
  return 0;
}
开发者ID:kjseefried,项目名称:pm3,代码行数:10,代码来源:gui.cpp

示例10: OpenPocket

int OpenPocket(   const vector<CRossPocketItem>& UnitNos,
			  CString    Title) 
{

	CDocTemplate* tmpl = GetRossPocketTemplate();;

	CDocument* pDocument = tmpl->CreateNewDocument();

	if (pDocument == NULL)
	{
		TRACE0("CDocTemplate::CreateNewDocument returned NULL.\n");
		AfxMessageBox(AFX_IDP_FAILED_TO_CREATE_DOC);
		return false;
	}

    ASSERT_VALID(pDocument);

	pDocument->m_bAutoDelete = FALSE;   // don't destroy if something goes wrong
	CFrameWnd* pFrame = tmpl->CreateNewFrame(pDocument, NULL);
	pDocument->m_bAutoDelete = TRUE;
	if (pFrame == NULL)
	{
		AfxMessageBox(AFX_IDP_FAILED_TO_CREATE_DOC);
		delete pDocument;       // explicit delete on error
		return FALSE;
	};

	ASSERT_VALID(pFrame);

	pDocument->SetPathName(CString("An entry subset by  ")+Title);
	

	// open an existing document
	tmpl->InitialUpdateFrame(pFrame, pDocument, TRUE);

	POSITION pos =  pDocument->GetFirstViewPosition();
	CPocketForm* V = (CPocketForm*)(pDocument->GetNextView(pos));
	V->m_PocketItems = UnitNos;
    V->m_WordList.InsertColumn(1,"Словарный вход", LVCFMT_LEFT, 200);
	V->m_WordList.InsertColumn(2,"Номер значения", LVCFMT_LEFT, 60);
	V->m_WordList.InsertColumn(2,"Название словаря", LVCFMT_LEFT, 60);
	V->m_WordList.SetItemCountEx(UnitNos.size());
	V->m_UnitsSize.Format ("Число словарных входов : %i",    V->m_WordList.GetItemCount());
    V->UpdateData(FALSE);
    V->m_WordList.UpdateData(FALSE);
    V->m_WordList.Invalidate();	
	V->m_Title = Title;

	// установка размеров
	V->GetParent()->SetWindowPos(NULL, 0,0, 535 , 500, SWP_SHOWWINDOW|SWP_NOZORDER|SWP_NOMOVE);
	return true;
};
开发者ID:deNULL,项目名称:seman,代码行数:52,代码来源:PocketForm.cpp

示例11: GetActiveWnd

CWnd* WPhonePlugin::GetActiveWnd(CMultiDocTemplate* doc)
{
	CWnd* pView = NULL;
	POSITION posdoc = doc->GetFirstDocPosition();
	while(posdoc != NULL)
	{
		CDocument* pdoc = doc->GetNextDoc(posdoc);
		POSITION posview = pdoc->GetFirstViewPosition();
		pView = (pdoc->GetNextView(posview));
	}

	return pView;
}
开发者ID:diduoren,项目名称:youeryuan,代码行数:13,代码来源:WPhonePlugin.cpp

示例12:

CMDIChildWnd *CMDIChildIter::GetNextChild()
{
	CDocument	*pDoc = m_DocIter.GetNextDoc();
	if (pDoc != NULL) {
		POSITION	pos = pDoc->GetFirstViewPosition();
		if (pos != NULL) {
			CView	*pView = pDoc->GetNextView(pos);
			if (pView != NULL)
				return(DYNAMIC_DOWNCAST(CMDIChildWnd, pView->GetParentFrame()));
		}
	}
	return(NULL);
}
开发者ID:victimofleisure,项目名称:WaveShop,代码行数:13,代码来源:DocIter.cpp

示例13: GetView

CWordPadView* CEmbeddedItem::GetView() const
{
	CDocument* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	POSITION pos = pDoc->GetFirstViewPosition();
	if (pos == NULL)
		return NULL;

	CWordPadView* pView = (CWordPadView*)pDoc->GetNextView(pos);
	ASSERT_VALID(pView);
	ASSERT(pView->IsKindOf(RUNTIME_CLASS(CWordPadView)));
	return pView;
}
开发者ID:jetlive,项目名称:skiaming,代码行数:13,代码来源:srvritem.cpp

示例14: newwin

void CGuiApp::newwin(CMultiDocTemplate *p)
{
  POSITION pdoc = p->GetFirstDocPosition();
  if (pdoc) {
    CDocument *doc = p->GetNextDoc(pdoc);
    POSITION pos =  doc->GetFirstViewPosition();
    if (pos) {
      raisekids(p);
      return ;
    }
  }
  p->OpenDocumentFile(NULL);
  raisekids(p);
}
开发者ID:kjseefried,项目名称:pm3,代码行数:14,代码来源:gui.cpp

示例15: GetMineView

CMineView* CMainFrame::GetMineView() {
	CView* view = NULL;
	CDocument* doc = GetActiveDocument();
	if (doc)
	{
		POSITION pos = doc->GetFirstViewPosition();
		while (pos != NULL)
		{
			view = (CMineView *)doc->GetNextView(pos);
			if (view->IsKindOf(RUNTIME_CLASS(CMineView))) break;
		}
		ASSERT(view->IsKindOf(RUNTIME_CLASS(CMineView)));
	}
	return (CMineView *)view;
}
开发者ID:paud,项目名称:d2x-xl,代码行数:15,代码来源:mainfrm.cpp


注:本文中的CDocument::GetFirstViewPosition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。