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


C++ CChildFrame::GetActiveDocument方法代码示例

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


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

示例1: OnBnClickedButtonPlay

void CMainFrame::OnBnClickedButtonPlay()
{
	CRecordeOperatorDoc* pDoc = NULL;
	CChildFrame* pChild = NULL;
	pChild = (CChildFrame*)GetActiveFrame();
	if (!pChild)
		return;
	pDoc = (CRecordeOperatorDoc*)pChild->GetActiveDocument();
	if (!pDoc)
		return;
	IERecPlayer* pRecord = pDoc->GetRecord();
	if (pRecord)
	{
		if (pRecord->RePlay() == S_OK)
		{
			m_wndProgressDialogBar.m_buttonPlay.SetWindowText("Pause");
		}
		else if (pRecord->PauseRePlay() == S_OK)
		{
			m_wndProgressDialogBar.m_buttonPlay.SetWindowText("Play");
		}
	}
	else
		MessageBox("»¹Î´°ó¶¨Â¼Ïñ¶ÔÏó£¡","ѽ",MB_OK);
}
开发者ID:viticm,项目名称:pap2,代码行数:25,代码来源:MainFrm.cpp

示例2:

void CMainFrame::UpdateActiveDoc
	(
	  void
	)
{
	CChildFrame	*pActiveChild	=(CChildFrame *)this->MDIGetActive();
	if(pActiveChild)
	{
		CFusionDoc	*pDoc		=(CFusionDoc*)pActiveChild->GetActiveDocument();

		// update groups tab
		if(pDoc)
		{
			if(m_wndTabControls)
			{
				if(m_wndTabControls->GrpTab)
				{
					m_wndTabControls->GrpTab->UpdateTabDisplay(pDoc);
				}
			}
			LoadComboBox() ;
		}
	}
	// update models list box
	this->UpdateModelsDialog ();
}
开发者ID:RealityFactory,项目名称:Genesis3D-Tools,代码行数:26,代码来源:MainFrm.cpp

示例3: OnSelChangedTree

void CMainFrame::OnSelChangedTree(NMHDR* pNMHDR, LRESULT* pResult)
{
	NMTREEVIEW* pTreeView = (NMTREEVIEW*)pNMHDR;
	HTREEITEM hSelected = pTreeView->itemNew.hItem;	
	int nDeep = 0;
	HTREEITEM hTempItem = m_wndMasterlistDialogBar.m_treeMasters.GetParentItem(hSelected);
	while (hTempItem)
	{
		nDeep++;
		hTempItem = m_wndMasterlistDialogBar.m_treeMasters.GetParentItem(hTempItem);
	}
	DWORD_PTR pPoint = m_wndMasterlistDialogBar.m_treeMasters.GetItemData(hSelected); 
	CRecordeOperatorDoc* pDoc = NULL;
	CChildFrame* pChild = NULL;
	pChild = (CChildFrame*)GetActiveFrame();
	if (!pChild)
		return;
	pDoc = (CRecordeOperatorDoc*)pChild->GetActiveDocument();
	if (!pDoc)
		return;
	IERecPlayer* pRecord = pDoc->GetRecord();
	if (pRecord)
	{
		g_RecordUITools.FillListCtrl(pRecord, nDeep,pPoint,m_wndMasterlistDialogBar.m_listCtrl);
	}
}
开发者ID:viticm,项目名称:pap2,代码行数:26,代码来源:MainFrm.cpp

示例4: ApplyNodesChange

void CMainFrame::ApplyNodesChange(LGeometryData::NodesConstIterator it,
	double x, double y, LGeometryData::EBoundaryType bnd, 
	bool delete_all_containing )
{
	CGeometry2dView* pView = NULL;
	CGeometry2dDoc* pDoc = NULL;

	POSITION pos;
		
	CChildFrame* pChild = static_cast<CChildFrame*>(MDIGetActive());
	if ( pChild )
	{
		pDoc = static_cast<CGeometry2dDoc*>(pChild->GetActiveDocument());
		if ( pDoc )
		{
			pos = pDoc->GetFirstViewPosition();
			if ( pos )
			{
				pView = static_cast<CGeometry2dView*>(pDoc->GetNextView(pos));
				if ( pView )
				{
					pDoc->PrepareUndo();
					pDoc->GetData().SetCoordinates(it,x,y);
					pDoc->GetData().SetBoundary(it,bnd);
					if ( delete_all_containing )
						pDoc->GetData().RemoveAllContainingNode(it);
					pView->PrepareBuffer();
					pView->RedrawWindow();
					return;
				}
			}
		}
	}	
	UnsetNodeForProperties();
}
开发者ID:fourier,项目名称:Geometry2d,代码行数:35,代码来源:MainFrm.cpp

