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


C++ Guides::begin方法代码示例

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


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

示例1: drawPage

void GuideManagerCore::drawPage(ScPainter *p, ScribusDoc *doc, double lineWidth)
{
	Guides::iterator it;
	const GuideManager* guideManager = ScCore->primaryMainWindow()->guidePalette;
	QColor color(doc->guidesPrefs().guideColor);

	if (!m_page || guideManager->pageNr() < 0)
		return;

	// real painting margins including bleeds
	double verticalFrom = 0.0 - doc->bleeds()->top();
	double verticalTo = m_page->height() + doc->bleeds()->bottom();
	double horizontalFrom = 0.0 - doc->bleeds()->left();
	double horizontalTo = m_page->width() + doc->bleeds()->right();

	// all standard
	p->setPen(color, lineWidth, Qt::DashDotLine, Qt::FlatCap, Qt::MiterJoin);
	for (it = m_verticalStdG.begin(); it != m_verticalStdG.end(); ++it)
// 		if ((*it) >= 0 && (*it) <= m_page->width())
// 			p->drawLine(FPoint((*it), 0), FPoint((*it), m_page->height()));
		p->drawLine(FPoint((*it), verticalFrom), FPoint((*it), verticalTo));
	for (it = m_horizontalStdG.begin(); it != m_horizontalStdG.end(); ++it)
// 		if ((*it) >= 0 && (*it) <= m_page->height())
// 			p->drawLine(FPoint(0, (*it)), FPoint(m_page->width(), (*it)));
		p->drawLine(FPoint(horizontalFrom, (*it)), FPoint(horizontalTo, (*it)));

	// highlight selected standards
	if (guideManager->currentIndex() == 0
		   && m_page->pageNr() == guideManager->pageNr())
	{
		p->setPen(Qt::red, lineWidth, Qt::DashDotLine, Qt::FlatCap, Qt::MiterJoin);
		Guides highlight = guideManager->selectedVerticals();
		for (it = highlight.begin(); it != highlight.end(); ++it)
// 			if ((*it) >= 0 && (*it) <= m_page->width())
// 				p->drawLine(FPoint((*it), 0), FPoint((*it), m_page->height()));
			p->drawLine(FPoint((*it), verticalFrom), FPoint((*it), verticalTo));
		highlight = guideManager->selectedHorizontals();
		for (it = highlight.begin(); it != highlight.end(); ++it)
// 			if ((*it) >= 0 && (*it) <= m_page->height())
// 				p->drawLine(FPoint(0, (*it)), FPoint(m_page->width(), (*it)));
			p->drawLine(FPoint(horizontalFrom, (*it)), FPoint(horizontalTo, (*it)));
	}

	// all auto
	if (guideManager->currentIndex() == 1 && guideManager->isVisible())
		color = Qt::red;
	else
		color = doc->guidesPrefs().guideColor;
	p->setPen(color, lineWidth, Qt::DashDotLine, Qt::FlatCap, Qt::MiterJoin);

	for (it = m_verticalAutoG.begin(); it != m_verticalAutoG.end(); ++it)
// 		if ((*it) >= 0 && (*it) <= m_page->width())
// 			p->drawLine(FPoint((*it), 0), FPoint((*it), m_page->height()));
		p->drawLine(FPoint((*it), verticalFrom), FPoint((*it), verticalTo));
	for (it = m_horizontalAutoG.begin(); it != m_horizontalAutoG.end(); ++it)
// 		if ((*it) >= 0 && (*it) <= m_page->height())
// 			p->drawLine(FPoint(0, (*it)), FPoint(m_page->width(), (*it)));
		p->drawLine(FPoint(horizontalFrom, (*it)), FPoint(horizontalTo, (*it)));
}
开发者ID:luzpaz,项目名称:scribus,代码行数:59,代码来源:guidemanagercore.cpp

示例2: addHorizontals

void GuideManagerCore::addHorizontals(Guides values, GuideType type)
{
	Guides::iterator it;
	switch (type)
	{
		case Standard:
			for (it = values.begin(); it != values.end(); ++it)
			{
				if (!m_horizontalStdG.contains((*it)))
					m_horizontalStdG.append((*it));
			}
			break;
		case Auto:
			m_horizontalAutoG.clear();
			for (it = values.begin(); it != values.end(); ++it)
				m_horizontalAutoG.append((*it));
			break;
	}
}
开发者ID:luzpaz,项目名称:scribus,代码行数:19,代码来源:guidemanagercore.cpp

示例3: writeVerticalGuides

QString GuideManagerIO::writeVerticalGuides(ScPage *page, GuideManagerCore::GuideType type)
{
	Guides::iterator it;
	QString retval;
	QString tmp;
	Guides tmpGuides = page->guides.verticals(type);
	for (it = tmpGuides.begin(); it != tmpGuides.end(); ++it)
	{
		tmp = tmp.setNum((*it));
		retval += tmp + " ";
	}
	return retval;
}
开发者ID:luzpaz,项目名称:scribus,代码行数:13,代码来源:guidemanagercore.cpp

示例4: isMouseOnVertical

int GuideManagerCore::isMouseOnVertical(double low, double high, GuideType type)
{
	Guides tmp;
	Guides::iterator it;

	switch (type)
	{
		case Standard:
			tmp = m_verticalStdG;
			break;
		case Auto:
			tmp = m_horizontalAutoG;
			break;
	}
	for (it = tmp.begin(); it != tmp.end(); ++it)
	{
		double guideOffset = (*it) + m_page->xOffset();
		if (guideOffset < low && guideOffset > high)
			return it - tmp.begin();
	}
	return -1;
}
开发者ID:luzpaz,项目名称:scribus,代码行数:22,代码来源:guidemanagercore.cpp


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