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


C++ SimpleState::set方法代码示例

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


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

示例1: clearHorizontals

void GuideManagerCore::clearHorizontals(GuideType type)
{
	switch (type)
	{
		case Standard:
			if (undoManager->undoEnabled())
			{
				for (int i = 0; i < horizontalStdG.count(); ++i)
				{
					SimpleState* ss = new SimpleState(Um::DelVGuide, 0, Um::IGuides);
					ss->set("REMOVE_H", horizontalStdG[i]);
					undoManager->action(m_page, ss);
				}
			}
			horizontalStdG.clear();
			break;
		case Auto:
			if (undoManager->undoEnabled())
			{
				SimpleState * ss = new SimpleState(Um::DelHAGuide, 0, Um::IGuides);
				ss->set("REMOVE_HA_GAP", m_horizontalAutoGap);
				ss->set("REMOVE_HA_COUNT", m_horizontalAutoCount);
				ss->set("REMOVE_HA_REFER", m_horizontalAutoRefer);
				undoManager->action(m_page, ss);
			}

			m_horizontalAutoGap = 0.0;
			m_horizontalAutoCount= 0;
			m_horizontalAutoRefer = 0;
			horizontalAutoG.clear();
			break;
	}
}
开发者ID:avary,项目名称:scribus,代码行数:33,代码来源:guidemanagercore.cpp

示例2: clearVerticals

void GuideManagerCore::clearVerticals(GuideType type)
{
	switch (type)
	{
		case Standard:
			if (m_undoManager->undoEnabled())
			{
				for (int i = 0; i < m_verticalStdG.count(); ++i)
				{
					SimpleState* ss = new SimpleState(Um::DelVGuide, nullptr, Um::IGuides);
					ss->set("REMOVE_V", m_verticalStdG[i]);
					m_undoManager->action(m_page, ss);
				}
			}
			m_verticalStdG.clear();
			break;
		case Auto:
			if (m_undoManager->undoEnabled())
			{
				SimpleState * ss = new SimpleState(Um::DelVAGuide, nullptr, Um::IGuides);
				ss->set("REMOVE_VA_GAP", m_verticalAutoGap);
				ss->set("REMOVE_VA_COUNT", m_verticalAutoCount);
				ss->set("REMOVE_VA_REFER", m_verticalAutoRefer);
				m_undoManager->action(m_page, ss);
			}

			m_verticalAutoGap = 0.0;
			m_verticalAutoCount = 0;
			m_verticalAutoRefer = 0;
			m_verticalAutoG.clear();
			break;
	}
}
开发者ID:luzpaz,项目名称:scribus,代码行数:33,代码来源:guidemanagercore.cpp

示例3: writeUnstyled

void gtAction::writeUnstyled(const QString& text)
{
	UndoTransaction* activeTransaction = NULL;
	if (isFirstWrite)
	{
		if (!doAppend)
		{
			if (UndoManager::undoEnabled())
				activeTransaction = new UndoTransaction(undoManager->beginTransaction(Um::Selection, Um::IGroup, Um::ImportText, "", Um::IDelete));
			if (it->nextInChain() != 0)
			{
				PageItem *nextItem = it->nextInChain();
				while (nextItem != 0)
				{
					nextItem->itemText.selectAll();
					nextItem->asTextFrame()->deleteSelectedTextFromFrame();
					nextItem = nextItem->nextInChain();
				}
			}
			it->itemText.selectAll();
			it->asTextFrame()->deleteSelectedTextFromFrame();
		}
	}

	QChar ch0(0), ch5(5), ch10(10), ch13(13);
	QString textStr = text;
	textStr.remove(ch0);
	textStr.remove(ch13);
	textStr.replace(ch10,ch13);
	textStr.replace(ch5,ch13);
	textStr.replace(QString(0x2028),SpecialChars::LINEBREAK);
	textStr.replace(QString(0x2029),SpecialChars::PARSEP);
	int pos = it->itemText.length();
	if (UndoManager::undoEnabled())
	{
		SimpleState *ss = new SimpleState(Um::AppendText,"",Um::ICreate);
			ss->set("INSERT_FRAMETEXT", "insert_frametext");
			ss->set("TEXT_STR",textStr);
			ss->set("START", pos);
			undoManager->action(it, ss);
	}
	it->itemText.insertChars(pos, textStr);
	lastCharWasLineChange = text.right(1) == "\n";
	isFirstWrite = false;
	if (activeTransaction)
	{
		activeTransaction->commit();
		delete activeTransaction;
		activeTransaction = NULL;
	}
}
开发者ID:piksels-and-lines-orchestra,项目名称:scribus,代码行数:51,代码来源:gtaction.cpp

