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


C++ DeleteItem函数代码示例

本文整理汇总了C++中DeleteItem函数的典型用法代码示例。如果您正苦于以下问题:C++ DeleteItem函数的具体用法?C++ DeleteItem怎么用?C++ DeleteItem使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了DeleteItem函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ASSERT

//更新信息
bool CUserCompanionList::UpdateCompanionInfo(HTREEITEM hTreeItem, tagCompanionItem * pCompanionInfo)
{
	//效验参数
	ASSERT(hTreeItem!=NULL);
	if (hTreeItem==NULL) return false;

	//更新处理
	if (GetTreeItemCompanion(hTreeItem)==pCompanionInfo->Companion)
	{
		//生成标题
		TCHAR szTreeTitle[128]=TEXT("");
		_sntprintf_s(szTreeTitle,CountArray(szTreeTitle),TEXT("%s [ %ld ]"),pCompanionInfo->szAccounts,pCompanionInfo->dwGameID);

		//更新树项
		SetItemText(hTreeItem,szTreeTitle);
	}
	else
	{
		//删除树项
		DeleteItem(hTreeItem);
		InsertCompanionInfo(pCompanionInfo);
	}
	
	return true;
}
开发者ID:vsanth,项目名称:kkj,代码行数:26,代码来源:UserCompanionList.cpp

示例2: DeleteItem

void MainWindow::on_mainAir_clicked()
{
    menu = 4;
    int j=0;
    DeleteItem();
    get_devlist(devfd,dev_list);
    ui->mainList->setColumnCount(2);

    for(i=0; i<254; i++)
    {
        if(dev_list[i].addr==255)
            break;
        printf("dev_list[%d].addr=%d\n",i,dev_list[i].addr);
        printf("dev_list[%d].devicetype=%d\n",i,dev_list[i].devicetype);


        if(dev_list[i].devicetype == 4)
        {
            QString str = "TV";

            str.toStdString().c_str();

            ui->mainList->insertRow(j);
            QTableWidgetItem *item = new QTableWidgetItem( QString("Air Controller"), 0);
            ui->mainList->setItem(j, 0, item);
            QTableWidgetItem *item2 = new QTableWidgetItem( str.setNum(dev_list[i].addr), 0);
            ui->mainList->setItem(j, 1, item2);
            j++;
        }

    }
}
开发者ID:swc8912,项目名称:Biablo,代码行数:32,代码来源:mainwindow.cpp

示例3: CommonPrefix

	bool Trie::DeleteItem(NodeFrm::POINTER node, const Location& location){

		Location location1 = node->location_;
		if (location1.length() > location.length()){
			return false;
		}

		if (location == location1){
			node->MarkRemove();
			return true;
		}

		Location common = CommonPrefix(location1, location);

		int branch = NextBranch(common, location);
		NodeFrm::POINTER node2 = ChildMayFromDB(node, branch);
		if (node2 == nullptr){
			return false;
		}

		Location location2 = node2->location_;
		Location common2 = CommonPrefix(location2, location);
		if (location2 != common2){
			return false;
		}
		bool ret = DeleteItem(node2, location);
		node->modified_ |= ret;
		return ret;
	}
开发者ID:AshKarath,项目名称:bumo,代码行数:29,代码来源:trie.cpp

示例4: DeleteItem

//==============================================================================
// Brief  : デストラクタ
// Return :								: なし
// Arg    :								: なし
//==============================================================================
CManagerObjectImage::~CManagerObjectImage( void )
{
	// ステートテーブルの破棄
	if( m_ppTableState != nullptr )
	{
		for( int cntState = 0; cntState < CObjectImage::STATE_MAX; ++cntState )
		{
			delete m_ppTableState[ cntState ];
			m_ppTableState[ cntState ] = nullptr;
		}
	}
	delete[] m_ppTableState;
	m_ppTableState = nullptr;

	// 生成した要素の破棄
	for( auto pItemCurrent = m_pImage->m_pItemTop; pItemCurrent != nullptr; pItemCurrent = pItemCurrent->m_pNext )
	{
		DeleteItem( pItemCurrent );
	}

	// ポリゴン描画設定の破棄
	delete m_pRenderParameterPolygon;
	m_pRenderParameterPolygon = nullptr;

	// リストの破棄
	delete m_pImage;
	m_pImage = nullptr;
}
开发者ID:mxt819,项目名称:H405,代码行数:33,代码来源:ManagerObjectImage.cpp

示例5: SetRedraw

