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


C++ CGeorgesEditDoc::modify方法代码示例

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


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

示例1: 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

示例2: setPredefToDocument

void CTypeDialog::setPredefToDocument ()
{
	CGeorgesEditDoc *doc = View->GetDocument ();
	if (doc)
	{
		CGeorgesEditDocSub *current = doc->getSelectedObject ();
		CString str;

		// Add the predef
		vector<vector<string> > stringVector;
		stringVector.resize (Predef.ListCtrl.GetItemCount());
		uint predef;
		for (predef=0; predef<(uint)Predef.ListCtrl.GetItemCount(); predef++)
		{
			stringVector[predef].resize (2);

			// Add the label and value
			str = Predef.ListCtrl.GetItemText (predef, 0);
			stringVector[predef][0] = (const char*)str;
			str = Predef.ListCtrl.GetItemText (predef, 1);
			stringVector[predef][1] = (const char*)str;
		}

		doc->modify (new CActionStringVectorVector (IAction::TypePredef, stringVector, *doc, 
			doc->getLeftView ()->getCurrentSelectionId (), 0));
	}
}
开发者ID:mixxit,项目名称:solinia,代码行数:27,代码来源:type_dialog.cpp

示例3: OnDelete

void CLeftView::OnDelete() 
{
	// Get tree selection
	HTREEITEM item = TreeCtrl.GetSelectedItem ();
	if (item)
	{
		// Edit the label ?
		CEdit *edit = TreeCtrl.GetEditControl();
		if (edit)
		{
			edit->SetWindowText ("");
		}
		else
		{
			// Get the sub object
			CGeorgesEditDocSub *subObject = (CGeorgesEditDocSub*)TreeCtrl.GetItemData (item);
			if (subObject)
			{
				// Editable ?
				if (subObject->isEditable ())
				{
					// Get some information about the current node
					bool deleteInsert = false;

					// Is a form child ?
					CGeorgesEditDocSub *parent = subObject->getParent ();
					if (parent && parent->getType () == CGeorgesEditDocSub::Form)
					{
						// Does the node in the same form ?
						CGeorgesEditDoc *doc = GetDocument ();
						if (doc)
						{
							// Get the parent node
							const CFormDfn *parentDfn;
							uint indexDfn;
							const CFormDfn *nodeDfn;
							const CType *nodeType;
							CFormElm *parentNode;
							UFormDfn::TEntryType type;
							bool array;
							bool parentVDfnArray;
							CForm *form=doc->getFormPtr ();
							CFormElm *elm = (CFormElm *)doc->getRootNode (subObject->getSlot ());
							nlverify ( elm->getNodeByName (parent->getFormName ().c_str (), &parentDfn, indexDfn, 
								&nodeDfn, &nodeType, &parentNode, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND) );

							// Is a non empty array ?
							if (array && parentNode)
							{
								// Document modified
								doc->modify (new CActionBuffer (IAction::FormArrayDelete, NULL, 0, *doc, subObject->getFormName ().c_str (), 
									toString (subObject->getIdInParent ()).c_str (), doc->getLeftView ()->getCurrentSelectionId (), subObject->getSlot ()));
							}
						}
					}
				}
			}
		}
	}
}
开发者ID:Kiddinglife,项目名称:ryzom,代码行数:60,代码来源:left_view.cpp

示例4: setTypeToDocument

void CTypeDialog::setTypeToDocument ()
{
	CGeorgesEditDoc *doc = View->GetDocument ();
	if (doc)
	{
		CGeorgesEditDocSub *current = doc->getSelectedObject ();
		
		doc->modify (new CActionString (IAction::TypeType, toString (ComboType.GetCurSel ()).c_str (), *doc, 
			"", "", doc->getLeftView ()->getCurrentSelectionId (), 0));
	}
}
开发者ID:mixxit,项目名称:solinia,代码行数:11,代码来源:type_dialog.cpp

示例5: setIncrementToDocument

void CTypeDialog::setIncrementToDocument ()
{
	CGeorgesEditDoc *doc = View->GetDocument ();
	if (doc)
	{
		CGeorgesEditDocSub *current = doc->getSelectedObject ();
		CString str;

		Increment.UpdateData ();
		Increment.GetWindowText (str);

		doc->modify (new CActionString (IAction::TypeIncrement, str, *doc, "", "",
			doc->getLeftView ()->getCurrentSelectionId (), 0));
	}
}
开发者ID:mixxit,项目名称:solinia,代码行数:15,代码来源:type_dialog.cpp

示例6: setUIToDocument

