本文整理汇总了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);
}
示例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 ();
}
示例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);
}
}
示例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();
}
示例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);
}
}
}
}
示例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();
}
}
}
}
示例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);
}
}
}
}
}
示例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);
}
示例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);
}
}
}
}
}
示例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);
}
}
}
示例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());
}
}
}
示例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);
}
示例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();
}
}
}
}
示例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("无法移动节点"));
}
}
}
示例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);
}