示例5: OnExpandingTree

void  CMainFrame::OnExpandingTree(NMHDR* pNMHDR, LRESULT* pResult)
{
	NMTREEVIEW* pTreeView = (NMTREEVIEW*)pNMHDR;
	HTREEITEM hSelected = pTreeView->itemNew.hItem;
	if (pTreeView->action == TVE_EXPAND)
	{		
		int nDeep = 0;
		HTREEITEM hTempItem = m_wndMasterlistDialogBar.m_treeMasters.GetParentItem(hSelected);
		while (hTempItem)
		{
			nDeep++;
			hTempItem = m_wndMasterlistDialogBar.m_treeMasters.GetParentItem(hTempItem);
		}
		if (nDeep == 2)
		{
			CRecordeOperatorDoc* pDoc = NULL;
			CChildFrame* pChild = NULL;
			pChild = (CChildFrame*)GetActiveFrame();
			if (!pChild)
				return;
			pDoc = (CRecordeOperatorDoc*)pChild->GetActiveDocument();
			if (!pDoc)
				return;
			IERecPlayer* pRecord = pDoc->GetRecord();
			if (pRecord)
			{
				g_RecordUITools.FillEvent(pRecord, 
					hSelected, 
					m_wndMasterlistDialogBar.m_treeMasters);
			}
		}

	}
}
开发者ID:viticm,项目名称:pap2,代码行数:34,代码来源:MainFrm.cpp

示例6: AdjustLayout

void CFileView::AdjustLayout()
{
	if (GetSafeHwnd() == NULL)
	{
		return;
	}

	CMainFrame * pFrame = DYNAMIC_DOWNCAST(CMainFrame, AfxGetMainWnd());
	if(pFrame)
	{
		CChildFrame * pChildFrame = DYNAMIC_DOWNCAST(CChildFrame, pFrame->MDIGetActive());
		if(pChildFrame)
		{
			CImgRegionDoc * pDoc = DYNAMIC_DOWNCAST(CImgRegionDoc, pChildFrame->GetActiveDocument());
			if(pDoc && pDoc->m_TreeCtrl.m_hWnd)
			{
				CRect rectClient;
				GetClientRect(rectClient);

				pDoc->m_TreeCtrl.SetWindowPos(
					&wndTop, rectClient.left, rectClient.top, rectClient.Width(), rectClient.Height(), 0);

				pDoc->m_TreeCtrl.Invalidate();
			}
		}
	}
}
开发者ID:howardgao-mt,项目名称:myd3dlib,代码行数:27,代码来源:FileView.cpp

示例7: ChangeProperties

void CMainFrame::ChangeProperties(short scale, CGeometry2dView::ENodeDrawingMode mode,
	LGeometryData::EBoundaryCondition cond)
{
	CGeometry2dView* pView = NULL;
	CGeometry2dDoc* pDoc = NULL;

	POSITION pos;
		
	CChildFrame* pChild = static_cast<CChildFrame*>(MDIGetActive());
	if ( pChild )
	{
		pDoc = static_cast<CGeometry2dDoc*>(pChild->GetActiveDocument());
		if ( pDoc )
		{
			pos = pDoc->GetFirstViewPosition();
			if ( pos )
			{
				pView = static_cast<CGeometry2dView*>(pDoc->GetNextView(pos));
				if ( pView )
				{
					m_wndInBarProperties.SetScale(scale);
					m_wndInBarProperties.SetNodeDrawingMode(mode);
					m_wndInBarProperties.SetBoundaryConditions(cond);
					pView->GeometryProperties(scale,mode,cond);
				}
			}
		}
	}
}
开发者ID:fourier,项目名称:Geometry2d,代码行数:29,代码来源:MainFrm.cpp

示例8: PreTranslateMessage

BOOL CFileView::PreTranslateMessage(MSG* pMsg)
{
	CMainFrame * pFrame = DYNAMIC_DOWNCAST(CMainFrame, AfxGetMainWnd());
	ASSERT(pFrame);

	CChildFrame * pChildFrame = DYNAMIC_DOWNCAST(CChildFrame, pFrame->MDIGetActive());
	if(pChildFrame)
	{
		CImgRegionDoc * pDoc = DYNAMIC_DOWNCAST(CImgRegionDoc, pChildFrame->GetActiveDocument());
		if(pDoc)
		{
			switch(pMsg->message)
			{
			case WM_KEYDOWN:
				switch(pMsg->wParam)
				{
				case VK_INSERT:
					pDoc->OnAddRegion();
					return TRUE;

				case VK_DELETE:
					pDoc->OnDelRegion();
					return TRUE;
				}
				break;
			}
		}
	}

	return CDockablePane::PreTranslateMessage(pMsg);
}
开发者ID:howardgao-mt,项目名称:myd3dlib,代码行数:31,代码来源:FileView.cpp

