本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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);
}
}
}
}
}
}
}
示例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;
}
示例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 ) );
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例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;
};
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}