void CTypeDialog::setUIToDocument ()
{
	CGeorgesEditDoc *doc = View->GetDocument ();
	if (doc)
	{
		CGeorgesEditDocSub *current = doc->getSelectedObject ();
		int curSel = ComboUIType.GetCurSel ();
		if (curSel != CB_ERR)
		{
			curSel = (CType::TUI)ComboUIType.GetItemData (curSel);
		}
		else
		{
			curSel = CType::Edit;
		}

		doc->modify (new CActionString (IAction::TypeUI, toString (curSel).c_str (), *doc, "", "", 
			doc->getLeftView ()->getCurrentSelectionId (), 0));
	}
}
开发者ID:mixxit,项目名称:solinia,代码行数:20,代码来源:type_dialog.cpp

示例7: OnEditPaste

void CLeftView::OnEditPaste() 
{
	CGeorgesEditDoc *doc = (CGeorgesEditDoc*)GetDocument( );
	if (doc)
	{
		// What is selected ?
		HTREEITEM item = TreeCtrl.GetSelectedItem ();
		if (item != NULL)
		{
			// Edit the label ?
			CEdit *edit = TreeCtrl.GetEditControl();
			if (edit)
			{
				edit->SendMessage (WM_PASTE);
			}
			else
			{
				// Get the sub data
				CGeorgesEditDocSub *subData = (CGeorgesEditDocSub*)TreeCtrl.GetItemData (item);
				if (subData)
				{
					// Get thte node type
					CGeorgesEditDocSub::TSub subType = subData->getType ();

					// Good type for copy ?
					if (subType == CGeorgesEditDocSub::Form)
					{
						// Document is modified by this view
						if (theApp.FillMemStreamWithClipboard (subData->getFormName ().c_str(), doc, subData->getSlot ()))
						{
							doc->modify (new CActionBuffer (IAction::FormPaste, theApp.MemStream.buffer (), theApp.MemStream.length(), 
								*doc, subData->getFormName ().c_str(), "", doc->getLeftView ()->getCurrentSelectionId (), subData->getSlot ()));
						}
					}
				}
			}
		}
	}
}
开发者ID:Kiddinglife,项目名称:ryzom,代码行数:39,代码来源:left_view.cpp

示例8: OnNotify


//.........这里部分代码省略.........
					// Editable ?
					if (subObject->isEditable ())
					{
						// Get some information about the current node
						bool deleteInsert = false;

						// Is a form child ?
						CGeorgesEditDocSub *parent = subObject->getParent ();
						if (parent && parent->getType () == CGeorgesEditDocSub::Form)
						{
							// Does the node in the same form ?
							CGeorgesEditDoc *doc = GetDocument ();
							if (doc)
							{
								// Get the parent node
								const CFormDfn *parentDfn;
								uint indexDfn;
								const CFormDfn *nodeDfn;
								const CType *nodeType;
								CFormElm *parentNode;
								UFormDfn::TEntryType type;
								bool array;
								bool parentVDfnArray;
								CForm *form=doc->getFormPtr ();
								CFormElm *elm = (CFormElm *)doc->getRootNode (subObject->getSlot ());
								nlverify ( elm->getNodeByName (parent->getFormName ().c_str (), &parentDfn, indexDfn, 
									&nodeDfn, &nodeType, &parentNode, type, array, parentVDfnArray, true, NLGEORGES_FIRST_ROUND) );

								// Is a non empty array ?
								if (array && parentNode && (ptvdi->item.mask & TVIF_TEXT))
								{
									// Change the node name
									TreeCtrl.SetItemText (ptvdi->item.hItem, ptvdi->item.pszText);
									doc->modify (new CActionString (IAction::FormArrayRename, ptvdi->item.pszText, *doc, 
										subObject->getFormName ().c_str (), toString (subObject->getIdInParent ()).c_str(), 
										doc->getLeftView ()->getCurrentSelectionId (), subObject->getSlot ()));
									return TRUE;
								}
							}
						}
					}
				}
			}
			*pResult = 1;
			return TRUE;
		}
		break;
	case TVN_SELCHANGED:
		{ 
			LPNMTREEVIEW itemData = (LPNMTREEVIEW) lParam;  

			// Unbold old item
			if (itemData->itemOld.hItem)
				TreeCtrl.SetItemState(itemData->itemOld.hItem, 0, TVIS_BOLD);

			CGeorgesEditDoc *doc = GetDocument();
			if (doc)
			{
				CGeorgesEditDocSub *data = (CGeorgesEditDocSub *)TreeCtrl.GetItemData (itemData->itemNew.hItem);
				nlassert (data);
				doc->changeSubSelection (data, this);
				TreeCtrl.SetFocus ();
			}
		}
		break;
	case NM_RCLICK:
开发者ID:Kiddinglife,项目名称:ryzom,代码行数:67,代码来源:left_view.cpp

示例9: PutGroupText

// ---------------------------------------------------------------------------
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));
				}
			}
		}
	}
}
开发者ID:sythaeryn,项目名称:pndrpg,代码行数:65,代码来源:georges_implementation.cpp


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