示例9: PutText

// ---------------------------------------------------------------------------
void CGeorgesImpl::PutText (const std::string& _sText)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
	CMainFrame *pWnd = dynamic_cast< CMainFrame* >( theApp.m_pMainWnd );
	CChildFrame *pChild = (CChildFrame*)pWnd->MDIGetActive ();
	if (pChild == NULL) return;
	// Get active document
	CGeorgesEditDoc *doc = (CGeorgesEditDoc *)pChild->GetActiveDocument();
	if (doc)
	{
		// Get the left view
		CLeftView* pView = doc->getLeftView ();

		// Check type
		CGeorgesEditDocSub *subDoc = doc->getSelectedObject ();
		if (subDoc)
		{
			// Get the node
			const CFormDfn *parentDfn;
			uint indexDfn;
			const CFormDfn *nodeDfn;
			const CType *nodeType;
			CFormElm *node;
			UFormDfn::TEntryType type;
			bool array;
			bool parentVDfnArray;
			CForm *form=doc->getFormPtr ();
			CFormElm *elm = doc->getRootNode (subDoc->getSlot ());
			nlverify ( elm->getNodeByName (subDoc->getFormName ().c_str (), &parentDfn, indexDfn, &nodeDfn, &nodeType, &node, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND) );

			// It is an array ?
			if (array&&(type == UFormDfn::EntryType))
			{
				// Modify the node
				doc->modify (new CActionString (IAction::FormTypeValue, _sText.c_str(), *doc, subDoc->getFormName ().c_str (),  "",
					doc->getLeftView ()->getCurrentSelectionId (), subDoc->getSlot ()));
				doc->modify (new CActionString (IAction::FormArrayRename, _sText.c_str(), *doc, subDoc->getFormName ().c_str (), 
					toString (subDoc->getIdInParent ()).c_str (), doc->getLeftView ()->getCurrentSelectionId (), subDoc->getSlot ()));
				doc->updateDocumentStructure ();
				doc->UpdateAllViews (pView);
			}
			else if ((UFormDfn::EntryDfn)&&(!array))
			{
				// Get the right view
				CGeorgesEditView* view = doc->getRightView ();
				if (view->FormDialog.WidgetFocused != 0xffffffff)
				{
					// Set the string
					doc->modify (new CActionString (IAction::FormValue, _sText.c_str(), *doc, 
						view->FormDialog.Widgets[view->FormDialog.WidgetFocused]->getFormName ().c_str (),  "",
						doc->getLeftView ()->getCurrentSelectionId (), subDoc->getSlot ()));
					doc->updateDocumentStructure ();
					doc->UpdateAllViews (pView);
				}
			}
		}
	}
}
开发者ID:sythaeryn,项目名称:pndrpg,代码行数:59,代码来源:georges_implementation.cpp

示例10: OnPlugins

void CMainFrame::OnPlugins()
{
	if ((IDOK == m_dlgRunPluginDialog.DoModal()) && ("" != m_dlgRunPluginDialog.m_strSelectedPluginName))
	{
		CChildFrame		*pChildFrame;
		CW3ZMapEditDoc	*pDoc;
		pChildFrame = (CChildFrame*)MDIGetActive();
		if (NULL != pChildFrame)
		{
			pDoc = (CW3ZMapEditDoc *)pChildFrame->GetActiveDocument();
			pDoc->RunPlugin(m_dlgRunPluginDialog.m_strSelectedPluginName);
		}
	}
}
开发者ID:Amrf000,项目名称:War3-Jass,代码行数:14,代码来源:MainFrm.cpp

示例11:

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());
		}
	}
}
开发者ID:Amrf000,项目名称:War3-Jass,代码行数:15,代码来源:MainFrm.cpp

示例12: OnReleaseCapture

void CMainFrame::OnReleaseCapture(NMHDR* pNMHDR, LRESULT* pResult)
{
	int nRunTime = m_wndProgressDialogBar.m_sliderProgress.GetPos();
	g_bSlider = TRUE;
	CRecordeOperatorDoc* pDoc = NULL;
	CChildFrame* pChild = NULL;
	pChild = (CChildFrame*)GetActiveFrame();
	if (!pChild)
		return;
	pDoc = (CRecordeOperatorDoc*)pChild->GetActiveDocument();
	if (!pDoc)
		return;
	IERecPlayer* pRecord = pDoc->GetRecord();
	if (pRecord)
		pRecord->StepToEvent(nRunTime);

}
开发者ID:viticm,项目名称:pap2,代码行数:17,代码来源:MainFrm.cpp

