本文整理汇总了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;
}
示例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;
}
示例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));
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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());
}
示例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;
}
示例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;
}
示例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++;
}
}
}
示例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;
}