本文整理汇总了C++中List::DeleteAll方法的典型用法代码示例。如果您正苦于以下问题:C++ List::DeleteAll方法的具体用法?C++ List::DeleteAll怎么用?C++ List::DeleteAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类List
的用法示例。
在下文中一共展示了List::DeleteAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetGadgetText
void OpChangeLineAttribOpDesc::SetGadgetText(const String& strGadgetText)
{
// Create a list for the dialogue manager to put gadget ID's on.
List* pGadgetList = new List;
if (pGadgetList == NULL)
{
InformError(_R(IDE_NOMORE_MEMORY));
return;
}
// Obtain a list of all the combo controls.
if (BuildGadgetList(pGadgetList))
{
// Iterate over each control in the list.
for (GadgetListItem* pGadgetItem = (GadgetListItem*) pGadgetList->GetHead();
pGadgetItem != NULL;
pGadgetItem = (GadgetListItem*) pGadgetList->GetNext(pGadgetItem))
{
// Set each control to display the text.
pGadgetItem->pDialogOp->SetStringGadgetValue(pGadgetItem->gidGadgetID,
((String&) strGadgetText),
FALSE, -1);
}
// Tidy up.
pGadgetList->DeleteAll();
}
// Deallocate gadget list.
delete pGadgetList;
}
示例2: Do
void OpSnapToObjects::Do(OpDescriptor*)
{
DocView *pDocView = DocView::GetSelected();
if (pDocView != NULL)
{
// Find out the new value for the magnetic snapping
BOOL NewState = !pDocView->GetSnapToObjectsState();
pDocView->SetSnapToObjectsState(NewState);
// update all slider controls that show the view quality
OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_SNAPTOOBJECTS);
if (pOpDesc!=NULL)
{
// Found the opdescriptor. Now find all the gadgets associated with it
List Gadgets;
if (pOpDesc->BuildGadgetList(&Gadgets))
{
// Found some. Set the controls position according to the quality
GadgetListItem* pGadgetItem = (GadgetListItem*) Gadgets.GetHead();
while (pGadgetItem!=NULL)
{
// Set the sliders position
pGadgetItem->pDialogOp->SetLongGadgetValue(pGadgetItem->gidGadgetID, NewState, FALSE);
// go find the next gadget
pGadgetItem = (GadgetListItem*) Gadgets.GetNext(pGadgetItem);
}
// Clean out the list
Gadgets.DeleteAll();
}
}
}
End();
}
示例3: Do
/********************************************************************************************
> void OpMoveToLayer::Do(OpDescriptor*)
Author: Simon_Knight (Xara Group Ltd) <[email protected]>
Created: 3/5/00
Purpose: This takes the selection and moves it to the active layer. This is a more
powerful operation than the move forward/backward a layer
********************************************************************************************/
void OpMoveToLayer::Do(OpDescriptor*)
{
if (DoStartSelOp(FALSE,TRUE))
{
// get the selection
Range Sel(*(GetApplication()->FindSelection()));
// set the range flags so it includes shadow and bevel manager nodes
RangeControl rg = Sel.GetRangeControlFlags();
rg.PromoteToParent = TRUE;
Sel.Range::SetRangeControl(rg);
// Prepare an ObjChangeParam so we can mark which nodes will allow this op to happen to them
ObjChangeFlags cFlags;
cFlags.MoveNode = TRUE;
ObjChangeParam ObjChange(OBJCHANGE_STARTING,cFlags,NULL,this);
// add items directly after the layer node as its first child
Node * pTail = (Node *) (Document::GetCurrent()->GetInsertionPosition());
AttachNodeDirection TailAttachDirection = PREV;
Spread* pSpread = Document::GetSelectedSpread();
if (!pTail)
{
if (pSpread)
{
pTail = pSpread->FindActiveLayer();
// AttachNodeDirection TailAttachDirection = LASTCHILD; <--- AMB removed this and inserted the next line 2006-04-10 presuming bug
TailAttachDirection = LASTCHILD;
}
else
{
FailAndExecute();
End();
return; // nowhere to put the nodes
}
}
// Mark nodes that will allow this to happen, and error if no nodes will let it happen
if (!Sel.AllowOp(&ObjChange))
{
FailAndExecute();
End();
return; // op not allowed
}
// get a list from which to move the nodes (fixes job #10781 - the re-selection of
// moved nodes caused an infinite loop)
List* pNodeList = Sel.MakeListOfNodes(FALSE);
NodeListItem* CurItem = (NodeListItem*)(pNodeList->GetHead());
while (CurItem)
{
Node* pNode = CurItem->pNode;
// Make sure the current owner Layer is told about the changes
// and given the chance to release any cached info it may be
// holding about the selected object
// (I know that the original position coincides with the destination position
// but this is hte simplest way to get the original parent layer uncached
// and to get a record in the undo history so that the layer cacheing will
// be dealt with properly during gundo/redo)
DoInvalidateNodeRegion((NodeRenderableBounded*) pNode, TRUE, FALSE);
// localise attribs for this node
DoLocaliseForAttrChange((NodeRenderableInk*) pNode, (AttrTypeSet *)NULL, (ObjectSet*) NULL);
DoMoveNode(pNode, pTail, TailAttachDirection);
// factor out common attribs
if (pNode->IsCompound())
DoFactorOutCommonChildAttributes((NodeRenderableInk*) pNode);
else
DoFactorOutAfterAttrChange((NodeRenderableInk*) pNode, (AttrTypeSet *)NULL);
// make the nodes region be redrawn
DoInvalidateNodeRegion((NodeRenderableBounded*) pNode, TRUE, FALSE);
CurItem = (NodeListItem*)(pNodeList->GetNext(CurItem));
}
// delete the the list objects
pNodeList->DeleteAll();
delete pNodeList;
// the selection will have changed - after all we just deleted it
BROADCAST_TO_ALL(SelChangingMsg(SelChangingMsg::NONCOLOURATTCHANGED));
GetApplication()->UpdateSelection();
ObjChange.Define(OBJCHANGE_FINISHED,cFlags,NULL,this);
UpdateChangedNodes(&ObjChange);
// end the op
//.........这里部分代码省略.........