示例4: moveVertical

void GuideManagerCore::moveVertical(double from, double to, GuideType type)
{
	switch (type)
	{
		case Standard:
			m_verticalStdG.removeAt(m_verticalStdG.indexOf(from));
			m_verticalStdG.append(to);
			if (UndoManager::undoEnabled())
			{
				SimpleState* ss = new SimpleState(Um::MoveVGuide, nullptr, Um::IGuides);
				ss->set("MOVE_V_FROM", from);
				ss->set("MOVE_V_TO", to);
				m_undoManager->action(m_page, ss);
			}
			break;
		case Auto:
			break;
	}
}
开发者ID:luzpaz,项目名称:scribus,代码行数:19,代码来源:guidemanagercore.cpp

示例5: deleteVertical

void GuideManagerCore::deleteVertical(double value, GuideType type)
{
	switch (type)
	{
		case Standard:
			m_verticalStdG.removeAt(m_verticalStdG.indexOf(value));
			if (UndoManager::undoEnabled())
			{
				SimpleState* ss = new SimpleState(Um::DelVGuide, nullptr, Um::IGuides);
				ss->set("REMOVE_V", value);
				m_undoManager->action(m_page, ss);
			}
			break;
		case Auto:
			break;
	}
}
开发者ID:luzpaz,项目名称:scribus,代码行数:17,代码来源:guidemanagercore.cpp

示例6: addHorizontal

void GuideManagerCore::addHorizontal(double value, GuideType type)
{
	switch (type)
	{
		case Standard:
			if (!m_horizontalStdG.contains(value))
			{
				m_horizontalStdG.append(value);
				if (UndoManager::undoEnabled())
				{
					SimpleState* ss = new SimpleState(Um::AddHGuide, nullptr, Um::IGuides);
					ss->set("ADD_H", value);
					m_undoManager->action(m_page, ss);
				}
			}
			break;
		case Auto:
			break;
	}
}
开发者ID:luzpaz,项目名称:scribus,代码行数:20,代码来源:guidemanagercore.cpp

示例7: addVertical

void GuideManagerCore::addVertical(double value, GuideType type)
{
	switch (type)
	{
		case Standard:
			if (!verticalStdG.contains(value))
			{
				verticalStdG.append(value);
				if (UndoManager::undoEnabled())
				{
					SimpleState* ss = new SimpleState(Um::AddVGuide, 0, Um::IGuides);
					ss->set("ADD_V", value);
					undoManager->action(m_page, ss);
				}
			}
			break;
		case Auto:
			break;
	}
}
开发者ID:avary,项目名称:scribus,代码行数:20,代码来源:guidemanagercore.cpp

示例8: applyValues

