本文整理汇总了C++中RemoveItem函数的典型用法代码示例。如果您正苦于以下问题:C++ RemoveItem函数的具体用法?C++ RemoveItem怎么用?C++ RemoveItem使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RemoveItem函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DeleteItem
BOOL CXmlItem::DeleteItem(CXmlItem* pXI)
{
if (RemoveItem(pXI))
{
delete pXI;
return TRUE;
}
return FALSE;
}
示例2: FindJob
void
JobListView::RemoveJob(Job* job)
{
JobItem* item = FindJob(job);
if (item) {
RemoveItem(item);
delete item;
Invalidate();
}
}
示例3: RemoveItem
void PopupHistoryList::AddItem(PopupHistoryData item)
{
if (count >= size)
{
RemoveItem(0); //remove first element - the oldest
count--; //it will be inc'ed later
}
historyData[count++] = item; //item has it's relevant strings dupped()
RefreshPopupHistory(hHistoryWindow, GetRenderer());
}
示例4: FindContact
//************************************************************************
// removes a contact from the list
//************************************************************************
void CContactList::RemoveContact(MCONTACT hContact) {
CListContainer<CContactListEntry*,CContactListGroup*> *pGroup = NULL;
///tstring strGroup = GetContactGroupPath(hContact);
CListEntry<CContactListEntry*,CContactListGroup*> *pContactEntry = FindContact(hContact);
if(!pContactEntry) {
return;
}
if( !CConfig::GetBoolSetting(CLIST_USEGROUPS)){
if(pContactEntry->GetType() == ITEM)
RemoveItem(((CListItem<CContactListEntry*,CContactListGroup*>*)pContactEntry)->GetItemData());
else
RemoveGroup(((CListContainer<CContactListEntry*,CContactListGroup*>*)pContactEntry)->GetGroupData());
} else {
pGroup = (CListContainer<CContactListEntry*,CContactListGroup*>*)pContactEntry->GetParent();
ASSERT(pGroup != NULL);
CContactListEntry *pEntry = GetContactData(pContactEntry);
if(!pEntry) {
return;
}
// Update the contacts group if it has one
if(pGroup->GetType() != ROOT)
{
if(!db_mc_isSub(hContact) && pEntry->iStatus != ID_STATUS_OFFLINE)
ChangeGroupObjectCounters(pGroup->GetGroupData()->strPath,0,-1);
if(!db_mc_isSub(hContact) && pEntry->iMessages > 0)
ChangeGroupObjectCounters(pGroup->GetGroupData()->strPath,0,0,-pEntry->iMessages);
}
if(pContactEntry->GetType() == ITEM)
pGroup->RemoveItem(((CListItem<CContactListEntry*,CContactListGroup*>*)pContactEntry)->GetItemData());
else {
pGroup->RemoveGroup(((CListContainer<CContactListEntry*,CContactListGroup*>*)pContactEntry)->GetGroupData());
// Reenumerate all subcontacts (maybe MetaContacts was disabled
int numContacts = db_mc_getSubCount(hContact);
for(int i=0;i<numContacts;i++) {
MCONTACT hSubContact = db_mc_getSub(hContact, i);
if(!FindContact(hSubContact))
AddContact(hSubContact);
}
}
CListContainer<CContactListEntry*,CContactListGroup*> *pParent = (CListContainer<CContactListEntry*,CContactListGroup*>*)pGroup->GetParent();
while(pParent != NULL && pGroup->IsEmpty() && !pGroup->GetGroupData()->hMetaContact)
{
pParent->RemoveGroup(pGroup->GetGroupData());
pGroup = pParent;
pParent = (CListContainer<CContactListEntry*,CContactListGroup*>*)pGroup->GetParent();
}
}
}
示例5: RemoveItem
void NickDataViewCtrl::RemoveUser(const User& user)
{
if (!RemoveRealUser(user)) {
return;
}
//Only remove added users
if (ContainsItem(user)) {
RemoveItem(user);
}
}
示例6: D_HOOK
void DormantNodeView::_freeList() {
D_HOOK(("DormantNodeView::_freeList()\n"));
// remove and delete all items in the list
while (CountItems() > 0) {
BListItem *item = ItemAt(0);
if (RemoveItem(item)) {
delete item;
}
}
}
示例7: ValidateThis_
void
CLDisplayClassTable::SetElement(
DMElement* inElement)
{
// Validate pointers.
ValidateThis_();
if (inElement != nil)
ValidateObject_(inElement);
// See if the element has changed. If not, ignore request.
if (inElement == mElement)
return;
// Make sure screen doesn't flash while changing elements.
#if PP_Target_Carbon
StClipRgnState noFlash(nil);
#else
StVisRgn noFlash(GetMacPort());
#endif
ValidateObject_(mSuperView);
mSuperView->Refresh();
// Override to allow changing elements. If we are assigned
// to an element already, empty the table.
if (mElement != nil) {
ValidateObject_(mElement.GetObject());
while (mRows > 0) {
LOutlineItem* item = FindItemForRow(1);
ValidateObject_(item);
RemoveItem(item, false, false);
}
AdjustImageSize(false);
mSuperView->Refresh(); // GHD: Refresh SuperView so that scroll bars get redrawn
mElement->RemoveListener(this);
mElement = nil;
mContainer = nil;
}
// Now call the inherited method for set element only
// if the new element is non-nil.
if (inElement != nil)
OVTable::SetElement(inElement);
}
示例8: assert
void Sound::ProcessSamplerRemove()
{
std::vector<size_t> & sremove = samplers_update.getLast().sremove;
for (size_t i = 0; i < sremove.size(); ++i)
{
size_t id = sremove[i];
assert(id < samplers.size());
RemoveItem(id, samplers, samplers_num);
}
sremove.clear();
}
示例9: LocateDeletedItem
void CMyTreeView::RemoveItem(const TCHAR *szFullFileName)
{
HTREEITEM hItem;
hItem = LocateDeletedItem(szFullFileName);
if(hItem != NULL)
{
RemoveItem(hItem);
}
}
示例10:
/*****************************************************************************
* DragSortableListView::RemoveItemList
*****************************************************************************/
void
DragSortableListView::RemoveItemList( BList& items )
{
int32 count = items.CountItems();
for ( int32 i = 0; i < count; i++ )
{
BListItem* item = (BListItem*)items.ItemAt( i );
if ( RemoveItem( item ) )
delete item;
}
}
示例11: while
void
NotifyList::UpdateList(BObjectList<NotifyListItem> *newList)
{
while (CountItems() > 0)
delete RemoveItem ((int32)0);
BList updateList;
// make private copy of list items otherwise things go bad
for (int32 i = 0; i < newList->CountItems(); i++)
updateList.AddItem (new NotifyListItem (*newList->ItemAt(i)));
AddList(&updateList);
}
示例12: AFX_MANAGE_STATE
IWindowContainer* SplitterContainer::RemoveItem(IWindow *lpWnd, bool bUpdateComponents)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
for(int i=0; i<MAXITEMSCOL; i++)
{
if(m_bHorizontalMode)
{
TWindows &tw = m_controls[0][i];
if(tw.itf == lpWnd)
RemoveItem(i, NULL, bUpdateComponents);
}
else
{
TWindows &tw = m_controls[i][0];
if(tw.itf == lpWnd)
RemoveItem(i, NULL, bUpdateComponents);
}
}
return this;
}
示例13: GetTickCount
void vmsBrowserActivityMonitor::RemoveTimedoutItems(void)
{
DWORD dwNow = GetTickCount ();
vmsAUTOLOCKSECTION (m_csList);
for (size_t i = 0; i < m_vList.size (); i++)
{
if (dwNow - m_vList [i].dwTimeLastActivity >= 10*1000)
RemoveItem (i--);
}
}
示例14: RemoveItem
void LogisticsPilotListBox::removePilot(LogisticsPilot* pPilot)
{
for(size_t i = 0; i < itemCount; i++)
{
LogisticsPilotListBoxItem* pItem = dynamic_cast<LogisticsPilotListBoxItem*>(items[i]);
if(pItem && pItem->getPilot() == pPilot)
{
RemoveItem(pItem, true);
return;
}
}
}
示例15: RemoveItem
/** Use the selected item on the inventory
* @param item : the inventory
* @param data : the object on what is item is used (generally a character)
*/
void Inventory::UseSelectedItem(void* data)
{
if(selected_item != NULL)
{
int count = selected_item->Use(data);
if(count == 0)
{
RemoveItem(selected_item);
selected_item = NULL;
}
}
}