本文整理汇总了C++中OwnedArray::removeLast方法的典型用法代码示例。如果您正苦于以下问题:C++ OwnedArray::removeLast方法的具体用法?C++ OwnedArray::removeLast怎么用?C++ OwnedArray::removeLast使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OwnedArray
的用法示例。
在下文中一共展示了OwnedArray::removeLast方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeColumn
void ColumnFileBrowserContents::removeColumn (int numColumns)
{
for (int i = numColumns; i <= 0; i--)
{
columns[i]->removeListener (this);
columns[i]->removeChangeListener (this);
columns[i]->removeComponentListener (this);
}
columns.removeLast (numColumns - 1);
}
示例2: perform
//==============================================================================
bool UndoManager::perform (UndoableAction* const command_, const String& actionName)
{
if (command_ != 0)
{
ScopedPointer<UndoableAction> command (command_);
if (actionName.isNotEmpty())
currentTransactionName = actionName;
if (reentrancyCheck)
{
jassertfalse; // don't call perform() recursively from the UndoableAction::perform() or
// undo() methods, or else these actions won't actually get done.
return false;
}
else if (command->perform())
{
OwnedArray<UndoableAction>* commandSet = transactions [nextIndex - 1];
if (commandSet != 0 && ! newTransaction)
{
UndoableAction* lastAction = commandSet->getLast();
if (lastAction != 0)
{
UndoableAction* coalescedAction = lastAction->createCoalescedAction (command);
if (coalescedAction != 0)
{
command = coalescedAction;
totalUnitsStored -= lastAction->getSizeInUnits();
commandSet->removeLast();
}
}
}
else
{
commandSet = new OwnedArray<UndoableAction>();
transactions.insert (nextIndex, commandSet);
transactionNames.insert (nextIndex, currentTransactionName);
++nextIndex;
}
totalUnitsStored += command->getSizeInUnits();
commandSet->add (command.release());
newTransaction = false;
while (nextIndex < transactions.size())
{
const OwnedArray <UndoableAction>* const lastSet = transactions.getLast();
for (int i = lastSet->size(); --i >= 0;)
totalUnitsStored -= lastSet->getUnchecked (i)->getSizeInUnits();
transactions.removeLast();
transactionNames.remove (transactionNames.size() - 1);
}
while (nextIndex > 0
&& totalUnitsStored > maxNumUnitsToKeep
&& transactions.size() > minimumTransactionsToKeep)
{
const OwnedArray <UndoableAction>* const firstSet = transactions.getFirst();
for (int i = firstSet->size(); --i >= 0;)
totalUnitsStored -= firstSet->getUnchecked (i)->getSizeInUnits();
jassert (totalUnitsStored >= 0); // something fishy going on if this fails!
transactions.remove (0);
transactionNames.remove (0);
--nextIndex;
}
sendChangeMessage();
return true;
}
}
return false;
}