void CanvasMode_EditSpiral::applyValues(double start, double end, double factor)
{
	PageItem *currItem = m_doc->m_Selection->itemAt(0);
	PageItem_Spiral *item = currItem->asSpiral();
	SimpleState *ss = new SimpleState(Um::EditSpiral, "", Um::IPolygon);
	ss->set("SPIRAL","spiral");
	ss->set("OLD_START",item->spiralStartAngle);
	ss->set("OLD_END",item->spiralEndAngle);
	ss->set("OLD_FACTOR",item->spiralFactor);
	item->spiralStartAngle = computeRealAngle(start, true);
	item->spiralEndAngle = computeRealAngle(end, true);
	item->spiralFactor = factor;
	ss->set("NEW_START",item->spiralStartAngle);
	ss->set("NEW_END",item->spiralEndAngle);
	ss->set("NEW_FACTOR",item->spiralFactor);
	undoManager->action(item,ss);
	item->recalcPath();
	m_startPoint = currItem->PoLine.pointQF(0);
	m_endPoint = currItem->PoLine.pointQF(currItem->PoLine.size() - 2);
	m_startAngle = item->spiralStartAngle;
	m_endAngle = item->spiralEndAngle;
	QTransform itemMatrix = currItem->getTransform();
	m_doc->regionsChanged()->update(itemMatrix.mapRect(QRectF(0, 0, currItem->width(), currItem->height())).adjusted(-5, -5, 10, 10));
}
开发者ID:gyuris,项目名称:scribus,代码行数:24,代码来源:canvasmode_editspiral.cpp

示例9: writeUnstyled

