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); }
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 (); }
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); } }
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(); }
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); } } } }
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(); } } } }
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); } } } } }
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); }
// --------------------------------------------------------------------------- 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); } } } } }
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); } } }
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()); } } }
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); }
CFusionDoc *CMainFrame::GetCurrentDoc ( void ) { CChildFrame* pActiveChild; CFusionDoc *pDoc; pDoc = NULL; pActiveChild =(CChildFrame *)this->MDIGetActive(); if (pActiveChild != NULL) { pDoc =(CFusionDoc*)pActiveChild->GetActiveDocument(); } return pDoc; }
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(); } } } }
void CMainFrame::OnView3dview() { CChildFrame *pChildFrame; CW3ZMapEditDoc *pDoc; pChildFrame = (CChildFrame*)MDIGetActive(); if (NULL != pChildFrame) { pDoc = (CW3ZMapEditDoc *)pChildFrame->GetActiveDocument(); pChildFrame = pDoc->Get3DChildFrame(); if (NULL != pChildFrame) { if (TRUE == pChildFrame->IsWindowVisible()) { pChildFrame->ShowWindow(SW_HIDE); } else { pChildFrame->ShowWindow(SW_SHOWNORMAL); } } } }
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("无法移动节点")); } } }
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); }
///////////////////////////////////////////////////////////////////////////// // switch to the new selected view tab ///////////////////////////////////////////////////////////////////////////// BOOL CBonfireDoc::SwitchToView(CString strTab) { if (strTab == "") return FALSE; CChildFrame* pChild = (CChildFrame*)g_pMainFrame->MDIGetActive(); if (!pChild || pChild->GetActiveDocument() != this) { POSITION pos = GetFirstViewPosition(); pChild = (CChildFrame*)GetNextView(pos)->GetParentFrame(); } if (!pChild) return FALSE; CView* pViewAdd = NULL; CBonfireView* pGlobalView = NULL; CBonfireView* pBNewView = NULL; // get the view to "hide" CView* pViewDel = pChild->GetActiveView(); // if we're already displaying this kind of view, no need to go further. for (int i = 0; i < theApp.m_arAllViews.GetSize(); i++) { if ( ((CBonfireView*)theApp.m_arAllViews[i])->m_strCaption.Compare(strTab) == 0 ) { pGlobalView = (CBonfireView*)theApp.m_arAllViews[i]; break; } } if ( pViewDel && pViewDel->IsKindOf(pGlobalView->m_pClass) ) return TRUE; // check if a view of this type already exists if ( !m_pViews->Lookup(pGlobalView->m_strCaption, (void*&)pBNewView) ) { // doesn't exist so create a new view pViewAdd = (CView*)pGlobalView->m_pClass->CreateObject(); if (pViewAdd == NULL) { TRACE1("Warning: Dynamic create of view type %Fs failed\n", pGlobalView->m_pClass->m_lpszClassName); return FALSE; } // draw new view CCreateContext context; context.m_pNewViewClass = pGlobalView->m_pClass; context.m_pCurrentDoc = NULL; context.m_pNewDocTemplate = this->GetDocTemplate(); context.m_pLastView = NULL; context.m_pCurrentFrame = pChild; // draw new view if (!pViewAdd->Create(NULL, NULL, AFX_WS_DEFAULT_VIEW, CRect(0, 0, 0, 0), pChild, AFX_IDW_PANE_FIRST, &context)) { TRACE0("Warning: couldn't create view for frame\n"); delete pViewAdd; return FALSE; } // add the view to the map pBNewView = new CBonfireView(pGlobalView); pBNewView->m_pView = pViewAdd; pBNewView->m_pClass = pViewAdd->GetRuntimeClass(); // add this view to the document's map AddViewToMap(pBNewView); // WM_INITIALUPDATE is defined in afxpriv.h pViewAdd->SendMessage(WM_INITIALUPDATE,0,0); // connect the view to the document AddView(pViewAdd); } else { pViewAdd = pBNewView->m_pView; } // save file on switching views if (theApp.m_opOptions.general.dwSaveOnSwitch && !m_xTextBuffer.GetReadOnly() && pViewDel) DoFileSave(); CSplitterWnd* pSplitter = NULL; POSITION pos = GetFirstViewPosition(); BOOL firstOne = true; while (pos) { CView* pv = GetNextView(pos); if (pv == pViewAdd) { pv->SetDlgCtrlID(AFX_IDW_PANE_FIRST); // show the view if (pBNewView->m_bAllowsSplitter) { pSplitter = (CSplitterWnd*)pViewAdd->GetParent(); // show the splitter (show the children view(s) as well) pSplitter->ShowWindow(SW_SHOW); } else // show the view pViewAdd->ShowWindow(SW_SHOW); } else { // check if the view is inside a splitter if (pv->GetParent()->GetRuntimeClass() == (CRuntimeClass*)RUNTIME_CLASS(CSplitterWnd)) { pSplitter = (CSplitterWnd*)pv->GetParent(); // hide the splitter (hide all views with the splitter) pSplitter->ShowWindow(SW_HIDE); } else { // hide the view pv->ShowWindow(SW_HIDE); pv->SetDlgCtrlID(AFX_IDW_PANE_FIRST + 255); } } TRACE("%s (%d) ", pv->GetRuntimeClass()->m_lpszClassName, (unsigned)(pv->GetDlgCtrlID() - AFX_IDW_PANE_FIRST)); if (pv == pViewDel) TRACE("= D "); if (pv == pViewAdd) TRACE("= A "); if (pv->GetRuntimeClass() == pGlobalView->m_pClass) { if (firstOne) firstOne = false; else TRACE("removing "); } } TRACE("\n"); // get rid of extra views created by the splitter if (pSplitter) { for (int cols = 1; cols < pSplitter->GetColumnCount(); cols++) pSplitter->DeleteColumn(cols); for (int rows = 1; rows < pSplitter->GetRowCount(); rows++) pSplitter->DeleteRow(rows); pSplitter->RecalcLayout(); } pViewAdd->UpdateWindow(); pChild->SetActiveView(pViewAdd); pChild->RecalcLayout(); if (pBNewView->m_bModifiedSinceRefresh) { pBNewView->m_bModifiedSinceRefresh = FALSE; if (pGlobalView->m_pClass == RUNTIME_CLASS(CXMLTreeView)) { ((CXMLTreeView*)pViewAdd)->RefreshView(); } else if (pGlobalView->m_pClass == RUNTIME_CLASS(CBrowserView)) { ((CBrowserView*)pViewAdd)->RefreshView(); } else { pBNewView->m_bModifiedSinceRefresh = TRUE; } } return TRUE; }
// This handles overall tab updates. NEEDS TO BE CALLED RIGHT AFTER DOCUMENT CREATION! void CFusionTabControls::UpdateTabs() { CFusionDoc * pDoc = NULL; CChildFrame * pActiveChild ; int UpdateBrushEntity =1; int UpdateTexture =1; pActiveChild = (CChildFrame *)m_pMainFrame->MDIGetActive() ; if(pActiveChild != NULL) { pDoc = (CFusionDoc*) pActiveChild->GetActiveDocument() ; } if (pActiveChild == NULL || pDoc == NULL ) { // There are no open documents right now... return; // command failed } // Let's create the tab dialogs for the first time if not done so... if( m_pBrushEntityDialog == NULL ) { m_pBrushEntityDialog = new CBrushEntityDialog( this, pDoc ); UpdateBrushEntity = 0; } else { // Let's make it invisible... m_pBrushEntityDialog->ShowWindow( SW_HIDE ); } if( m_pTextureDialog == NULL ) { m_pTextureDialog = new CTextureDialog( this, pDoc ); UpdateTexture = 0; } if(ConTab==NULL) { ConTab=new CConsoleTab(this, pDoc); } if(GrpTab==NULL) { GrpTab=new CBrushGroupDialog(this, pDoc); } if( ModelTab==NULL ) { ModelTab=new CModelDialog( this ) ; ModelTab->Create( IDD_MODELKEY, this ) ; } if (SkyTab == NULL) { SkyTab = new CSkyDialog (this, pDoc); } ConTab->ShowWindow(SW_HIDE); ConTab->SetConHwnd(); GrpTab->ShowWindow(SW_HIDE); ModelTab->ShowWindow(SW_HIDE); SkyTab->ShowWindow (SW_HIDE); // This one should always be invisible. Even to start out with... m_pTextureDialog->ShowWindow( SW_HIDE ); // Update all tabs... ModelTab->Update(pDoc, Level_GetModelInfo (pDoc->pLevel)) ; m_pBrushEntityDialog->Update( pDoc ); m_pTextureDialog->Update( pDoc ); GrpTab->UpdateTabDisplay(pDoc); SkyTab->Update (pDoc); // Which tab do we show..? switch( m_CurrentTab ) { case BRUSH_ENTITY_TAB: if( UpdateBrushEntity ) { // Make it visible... m_pBrushEntityDialog->ShowWindow( SW_SHOW ); } break; case TEXTURE_TAB: if( UpdateTexture ) { // Make it visible... m_pTextureDialog->ShowWindow( SW_SHOW ); } break; case GROUP_TAB: GrpTab->ShowWindow(SW_SHOW); break; case CONSOLE_TAB: ConTab->ShowWindow( SW_SHOW ); break; case MODEL_TAB: ModelTab->ShowWindow( SW_SHOW ) ; break ; case SKY_TAB : SkyTab->ShowWindow (SW_SHOW); break; } }
// --------------------------------------------------------------------------- void CGeorgesImpl::PutGroupText (const std::vector<std::string>& _vText, bool append) { 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) ); // Is a type entry ? if ((type == UFormDfn::EntryType) && array) { std::string formName = subDoc->getFormName (); uint slot = subDoc->getSlot (); // Current node size uint size = 0; if (node) { CFormElmArray *arrayPtr = safe_cast<CFormElmArray*>(node); nlverify (arrayPtr->getArraySize (size)); } // Modify the size of the array char value[512]; smprintf (value, 512, "%d", _vText.size () + ((append)?size:0)); doc->modify (new CActionBuffer (IAction::FormArraySize, NULL, 0, *doc, formName.c_str (), value, doc->getLeftView ()->getCurrentSelectionId (), slot)); uint i; for (i=0; i<_vText.size (); i++) { uint index = i + ((append)?size:0); std::string formNameAtom = formName + "[" + toString (index) + "]"; doc->modify (new CActionString (IAction::FormTypeValue, _vText[i].c_str (), *doc, formNameAtom.c_str (), "", doc->getLeftView ()->getCurrentSelectionId (), slot)); doc->modify (new CActionString (IAction::FormArrayRename, _vText[i].c_str(), *doc, formNameAtom.c_str (), toString (index).c_str (), doc->getLeftView ()->getCurrentSelectionId (), slot)); } } } } }