示例13: OnTvnSelchangedTree

afx_msg void CFileView::OnTvnSelchangedTree(UINT id, NMHDR *pNMHDR, LRESULT *pResult)
{
	LPNMTREEVIEW ptv = (LPNMTREEVIEW)pNMHDR;
	if(ptv->action != TVC_UNKNOWN)
	{
		CMainFrame * pFrame = DYNAMIC_DOWNCAST(CMainFrame, AfxGetMainWnd());
		ASSERT(pFrame);
		CChildFrame * pChildFrame = DYNAMIC_DOWNCAST(CChildFrame, pFrame->MDIGetActive());
		if(pChildFrame)
		{
			CImgRegionDoc * pDoc = DYNAMIC_DOWNCAST(CImgRegionDoc, pChildFrame->GetActiveDocument());
			if(pDoc)
			{
				pDoc->UpdateAllViews(NULL);

				pFrame->m_wndProperties.InvalidProperties();
			}
		}
	}
}
开发者ID:howardgao-mt,项目名称:myd3dlib,代码行数:20,代码来源:FileView.cpp

示例14: OnTvnDragchangedTree

afx_msg void CFileView::OnTvnDragchangedTree(UINT id, NMHDR *pNMHDR, LRESULT *pResult)
{
	CDragableTreeCtrl::NMTREEVIEWDRAG * pDragInfo = reinterpret_cast<CDragableTreeCtrl::NMTREEVIEWDRAG *>(pNMHDR);
	ASSERT(pDragInfo);

	CDragableTreeCtrl * pTreeCtrl = DYNAMIC_DOWNCAST(CDragableTreeCtrl, GetDlgItem(id));
	ASSERT(pTreeCtrl);

	CMainFrame * pFrame = DYNAMIC_DOWNCAST(CMainFrame, AfxGetMainWnd());
	ASSERT(pFrame);

	CChildFrame * pChildFrame = DYNAMIC_DOWNCAST(CChildFrame, pFrame->MDIGetActive());
	if(pChildFrame)
	{
		CImgRegionDoc * pDoc = DYNAMIC_DOWNCAST(CImgRegionDoc, pChildFrame->GetActiveDocument());
		if(pDoc && &pDoc->m_TreeCtrl == pTreeCtrl)
		{
			if(pTreeCtrl->CanItemMove(pDragInfo->hDragTagParent, pDragInfo->hDragTagFront, pDragInfo->hDragItem))
			{
				UINT newParentID = pDragInfo->hDragTagParent ? pDoc->GetItemId(pDragInfo->hDragTagParent) : 0;
				UINT newBeforeID = pDragInfo->hDragTagFront ? pDoc->GetItemId(pDragInfo->hDragTagFront) : 0;
				HistoryPtr hist(new HistoryMovRegion(
					pDoc, pDoc->GetItemId(pDragInfo->hDragItem), newParentID, newBeforeID));

				pDoc->AddNewHistory(hist);
				hist->Do();

				pDoc->UpdateAllViews(NULL);

				pDoc->SetModifiedFlag();

				pFrame->m_wndProperties.InvalidProperties();
			}
			else
				MessageBox(_T("无法移动节点"));
		}
	}
}
开发者ID:howardgao-mt,项目名称:myd3dlib,代码行数:38,代码来源:FileView.cpp

示例15: OnBnClickedButtonFree

void CMainFrame::OnBnClickedButtonFree()
{
	CRecordeOperatorDoc* pDoc = NULL;
	CChildFrame* pChild = NULL;
	pChild = (CChildFrame*)GetActiveFrame();
	if (!pChild)
		return;
	pDoc = (CRecordeOperatorDoc*)pChild->GetActiveDocument();
	if (!pDoc)
		return;
	IERecPlayer* pRecord = pDoc->GetRecord();
	if (pRecord)
	{
		if (pRecord->FreeCamera() == S_OK)
		{
			if (pRecord->IsFreeCamera())
				m_wndProgressDialogBar.m_buttonFreeCamera.SetWindowText("RestoreCamera");
			else
				m_wndProgressDialogBar.m_buttonFreeCamera.SetWindowText("FreeCamera");
		}
	}
	else
		MessageBox("»¹Î´°ó¶¨Â¼Ïñ¶ÔÏó£¡","ѽ",MB_OK);
}
开发者ID:viticm,项目名称:pap2,代码行数:24,代码来源:MainFrm.cpp


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