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


C++ RemoveItem函数代码示例

本文整理汇总了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;
}
开发者ID:jithuin,项目名称:infogeezer,代码行数:10,代码来源:XmlFile.cpp

示例2: FindJob

void
JobListView::RemoveJob(Job* job)
{
	JobItem* item = FindJob(job);
	if (item) {
		RemoveItem(item);
		delete item;
		Invalidate();
	}
}
开发者ID:mmanley,项目名称:Antares,代码行数:10,代码来源:JobListView.cpp

示例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());
}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:10,代码来源:yapp_history.cpp

示例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();
		}
	}
}
开发者ID:kmdtukl,项目名称:miranda-ng,代码行数:58,代码来源:CContactList.cpp

示例5: RemoveItem

void NickDataViewCtrl::RemoveUser(const User& user)
{
	if (!RemoveRealUser(user)) {
		return;
	}

	//Only remove added users
	if (ContainsItem(user)) {
		RemoveItem(user);
	}
}
开发者ID:OursDesCavernes,项目名称:springlobby,代码行数:11,代码来源:nickdataviewctrl.cpp

示例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;
		}
	}
}
开发者ID:mariuz,项目名称:haiku,代码行数:11,代码来源:DormantNodeView.cpp

示例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);
}
开发者ID:MaddTheSane,项目名称:tntbasic,代码行数:54,代码来源:CLDisplayClassTable.cpp

示例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();
}
开发者ID:JanneSalokoski,项目名称:vdrift,代码行数:11,代码来源:sound.cpp

示例9: LocateDeletedItem

void CMyTreeView::RemoveItem(const TCHAR *szFullFileName)
{
	HTREEITEM hItem;

	hItem = LocateDeletedItem(szFullFileName);

	if(hItem != NULL)
	{
		RemoveItem(hItem);
	}
}
开发者ID:3scp8,项目名称:explorerplusplus,代码行数:11,代码来源:DirectoryModificationHandler.cpp

示例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;
    }
}
开发者ID:forthyen,项目名称:SDesk,代码行数:14,代码来源:ListViews.cpp

示例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);
}
开发者ID:xray7224,项目名称:Vision,代码行数:11,代码来源:NotifyList.cpp

示例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;
}
开发者ID:lalalaring,项目名称:SvcMFCUI,代码行数:20,代码来源:SplitterContainer.cpp

示例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--); 
	}
}
开发者ID:HackLinux,项目名称:Free-Download-Manager-vs2010,代码行数:12,代码来源:vmsBrowserActivityMonitor.cpp

示例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;
		}
	}
}
开发者ID:BobrDobr69,项目名称:mechcommander2,代码行数:12,代码来源:logisticspilotlistbox.cpp

示例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;
        }
    }
}
开发者ID:Rhynoo,项目名称:Mini_jeu_2D,代码行数:16,代码来源:Inventory.cpp


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