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


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

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


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

示例1: update

void IAction::update (bool updateLeftView, TUpdateRightView rightViewFlag, CGeorgesEditDoc &doc, const char *_FormName)
{
	// Right and left view
	CGeorgesEditView *rightView = doc.getRightView ();
	nlassert (rightView);
	CLeftView *leftView = doc.getLeftView ();
	nlassert (leftView);

	// Update left view ?
	if (updateLeftView)
		doc.updateDocumentStructure ();

	// Set the current view..
	uint subSelection = leftView->getCurrentSelectionId ();
	if (subSelection != _SelId)
	{
		doc.changeSubSelection (_SelId, NULL);
		return;
	}

	if (leftView->getCurrentSelectionId () == 1)
	{
		rightView->HeaderDialog.getFromDocument (*doc.getHeaderPtr ());
	}
	else if (doc.isType ())
	{
		rightView->TypeDialog.getFromDocument (*(doc.getTypePtr()));
	}
	else if (doc.isDfn ())
	{
		rightView->DfnDialog.getFromDocument (*(doc.getDfnPtr()));
	}
	else if (doc.isForm ())
	{
		if (rightViewFlag == DoNothing)
		{
		}
		else if (rightViewFlag == UpdateLabels)
		{
			rightView->FormDialog.updateLabels ();
		}
		else if (rightViewFlag == UpdateValues)
		{
			rightView->FormDialog.updateValues ();
		}
		else if (rightViewFlag == Redraw)
		{
			rightView->FormDialog.getFromDocument ();
		}
	}
}
开发者ID:mixxit,项目名称:solinia,代码行数:51,代码来源:action.cpp

示例2: doAction

bool CActionStringVectorVector::doAction (CGeorgesEditDoc &doc, bool redo, bool &modified, bool firstTime)
{
	IAction::doAction (doc, redo, modified, firstTime);

	modified = false;
	bool ok = true;
	uint index = (uint)redo;

	// Backup old value
	switch (_Type)
	{
	case DfnStructure:
		{
			// Dfn
			NLGEORGES::CFormDfn &dfn = *(doc.getDfnPtr ());

			// Add the entries
			dfn.setNumEntry (_Value[index].size ());
			uint elm;
			for (elm=0; elm<_Value[index].size (); elm++)
			{
				// Ref on the entry
				CFormDfn::CEntry &entry = dfn.getEntry (elm);

				// Get the name
				entry.setName (_Value[index][elm][0].c_str ());

				// Get the filename
				string &filename = _Value[index][elm][2];

				// Get the type
				string &type= _Value[index][elm][1];
				if ((type == "Type") || (type == "Type array"))
				{
					// Set the type
					entry.setType (doc.FormLoader, filename.c_str ());

					// Set the default value
					string &def = _Value[index][elm][3];
					entry.setDefault (def.c_str ());

					// Set the default extension
					string &ext = _Value[index][elm][4];
					entry.setFilenameExt (ext.c_str ());
				}
				else if ((type == "Dfn") || (type == "Dfn array"))
				{
					// Set the type
					entry.setDfn (doc.FormLoader, filename.c_str ());
				}
				else if (type == "Virtual Dfn")
				{
					// Set the type
					entry.setDfnPointer ();
				}
				entry.setArrayFlag ((type == "Type array") || (type == "Dfn array"));
			}
			modified = true;
			if (!firstTime)
				update (false, Redraw, doc, "");
		}
		break;
	case TypePredef:
		{
			// Type
			CType &type = *(doc.getTypePtr ());

			// Add the predef
			type.Definitions.resize (_Value[index].size ());
			uint predef;
			for (predef=0; predef<type.Definitions.size(); predef++)
			{
				// Add the label and value
				type.Definitions[predef].Label = _Value[index][predef][0];
				type.Definitions[predef].Value = _Value[index][predef][1];
			}
			modified = true;
			if (!firstTime)
				update (false, Redraw, doc, "");
		}
		break;
	default:
		nlstop;
	}

	return ok;
}
开发者ID:mixxit,项目名称:solinia,代码行数:87,代码来源:action.cpp

示例3: IAction

CActionStringVectorVector::CActionStringVectorVector (IAction::TTypeAction type, const std::vector<std::vector<std::string> > &stringVector, 
													  CGeorgesEditDoc &doc, uint selId, uint slot) : IAction (type, selId, slot)
{
	// Set the new value
	_NewValue = stringVector;

	// Backup old value
	switch (_Type)
	{
	case DfnStructure:
		{
			// Dfn
			const NLGEORGES::CFormDfn &dfn = *(doc.getDfnPtr ());

			// Add the struct element
			_OldValue.resize (dfn.getNumEntry ());
			uint elm;
			for (elm=0; elm<_OldValue.size (); elm++)
			{
				// Resize the entry
				_OldValue[elm].resize (5);

				// Add the label and value
				_OldValue[elm][0] = dfn.getEntry (elm).getName ();
				switch (elm, dfn.getEntry (elm).getType ())
				{
				case UFormDfn::EntryType:
					_OldValue[elm][1] = dfn.getEntry (elm).getArrayFlag () ? "Type array" : "Type";
					_OldValue[elm][4] = dfn.getEntry (elm).getFilenameExt ();
					break;
				case UFormDfn::EntryDfn:
					_OldValue[elm][1] = dfn.getEntry (elm).getArrayFlag () ? "Dfn array" : "Dfn";
					break;
				case UFormDfn::EntryVirtualDfn:
					_OldValue[elm][1] = "Virtual Dfn";
					break;
				}
				_OldValue[elm][2] = dfn.getEntry (elm).getFilename ();
				_OldValue[elm][3] = dfn.getEntry (elm).getDefault ();
			}
			setLabel ("Dfn Structure", doc);
		}
		break;
	case TypePredef:
		{
			// Type
			const NLGEORGES::CType &type = *(doc.getTypePtr ());

			uint predef;
			_OldValue.resize (type.Definitions.size());
			for (predef=0; predef<_OldValue.size(); predef++)
			{
				// Add the label and value
				_OldValue[predef].resize (2);
				_OldValue[predef][0] = type.Definitions[predef].Label;
				_OldValue[predef][1] = type.Definitions[predef].Value;
			}
			setLabel ("Type Predef", doc);
		}
		break;
	}
}
开发者ID:mixxit,项目名称:solinia,代码行数:62,代码来源:action.cpp


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