void CDirectoryTreeCtrl::OnTvnItemexpanding(NMHDR *pNMHDR, LRESULT *pResult)
{
	CWaitCursor curWait;
	SetRedraw(FALSE);

	LPNMTREEVIEW pNMTreeView = reinterpret_cast<LPNMTREEVIEW>(pNMHDR);
	HTREEITEM hItem = pNMTreeView->itemNew.hItem;
	// remove all subitems
	HTREEITEM hRemove = GetChildItem(hItem);
	while(hRemove)
	{
		DeleteItem(hRemove);
		hRemove = GetChildItem(hItem);
	}

	// get the directory
	CString strDir = GetFullPath(hItem);

	// fetch all subdirectories and add them to the node
	AddSubdirectories(hItem, strDir);

	SetRedraw(TRUE);
	Invalidate();
	*pResult = 0;
}
开发者ID:BackupTheBerlios,项目名称:nextemf,代码行数:25,代码来源:DirectoryTreeCtrl.cpp

示例6: DeleteItem

// Frees the memory allocated for the item and removes it from the list. 
BOOL MyListCtrl::FreeItem(int Index)
{
	ITEMINFO* pItem=(ITEMINFO*)GetItemData(Index);
	if(pItem)
		delete pItem;
	return DeleteItem(Index);
}
开发者ID:Coder-666,项目名称:uRSAlib,代码行数:8,代码来源:MyListCtrl.cpp

示例7: OnDestroyPage

BOOL CTabCtrlSSL::RemoveSSLPage (int nIndex) {
	if (nIndex >= GetItemCount ())
		return FALSE;

	// Notify derived classes that the page is being destroyed.
	OnDestroyPage (nIndex, m_nPageIDs[nIndex]);

	// Switch pages if the page being deleted is the current page and it's
	// not the only remaining page.
	int nCount = GetItemCount ();
	if (nCount > 1 && nIndex == GetCurSel ()) {
		int nPage = nIndex + 1;
		if (nPage >= nCount)
			nPage = nCount - 2;
		ActivateSSLPage (nPage);
	}

	// Remove the page from the tab control.
	DeleteItem (nIndex);

	// Destroy the dialog (if any) that represents the page.
    TabDelete tabDelete = m_tabs[nIndex];
    CTabPageSSL* pDialog = tabDelete.pTabPage;
	if (pDialog != NULL) {
		pDialog->DestroyWindow ();	
		delete pDialog;
	}

	// Clean up, repaint, and return.
	m_tabs.RemoveAt (nIndex);
	m_hFocusWnd.RemoveAt (nIndex);
	m_nPageIDs.RemoveAt (nIndex);
	Invalidate ();
	return TRUE;
}
开发者ID:yning,项目名称:FormerWork,代码行数:35,代码来源:TabCtrlSSL.cpp

示例8: main

int main()
{
	HashList hl;
	char choose;

	InitHashList(hl);
	while((choose = Menu()) != 'd')
	{
		switch(choose)
		{
		case 'a'://插入数据
			InsertItem(hl);
			break;
		case 'b'://查询数据
			SearchItem(hl);
			break;
		case 'c'://删除数据
			DeleteItem(hl);
			break;
		default:
			puts("请输入a、b、c来进行选择操作");
			break;
		}
	}
	ClearHashList(hl);
	return 0;
}
开发者ID:18616378431,项目名称:myCode,代码行数:27,代码来源:main.c

示例9: GetNextSiblingItem

void CLibraryFolderCtrl::Update(DWORD nUpdateCookie)
{
	CPtrList pAlready;

	for ( HTREEITEM hItem = GetChildItem( m_hRoot ) ; hItem ; )
	{
		HTREEITEM hNext = GetNextSiblingItem( hItem );

		CLibraryFolder* pFolder = (CLibraryFolder*)GetItemData( hItem );

		if ( LibraryFolders.CheckFolder( pFolder ) )
		{
			Update( pFolder, hItem, NULL, nUpdateCookie, FALSE );
			pAlready.AddTail( pFolder );
		}
		else
		{
			DeleteItem( hItem );
		}

		hItem = hNext;
	}

	for ( POSITION pos = LibraryFolders.GetFolderIterator() ; pos ; )
	{
		CLibraryFolder* pFolder = LibraryFolders.GetNextFolder( pos );

		if ( pAlready.Find( pFolder ) == NULL )
		{
			Update( pFolder, NULL, m_hRoot, nUpdateCookie, FALSE );
		}
	}
}
开发者ID:ericfillipe1,项目名称:shareaza-code,代码行数:33,代码来源:CtrlSharedFolder.cpp

示例10: PurgeOldConnections

static void PurgeOldConnections(Item **list, time_t now)
   /* Some connections might not terminate properly. These should be cleaned
      every couple of hours. That should be enough to prevent spamming. */
{
    assert(list != NULL);

    Log(LOG_LEVEL_DEBUG, "Purging Old Connections...");

    if (ThreadLock(cft_count))
    {
        Item *ip, *next;
        for (ip = *list; ip != NULL; ip = next)
        {
            int then = 0;
            sscanf(ip->classes, "%d", &then);

            next = ip->next;

            if (now > then + 7200)
            {
                Log(LOG_LEVEL_VERBOSE,
                    "IP address '%s' has been more than two hours in connection list, purging",
                    ip->name);
                DeleteItem(list, ip);
            }
        }
        ThreadUnlock(cft_count);
    }

    Log(LOG_LEVEL_DEBUG, "Done purging old connections");
}
开发者ID:lra,项目名称:core,代码行数:31,代码来源:server.c

