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


C++ JArray类代码示例

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


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

示例1: assert

JXPSPrintSetupDialog*
CBPSPrinter::CreatePrintSetupDialog
	(
	const Destination	destination,
	const JCharacter*	printCmd,
	const JCharacter*	fileName,
	const JBoolean		collate,
	const JBoolean		bw
	)
{
	assert( itsCBPrintSetupDialog == NULL );

	if (itsFontSize == kUnsetFontSize)
		{
		JString fontName;
		CBGetPrefsManager()->GetDefaultFont(&fontName, &itsFontSize);

		JArray<JIndexRange> matchList;
		if (nxmRegex.Match(fontName, &matchList))
			{
			const JString hStr = fontName.GetSubstring(matchList.GetElement(2));
			const JBoolean ok  = hStr.ConvertToUInt(&itsFontSize);
			assert( ok );
			itsFontSize--;
			}
		}

	itsCBPrintSetupDialog =
		CBPSPrintSetupDialog::Create(destination, printCmd, fileName,
									 collate, bw, itsFontSize,
									 (CBGetPTTextPrinter())->WillPrintHeader());
	return itsCBPrintSetupDialog;
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:33,代码来源:CBPSPrinter.cpp

示例2: GetSubject

const JString&
GMessageHeader::GetBaseSubject()
{
	if (itsHasBaseSubject)
		{
		return itsBaseSubject;
		}
	itsHasBaseSubject	= kJTrue;
	itsBaseSubject		= GetSubject();
	kFixSubjectRegex.SetCaseSensitive(kJFalse);
	JArray<JIndexRange> subList;
	while (kFixSubjectRegex.Match(itsBaseSubject, &subList))
		{
		itsBaseSubject	= itsBaseSubject.GetSubstring(subList.GetElement(subList.GetElementCount()));
		itsBaseSubject.TrimWhitespace();
		subList.RemoveAll();
		}
	const JSize length	= itsBaseSubject.GetLength();
	JIndex findex		= 1;
	while (findex <= length && 
		   !isalnum(itsBaseSubject.GetCharacter(findex)))
		{
		findex++;
		}
	if (findex > 1 && findex <= length)
		{
		itsBaseSubject	= itsBaseSubject.GetSubstring(findex, length);
		}
	return itsBaseSubject;
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:30,代码来源:GMessageHeader.cpp

示例3:

void
GRaggedFloatTableData::InsertElement
	(
	const JIndex row,
	const JIndex col,
	const JFloat value
	)
{
	JArray<JFloat>* dataCol = itsCols->NthElement(col);
	dataCol->InsertElementAtIndex(row, value);
	const JSize rowCount = dataCol->GetElementCount();
	if (itsBroadcast)
		{
		Broadcast(GRaggedFloatTableData::ElementInserted(row, col));
		}

	if (rowCount == GetRowCount())
		{
		RowsAdded(1);
		if (itsBroadcast)
			{
			Broadcast(JTableData::RowsInserted(rowCount+1, 1));
			}
		}
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:25,代码来源:GRaggedFloatTableData.cpp

示例4: getProperties

JArray JLEDObj::getProperties() {
  JArray properties = JModuleObj::getProperties();
  properties.append(JIntegerProperty("value", value, -limit-1, limit));
  properties.append(JColorProperty("color", color));
  properties.append(JColorProperty("bkgnd", bkgnd));
  return properties;
}
开发者ID:neattools,项目名称:neattools,代码行数:7,代码来源:JLEDObj.cpp

示例5: if

JBoolean
CBCommandTable::WillAcceptDrop
	(
	const JArray<Atom>&	typeList,
	Atom*				action,
	const JPoint&		pt,
	const Time			time,
	const JXWidget*		source
	)
{
	if (source == this)
		{
		return kJTrue;
		}
	else if (source == NULL)
		{
		return kJFalse;
		}

	const JSize typeCount = typeList.GetElementCount();
	for (JIndex i=1; i<=typeCount; i++)
		{
		if (typeList.GetElement(i) == itsCommandXAtom)
			{
			return kJTrue;
			}
		}

	return kJFalse;
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:30,代码来源:CBCommandTable.cpp

示例6:

JBoolean
GetEnclosure
	(
	const JArray<JRect>&	rectList,
	const JIndex			rectIndex,
	JIndex*					enclIndex
	)
{
	const JRect theRect = rectList.GetElement(rectIndex);
	JBoolean found = kJFalse;
	*enclIndex = 0;

	JSize minArea = 0;
	const JSize count = rectList.GetElementCount();
	for (JIndex i=1; i<=count; i++)
		{
		if (i != rectIndex)
			{
			const JRect r = rectList.GetElement(i);
			const JSize a = r.area();
			if (r.Contains(theRect) && (a < minArea || minArea == 0))
				{
				minArea    = a;
				found      = kJTrue;
				*enclIndex = i;
				}
			}
		}
	return found;
}
开发者ID:dllaurence,项目名称:jx_application_framework,代码行数:30,代码来源:jxlayout.cpp

示例7: WillAcceptDrop

JBoolean
JXPathInput::WillAcceptDrop
	(
	const JArray<Atom>&	typeList,
	Atom*				action,
	const JPoint&		pt,
	const Time			time,
	const JXWidget*		source
	)
{
	itsExpectURLDropFlag = kJFalse;

	const Atom urlXAtom = (GetSelectionManager())->GetURLXAtom();

	JString dirName;
	const JSize typeCount = typeList.GetElementCount();
	for (JIndex i=1; i<=typeCount; i++)
		{
		if (typeList.GetElement(i) == urlXAtom &&
			GetDroppedDirectory(time, kJFalse, &dirName))
			{
			*action = (GetDNDManager())->GetDNDActionPrivateXAtom();
			itsExpectURLDropFlag = kJTrue;
			return kJTrue;
			}
		}

	return JXInputField::WillAcceptDrop(typeList, action, pt, time, source);
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:29,代码来源:JXPathInput.cpp

示例8:

JArray JTNG4Obj::getProperties() {
  JArray properties = JTNG3Obj::getProperties();
  properties.append(JIntegerProperty("oseparator0", oseparators[0], 0, 255));
  properties.append(JIntegerProperty("oseparator1", oseparators[1], 0, 255));
  properties.append(JIntegerListProperty("exclusive", exclusive, JIntegerListProperty::booleanTag));
  properties.append(JIntegerProperty("extraInputCount", extraInputCount, 0, 32-IN_LAST));
  return properties;
}
开发者ID:neattools,项目名称:neattools,代码行数:8,代码来源:JTNG4Obj.cpp

示例9: getProperties

JArray JDelaySustainObj::getProperties() {
  JArray properties = JAddObj::getProperties();
  properties.append(JIntegerProperty("delay", delay, 
    0, 65535));
  properties.append(JIntegerProperty("sustain", sustain, 
    0, 65535));
  return properties;
}
开发者ID:neattools,项目名称:neattools,代码行数:8,代码来源:JDelaySustainObj.cpp

示例10:

JArray J1DMObj::getProperties() {
     JArray properties = JModuleObj::getProperties();
     properties.append(JIntegerProperty("vx", v[0], 0, mask));
     properties.append(JIntegerProperty("vy", v[1],  0, mask));
     properties.append(JColorProperty("color", color));
     properties.append(JColorProperty("bkgnd", bkgnd));
     return properties;
}
开发者ID:neattools,项目名称:neattools,代码行数:8,代码来源:J1DMObj.cpp

示例11: expand_to_rank

JArray<T> expand_to_rank(int rank, const JArray<T>& array) {
  assert(rank >= array.get_rank());
  Dimensions old_dims(array.get_dims());
  shared_ptr<vector<int> > new_dims_vector(new vector<int>(rank, 1));

  copy(old_dims.begin(), old_dims.end(), new_dims_vector->begin() + (rank - array.get_rank()));
  return JArray<T>(new_dims_vector, array.get_content());
}
开发者ID:troels,项目名称:J,代码行数:8,代码来源:utils.hpp

示例12: getProperties

JArray JRealComplexObj::getProperties() {
  JArray properties = JLabelObj::getProperties();
  properties.append(JRealProperty("real", cval.r, w, f));
  properties.append(JRealProperty("imag", cval.i, w, f));
  properties.append(JIntegerProperty("width", w, 3, 20));
  properties.append(JIntegerProperty("float", f, 1, w-2));
  return properties;
}
开发者ID:neattools,项目名称:neattools,代码行数:8,代码来源:JRealComplexObj.cpp

示例13: GetSelectionManager

JBoolean
JXExprEditor::EIPGetExternalClipboard
	(
	JString* text
	)
{
	text->Clear();

	JBoolean gotData = kJFalse;
	JXSelectionManager* selManager = GetSelectionManager();

	JArray<Atom> typeList;
	if (selManager->GetAvailableTypes(kJXClipboardName, CurrentTime, &typeList))
		{
		JBoolean canGetText = kJFalse;
		Atom textType       = None;

		const JSize typeCount = typeList.GetElementCount();
		for (JIndex i=1; i<=typeCount; i++)
			{
			Atom type = typeList.GetElement(i);
			if (type == XA_STRING ||
				(!canGetText && type == selManager->GetUtf8StringXAtom()))
				{
				canGetText = kJTrue;
				textType   = type;
				break;
				}
			}

		Atom returnType;
		unsigned char* data = NULL;
		JSize dataLength;
		JXSelectionManager::DeleteMethod delMethod;
		if (canGetText &&
			selManager->GetData(kJXClipboardName, CurrentTime, textType,
								&returnType, &data, &dataLength, &delMethod))
			{
			if (returnType == XA_STRING)
				{
				*text = JString(reinterpret_cast<JCharacter*>(data), dataLength);
				gotData = kJTrue;
				}
			selManager->DeleteData(&data, delMethod);
			}
		else
			{
			(JGetUserNotification())->ReportError(
				"Unable to paste the current contents of the X Clipboard.");
			}
		}
	else
		{
		(JGetUserNotification())->ReportError("The X Clipboard is empty.");
		}

	return gotData;
}
开发者ID:jafl,项目名称:jx_application_framework,代码行数:58,代码来源:JXExprEditor.cpp

示例14: assert

void
JXTabGroup::ScrollUpToTab
	(
	const JIndex index
	)
{
	assert( itsTitles->IndexValid(index) );
	assert( index > itsFirstDrawIndex );

	const JFontManager* fontMgr = GetFontManager();
	const JFontID fontID        = fontMgr->GetFontID(itsFontName, itsFontSize, itsFontStyle);

	const JCoordinate scrollArrowWidth = 2*(kArrowWidth + kBorderWidth);

	const JRect ap        = GetAperture();
	const JCoordinate min = (itsEdge == kTop || itsEdge == kBottom ? ap.left : ap.top);
	const JCoordinate max = (itsEdge == kTop || itsEdge == kBottom ? ap.right : ap.bottom);
	JCoordinate left      = min + kSelMargin;
	JCoordinate right     = left;
	JArray<JCoordinate> widthList;

	const JSize count  = itsTitles->GetElementCount();
	JBoolean offScreen = kJFalse;
	for (JIndex i=itsFirstDrawIndex; i<=index; i++)
		{
		const TabInfo info = itsTabInfoList->GetElement(index);

		right += 2*kBorderWidth + info.preMargin + info.postMargin +
				 fontMgr->GetStringWidth(fontID, itsFontSize, itsFontStyle,
										 *(itsTitles->NthElement(i)));
		if (info.closable)
			{
			right += kCloseMarginWidth + itsCloseImage->GetWidth();
			}
		widthList.AppendElement(right - left);

		if (!offScreen &&
			right >= max - scrollArrowWidth &&
			!(itsFirstDrawIndex == 1 && i == count && right <= max))
			{
			offScreen = kJTrue;
			}

		left = right;
		}

	if (offScreen)
		{
		JIndex i = 1;
		while (right > max - scrollArrowWidth && itsFirstDrawIndex < index)
			{
			right -= widthList.GetElement(i);
			itsFirstDrawIndex++;
			i++;
			}
		}
}
开发者ID:raorn,项目名称:jx_application_framework,代码行数:57,代码来源:JXTabGroup.cpp

示例15:

JArray<JTEStyler::TokenData>*
JTEStyler::NewTokenStartList()
{
	JArray<TokenData>* list = new JArray<TokenData>(kListBlockSize);
	assert( list != NULL );
	list->SetSortOrder(JOrderedSetT::kSortAscending);
	list->SetCompareFunction(CompareTokenStarts);
	return list;
}
开发者ID:mbert,项目名称:mulberry-lib-jx,代码行数:9,代码来源:JTEStyler.cpp


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