void gtAction::writeUnstyled(const QString& text, bool isNote)
{
	UndoTransaction activeTransaction;
	if (isFirstWrite && it->itemText.length() > 0)
	{
		if (!doAppend)
		{
			if (UndoManager::undoEnabled())
				activeTransaction = undoManager->beginTransaction(Um::Selection, Um::IGroup, Um::ImportText, "", Um::IDelete);
			if (it->nextInChain() != 0)
			{
				PageItem *nextItem = it->nextInChain();
				while (nextItem != 0)
				{
					nextItem->itemText.selectAll();
					nextItem->asTextFrame()->deleteSelectedTextFromFrame();
					nextItem = nextItem->nextInChain();
				}
			}
			it->itemText.selectAll();
			it->asTextFrame()->deleteSelectedTextFromFrame();
		}
	}

	QChar ch0(0), ch5(5), ch10(10), ch13(13);
	QString textStr = text;
	textStr.remove(ch0);
	textStr.remove(ch13);
	textStr.replace(ch10,ch13);
	textStr.replace(ch5,ch13);
	textStr.replace(QString(0x2028),SpecialChars::LINEBREAK);
	textStr.replace(QString(0x2029),SpecialChars::PARSEP);
	if (isNote)
	{
		if (note == NULL)
		{
			note = it->m_Doc->newNote(it->m_Doc->m_docNotesStylesList.at(0));
			Q_ASSERT(noteStory == NULL);
			noteStory = new StoryText(it->m_Doc);
		}
		if (textStr == SpecialChars::OBJECT)
		{
			NotesStyle* nStyle = note->notesStyle();
			QString label = "NoteMark_" + nStyle->name();
			if (nStyle->range() == NSRsection)
				label += " in section " + it->m_Doc->getSectionNameForPageIndex(it->OwnPage) + " page " + QString::number(it->OwnPage +1);
			else if (nStyle->range() == NSRpage)
				label += " on page " + QString::number(it->OwnPage +1);
			else if (nStyle->range() == NSRstory)
				label += " in " + it->firstInChain()->itemName();
			else if (nStyle->range() == NSRframe)
				label += " in frame" + it->itemName();
			if (it->m_Doc->getMark(label + "_1", MARKNoteMasterType) != NULL)
				getUniqueName(label,it->m_Doc->marksLabelsList(MARKNoteMasterType), "_"); //FIX ME here user should be warned that inserted mark`s label was changed
			else
				label = label + "_1";
			Mark* mrk = it->m_Doc->newMark();
			mrk->label = label;
			mrk->setType(MARKNoteMasterType);
			mrk->setNotePtr(note);
			note->setMasterMark(mrk);
			if (noteStory->text(noteStory->length() -1) == SpecialChars::PARSEP)
				noteStory->removeChars(noteStory->length() -1, 1);
			note->setSaxedText(saxedText(noteStory));
			mrk->setString("");
			mrk->OwnPage = it->OwnPage;
			it->itemText.insertMark(mrk);
			if (UndoManager::undoEnabled())
			{
				ScItemsState* is = new ScItemsState(UndoManager::InsertNote);
				is->set("ETEA", mrk->label);
				is->set("MARK", QString("new"));
				is->set("label", mrk->label);
				is->set("type", (int) MARKNoteMasterType);
				is->set("strtxt", QString(""));
				is->set("nStyle", nStyle->name());
				is->set("at", it->itemText.cursorPosition() -1);
				is->insertItem("inItem", it);
				undoManager->action(it->m_Doc, is);
			}
			note = NULL;
			delete noteStory;
		}
		else
			noteStory->insertChars(noteStory->length(), textStr);
	}
	else
	{
		int pos = it->itemText.length();
		if (UndoManager::undoEnabled())
		{
			SimpleState *ss = new SimpleState(Um::AppendText,"",Um::ICreate);
			ss->set("INSERT_FRAMETEXT", "insert_frametext");
			ss->set("TEXT_STR",textStr);
			ss->set("START", pos);
			undoManager->action(it, ss);
		}
		it->itemText.insertChars(pos, textStr);
	}
	lastCharWasLineChange = text.right(1) == "\n";
//.........这里部分代码省略.........
开发者ID:WOF-Softwares,项目名称:ScribusCTL,代码行数:101,代码来源:gtaction.cpp

示例10: applyValues

void CanvasMode_EditPolygon::applyValues(int polyC, double polyF, bool polyUseCF, double polyR, double polyCur, double polyIRot, double polyOCur)
{
	PageItem *currItem = m_doc->m_Selection->itemAt(0);
	PageItem_RegularPolygon* item = currItem->asRegularPolygon();
	QRectF oldRect = item->getBoundingRect();
	polyCorners = polyC;
	polyFactor = polyF;
	polyRotation = polyR;
	polyCurvature = polyCur;
	polyInnerRot = polyIRot;
	polyOuterCurvature = polyOCur;
	if (UndoManager::undoEnabled())
	{
		SimpleState *ss = new SimpleState(Um::EditPolygon,"",Um::IPolygon);
		ss->set("POLYGON","polygon");
		ss->set("NEW_CORNER",polyC);
		ss->set("NEW_USEFACTOR",polyUseCF);
		ss->set("NEW_FACTOR",polyFactor);
		ss->set("NEW_ROTATION",polyRotation);
		ss->set("NEW_CURV",polyCurvature);
		ss->set("NEW_INNER",polyInnerRot);
		ss->set("NEW_OUTER",polyOuterCurvature);
		ss->set("OLD_CORNER",item->polyCorners);
		ss->set("OLD_USEFACTOR",item->polyUseFactor);
		ss->set("OLD_FACTOR",item->polyFactor);
		ss->set("OLD_ROTATION",item->polyRotation);
		ss->set("OLD_CURV",item->polyCurvature);
		ss->set("OLD_INNER",item->polyInnerRot);
		ss->set("OLD_OUTER",item->polyOuterCurvature);
		undoManager->action(currItem,ss);
	}
	item->polyCorners = polyC;
	item->polyUseFactor = polyUseCF;
	item->polyFactor = polyFactor;
	item->polyRotation = polyRotation;
	item->polyCurvature = polyCurvature;
	item->polyInnerRot = polyInnerRot;
	item->polyOuterCurvature = polyOuterCurvature;
	item->recalcPath();
	updateFromItem();
	QTransform itemMatrix = currItem->getTransform();
	QPainterPath path = itemMatrix.map(RegularPolygonPath(item->width(), item->height(), polyCorners, polyUseFactor, polyFactor, polyRotation, polyCurvature, polyInnerRot, polyOuterCurvature));
	QRectF updateRect = oldRect.united(path.boundingRect());
	m_doc->regionsChanged()->update(updateRect.adjusted(-5, -5, 10, 10));
}
开发者ID:WOF-Softwares,项目名称:ScribusCTL,代码行数:45,代码来源:canvasmode_editpolygon.cpp


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