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


C++ JPainter::String方法代码示例

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


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

示例1: if

void
JXFSBindingTable::TableDrawCell
	(
	JPainter&		p,
	const JPoint&	cell,
	const JRect&	rect
	)
{
	JPoint editCell;
	if (GetEditedCell(&editCell) && cell == editCell)
		{
		return;
		}

	HilightIfSelected(p, cell, rect);

	const JFSBinding* b = itsBindingList->GetBinding(cell.y);
	JFSBinding::CommandType type;
	JBoolean singleFile;
	const JString& cmd = b->GetCommand(&type, &singleFile);

	if (cell.x == kPatternColumn)
		{
		p.SetFont(JGetMonospaceFontName(), kJDefaultMonoFontSize, JFontStyle());

		JRect r = rect;
		r.left += kHMarginWidth;
		p.String(r, b->GetPattern(), JPainter::kHAlignLeft, JPainter::kVAlignCenter);

		p.SetFont(JGetDefaultFontName(), kJDefaultFontSize, JFontStyle());
		}
	else if (cell.x == kCommandColumn)
		{
		p.SetFont(JGetMonospaceFontName(), kJDefaultMonoFontSize, JFontStyle());

		JRect r = rect;
		r.left += kHMarginWidth;
		p.String(r, cmd, JPainter::kHAlignLeft, JPainter::kVAlignCenter);

		p.SetFont(JGetDefaultFontName(), kJDefaultFontSize, JFontStyle());
		}
	else if (cell.x == kTypeColumn)
		{
		const JString& str = itsTypeMenu->GetItemText(kCmdTypeToMenuIndex[type]);
		p.String(rect, str, JPainter::kHAlignCenter, JPainter::kVAlignCenter);
		}
	else if (cell.x == kSingleFileColumn && singleFile)
		{
		JRect r;
		r.top    = rect.ycenter();
		r.left   = rect.xcenter();
		r.bottom = r.top+1;
		r.right  = r.left+1;
		r.Expand(3, 3);

		p.SetFilling(kJTrue);
		p.Ellipse(r);
		p.SetFilling(kJFalse);
		}
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:60,代码来源:JXFSBindingTable.cpp

示例2: if

void
THXVarTable::TableDrawCell
	(
	JPainter&		p,
	const JPoint&	cell,
	const JRect&	rect
	)
{
	JPoint editCell;
	if (GetEditedCell(&editCell) && cell == editCell)
		{
		return;
		}

	JRect r = rect;
	r.left += kHMarginWidth;

	const JIndex varIndex = cell.y + THXVarList::kUserFnOffset;
	if (cell.x == kNameColumn)
		{
		p.String(r, itsVarList->GetVariableName(varIndex),
				 JPainter::kHAlignLeft, JPainter::kVAlignCenter);
		}
	else if (cell.x == kFnColumn)
		{
		const JString s = (itsVarList->GetFunction(varIndex))->Print();
		p.String(r, s, JPainter::kHAlignLeft, JPainter::kVAlignCenter);
		}
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:29,代码来源:THXVarTable.cpp

示例3: CellToSymbolIndex

void
CBSymbolTable::TableDrawCell
	(
	JPainter&		p,
	const JPoint&	cell,
	const JRect&	rect
	)
{
	HilightIfSelected(p, cell, rect);

	const JIndex symbolIndex = CellToSymbolIndex(cell);

	CBLanguage lang;
	CBSymbolList::Type type;
	const JString& symbolName =
		itsSymbolList->GetSymbol(symbolIndex, &lang, &type);

	const JString* signature;
	itsSymbolList->GetSignature(symbolIndex, &signature);

	if (CalcColWidths(symbolName, signature))
		{
		AdjustColWidths();
		}

	const JXImage* icon     = NULL;
	const JFontStyle& style = (CBGetSymbolTypeList())->GetStyle(type, &icon);

	// draw icon

	if (icon != NULL)
		{
		JRect r = rect;
		r.right = r.left + kIconWidth;
		p.Image(*icon, icon->GetBounds(), r);
		}

	// draw name

	p.SetFontStyle(style);

	JRect r = rect;
	r.left += kIconWidth + kHMarginWidth;
	p.String(r, symbolName, JPainter::kHAlignLeft, JPainter::kVAlignCenter);

	if (signature != NULL)
		{
		r.left += (GetFontManager())->GetStringWidth(
			JGetDefaultFontName(), kJDefaultFontSize, JFontStyle(), symbolName);
		p.String(r, *signature, JPainter::kHAlignLeft, JPainter::kVAlignCenter);
		}
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:52,代码来源:CBSymbolTable.cpp

示例4: JString

void
JXColHeaderWidget::TableDrawCell
	(
	JPainter&		p,
	const JPoint&	cell,
	const JRect&	rect
	)
{
	JXDrawUpFrame(p, rect, kCellFrameWidth);

	JString str;
	JBoolean hasTitle = kJFalse;
	if (itsTitles != NULL)
		{
		const JString* title = itsTitles->NthElement(cell.x);
		if (title != NULL)
			{
			str      = *title;
			hasTitle = kJTrue;
			}
		}
	if (!hasTitle)
		{
		str = JString(cell.x, 0);
		}

	p.SetFont(JGetDefaultFontName(), kFontSize,
			  JFontStyle(kJTrue, kJFalse, 0, kJFalse, (p.GetColormap())->GetBlackColor()));
	p.String(rect, str, JPainter::kHAlignCenter, JPainter::kVAlignCenter);
}
开发者ID:mbert,项目名称:mulberry-lib-jx,代码行数:30,代码来源:JXColHeaderWidget.cpp

示例5: JString

void
GPMTreeHeaderWidget::TableDrawCell
	(
	JPainter&		p,
	const JPoint&	cell,
	const JRect&	rect
	)
{
	JXDrawUpFrame(p, rect, kJXDefaultBorderWidth);

	JString str;
	if (!GetColTitle(cell.x, &str))
		{
		str = JString(cell.x, JString::kBase10);
		}

	JSize underLines = 0;
	if (itsList->TreeColIsSelected(cell.x))
		{
		underLines = 1;
		}

	const JFont font = GetFontManager()->GetFont(
		JGetDefaultFontName(), JGetDefaultRowColHeaderFontSize(),
		JFontStyle(kJTrue, kJFalse, underLines, kJFalse, (p.GetColormap())->GetBlackColor()));
	p.SetFont(font);
	p.String(rect, str, JPainter::kHAlignCenter, JPainter::kVAlignCenter);
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:28,代码来源:GPMTreeHeaderWidget.cpp

示例6: cellNumber

void
DataTable::TableDrawCell
	(
	JPainter& 		p, 
	const JPoint& 	cell, 
	const JRect& 	rect
	)
{
	// Convert the array's current element into a JString.
	JString cellNumber(itsData->GetElement(cell.y));

	// Draw the JString that holds the value. 
	p.String(rect, cellNumber, JPainter::kHAlignLeft, JPainter::kVAlignTop);
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:14,代码来源:DataTable.cpp

示例7: cellNumber

void
SimpleTable::TableDrawCell
	(
	JPainter& 		p, 
	const JPoint& 	cell, 
	const JRect& 	rect
	)
{
	// Convert the row number into a JString.
	JString cellNumber(cell.y);

	// Draw the JString that holds the value. 
	p.String(rect, cellNumber, JPainter::kHAlignLeft, JPainter::kVAlignTop);
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:14,代码来源:SimpleTable.cpp

示例8:

void
FitParmsTable::TableDrawCell
	(
	JPainter&		p,
	const JPoint&	cell,
	const JRect&	rect
	)
{
	JString* str;
	p.SetFont(GetFontManager()->GetDefaultFont());
	JRect r = rect;
	if (cell.x == 1)
		{
		r.right -= kHMarginWidth;
		str = itsCol1->NthElement(cell.y);
		p.String(r, *str, JPainter::kHAlignRight, JPainter::kVAlignCenter);
		}
	else
		{
		r.left += kHMarginWidth;
		str = itsCol2->NthElement(cell.y);
		p.String(r, *str, JPainter::kHAlignLeft, JPainter::kVAlignCenter);
		}
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:24,代码来源:FitParmsTable.cpp

示例9:

void
JX2DCurveNameList::TableDrawCell
	(
	JPainter&		p,
	const JPoint&	cell,
	const JRect&	rect
	)
{
	HilightIfSelected(p, cell, rect);

	const JString* curveName = itsNameList->NthElement(cell.y);

	JRect r = rect;
	r.left += kHMarginWidth;
	p.String(r, *curveName, JPainter::kHAlignLeft, JPainter::kVAlignCenter);
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:16,代码来源:JX2DCurveNameList.cpp

示例10: if

void
CMLineIndexTable::TableDrawCell
	(
	JPainter&		p,
	const JPoint&	cell,
	const JRect&	rect
	)
{
	HilightIfSelected(p, cell, rect);

	if (JIndex(cell.x) == kBreakpointColumn)
		{
		DrawBreakpoints(p, cell, rect);
		}

	else if (JIndex(cell.x) == kExecPointColumn && cell.y == itsCurrentLineIndex)
		{
		// We can't use a static polygon because line heights can vary,
		// e.g. due to underlines.

		const JCoordinate delta = rect.height()/2;

		JPolygon poly;
		poly.AppendElement(JPoint(rect.left+kMarginWidth,       rect.top));
		poly.AppendElement(JPoint(rect.left+kMarginWidth+delta, rect.top + delta));
		poly.AppendElement(JPoint(rect.left+kMarginWidth,       rect.top + 2*delta));

		p.SetPenColor(GetCurrentLineMarkerColor());
		p.SetFilling(kJTrue);
		p.Polygon(poly);

		p.SetPenColor(GetColormap()->GetBlackColor());
		p.SetFilling(kJFalse);
		p.Polygon(poly);
		}

	else if (JIndex(cell.x) == kLineNumberColumn)
		{
		p.SetFont(itsText->GetDefaultFont());

		JRect r  = rect;
		r.right -= kMarginWidth;

		const JString str = GetLineText(cell.y);
		p.String(r, str, JPainter::kHAlignRight);
		}
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:47,代码来源:CMLineIndexTable.cpp

示例11: if

void
GLFitParameterTable::TableDrawCell
	(
	JPainter&		p,
	const JPoint&	cell,
	const JRect&	rect
	)
{
	HilightIfSelected(p, cell, rect);

	JIndex realIndex = cell.x;

	if (realIndex == kStartColIndex && !itsHasStartValues)
		{
		realIndex = kFitColIndex;
		}
	else if (realIndex == kFitColIndex && !itsHasStartValues)
		{
		realIndex = kErrorColIndex;
		}

	JString str;
	if (realIndex == kNameColIndex)
		{
		str	= *(itsNameList->NthElement(cell.y));
		}
	else if (realIndex == kStartColIndex)
		{
		str = JString(itsStartValues->GetElement(cell.y), JString::kPrecisionAsNeeded, JString::kStandardExponent, 0, 5);
		}
	else if (realIndex == kFitColIndex)
		{
		str = JString(itsFitValues->GetElement(cell.y), JString::kPrecisionAsNeeded, JString::kStandardExponent, 0, 5);
		}
	else if (realIndex == kErrorColIndex)
		{
		str = JString(itsErrorValues->GetElement(cell.y), JString::kPrecisionAsNeeded, JString::kStandardExponent, 0, 5);
		}

	JRect r = rect;
	r.left += kHMarginWidth;
	p.String(r, str, JPainter::kHAlignLeft, JPainter::kVAlignCenter);
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:43,代码来源:GLFitParameterTable.cpp

示例12: cellNumber

void
SelectionTable::TableDrawCell
	(
	JPainter& 		p, 
	const JPoint& 	cell, 
	const JRect& 	rect
	)
{
	// JTable keeps track of what's selected. If we want just
	// basic hilighting of the selected cells, we can have JTable 
	// do it with this call:
	HilightIfSelected(p, cell, rect);

	// Convert the array's current element into a JString.
	JString cellNumber(itsData->GetElement(cell.y));

	// Draw the JString that holds the value. 
	p.String(rect, cellNumber, JPainter::kHAlignLeft, JPainter::kVAlignTop);
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:19,代码来源:SelectionTable.cpp

示例13:

void
GMAccountList::TableDrawCell
	(
	JPainter&		p,
	const JPoint&	cell,
	const JRect&	rect
	)
{
	HilightIfSelected(p, cell, rect);

	JFontStyle fontstyle;
	if (itsDialog->GetDefaultIndex() == (JIndex)cell.y)
		{
		fontstyle.bold	= kJTrue;
		}

	p.SetFont(JGetDefaultFontName(), kJDefaultFontSize, fontstyle);

	JString str = itsAccountInfo->NthElement(cell.y)->GetNickname();

	// check that column is wide enough

	const JCoordinate w = p.GetStringWidth(str) + 2*kHMarginWidth;
	if (w > GetColWidth(1))
		{
		itsMinColWidth = w;
		}

	// draw string

	JRect r = rect;
	r.left += kHMarginWidth;
	p.String(r, str, JPainter::kHAlignLeft, JPainter::kVAlignCenter);
	if (cell.y == JCoordinate(itsAccountInfo->GetElementCount()))
		{
		AdjustColWidth();
		}
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:38,代码来源:GMAccountList.cpp

示例14: JString

void
JXRowHeaderWidget::TableDrawCell
	(
	JPainter&		p,
	const JPoint&	cell,
	const JRect&	rect
	)
{
	JXDrawUpFrame(p, rect, kCellFrameWidth);

	JString str;
	JBoolean hasTitle = kJFalse;
	if (itsTitles != NULL)
		{
		const JString* title = itsTitles->NthElement(cell.y);
		if (title != NULL)
			{
			str      = *title;
			hasTitle = kJTrue;
			}
		}
	if (!hasTitle)
		{
		str = JString(cell.y, JString::kBase10);
		}

	p.SetFont(JGetDefaultFontName(), kJDefaultRowColHeaderFontSize,
			  JFontStyle(kJTrue, kJFalse, 0, kJFalse, (p.GetColormap())->GetBlackColor()));
	p.String(rect, str, JPainter::kHAlignCenter, JPainter::kVAlignCenter);

	const JCoordinate wmin = p.GetStringWidth(str) + 2*itsHMarginWidth;
	if (rect.width() < wmin && itsMaxBcastWidth < wmin)
		{
		Broadcast(NeedsToBeWidened(wmin - itsMaxBcastWidth));
		itsMaxBcastWidth = wmin;
		}
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:37,代码来源:JXRowHeaderWidget.cpp

示例15: if

void
GLFitDescriptionList::TableDrawCell
	(
	JPainter&		p,
	const JPoint&	cell,
	const JRect&	rect
	)
{
	HilightIfSelected(p, cell, rect);

	const JString* curveName = itsNameList->NthElement(cell.y);

	const GLFitDescription& fd	= GetFitManager()->GetFitDescription(cell.y);

	JRect irect	= rect;
	irect.right	= rect.left + kIconWidth;
	if (fd.GetType()	== GLFitDescription::kPolynomial)
		{
		p.Image(*itsPolyIcon, itsPolyIcon->GetBounds(), irect);
		}
	else if (fd.GetType()	== GLFitDescription::kNonLinear)
		{
		p.Image(*itsNonLinearIcon, itsNonLinearIcon->GetBounds(), irect);
		}
	else if (fd.GetType()	== GLFitDescription::kModule)
		{
		p.Image(*itsExecutableIcon, itsExecutableIcon->GetBounds(), irect);
		}
	else if (fd.GetType()	>= GLFitDescription::kBLinear)
		{
		p.Image(*itsBuiltInIcon, itsBuiltInIcon->GetBounds(), irect);
		}
	
	JRect r = rect;
	r.left += kHMarginWidth + kIconWidth;
	p.String(r, *curveName, JPainter::kHAlignLeft, JPainter::kVAlignCenter);
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:37,代码来源:GLFitDescriptionList.cpp


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