示例11: KG_PROCESS_ERROR

LRESULT KGTreeCtrl::OnDel(WPARAM wParam, LPARAM lParam)
{
	int nResult  = false;
	int nRetCode = false;

	HTREEITEM hDelItem  = NULL;
	HTREEITEM hNextItem = NULL;

	int nItemDate = 0;

	hDelItem = (HTREEITEM)wParam;;
	KG_PROCESS_ERROR(hDelItem);

	hNextItem = GetNextSiblingItem(hDelItem);

	nRetCode = BeginDelItem(hDelItem);
	KG_PROCESS_ERROR(nRetCode);

	nRetCode = DeleteItem(hDelItem);
	KG_PROCESS_ERROR(nRetCode);

	nRetCode = AfterDelItem(hNextItem);
	KG_PROCESS_ERROR(nRetCode);

	nResult = true;
Exit0:
	return nResult;
}
开发者ID:viticm,项目名称:pap2,代码行数:28,代码来源:KGTreeCtrl.cpp

示例12: EndEdit

int CReportCtrl::DeleteAllItems(DWORD dwStates)
{
	EndEdit(FALSE);
	int nItemCount = CListCtrl::GetItemCount();
	if (dwStates & RC_ITEM_ALL)
	{
		LockWindowUpdate();
		for (int i = 0; i < nItemCount; i++)
			_FreeItemMemory(i);
		CListCtrl::DeleteAllItems();
		UnlockWindowUpdate();
		return nItemCount;		
	}
	
	int nDelCount = 0;
	LockWindowUpdate();

	for (int i = 0; i < nItemCount; i++)
	{
		if (ExamItemStates(i, dwStates))
		{
			DeleteItem(i--);
			nItemCount--;
			nDelCount++;
		}
	}	
	UnlockWindowUpdate();
	return nDelCount;
}
开发者ID:AmesianX,项目名称:A-Protect,代码行数:29,代码来源:ReportCtrl.cpp

示例13: FindInstrument

void CInstrumentList::RemoveInstrument(int Index)
{
	// Remove an instrument from the list (Index = instrument number)
	int Selection = FindInstrument(Index);
	if (Selection != -1)
		DeleteItem(Selection);
}
开发者ID:WhoIsLudwig,项目名称:nesicide,代码行数:7,代码来源:InstrumentListCtrl.cpp

示例14: ASSERT

void CXTPMDIWndTab::OnMDIDestroy(HWND hWnd)
{
	// Loop through all of the tabs to find the view that has closed.
	int iItem;
	for (iItem = 0; iItem < GetItemCount(); ++iItem)
	{
		// Get the item data for this tab.
		TC_ITEM tci;
		tci.mask = TCIF_PARAM;

		if (GetItem(iItem, &tci))
		{
			MDICHILD* pMDIChild = (MDICHILD*)tci.lParam;
			ASSERT(pMDIChild != NULL);

			// If it is the closed window remove it and exit loop.
			if (pMDIChild && (hWnd == pMDIChild->hWnd))
			{
				POSITION pos = m_arMDIChildern.Find(pMDIChild);
				if (pos)
				{
					m_arMDIChildern.RemoveAt(pos);
					SAFE_DELETE(pMDIChild);
				}

				DeleteItem(iItem);
				break;
			}
		}
	}

	RefreshIndexes();
	RecalcLayout(TRUE);
}
开发者ID:lai3d,项目名称:ThisIsASoftRenderer,代码行数:34,代码来源:XTPMDIWndTab.cpp

示例15: GetItemRect

// Moves the tab from the old position to the new position
void COXDockTabCtrl::RepositionTabs(int iOldIndex, int iNewIndex, CPoint point)
{
	// To avoid flashing only reposition if the mouse cursor is behind the midpoint
	// of the next or previous item
	
	CRect rectNew;
	GetItemRect(iNewIndex, rectNew);
	ScreenToClient(&point);
	if (iOldIndex < iNewIndex)
	{
		// The new tab is to the right
		if (point.x < rectNew.CenterPoint().x)
			return; // the mouse cursor is not far enough to the right
	}
	else
	{
		// The new tab is to the left
		if (point.x > rectNew.CenterPoint().x)
			return; // the mouse cursor is not far enough to the left
	}

	TCHAR szBuffer[256];

	TCITEM tci;
	tci.mask = TCIF_TEXT | TCIF_PARAM;
	tci.pszText = szBuffer;
	tci.cchTextMax = 256;
	GetItem(iOldIndex, &tci);

	DeleteItem(iOldIndex);
	InsertItem(iNewIndex, &tci);
}
开发者ID:drupalhunter-team,项目名称:TrackMonitor,代码行数:33,代码来源:OXDockTabCtrl.cpp


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