Beispiel #1
0
// Deletes a string from the list box.
//
// Parameters:
//		[IN]	nIndex
//				Specifies the zero-based index of the string to be deleted.
//
// Return value:
//		A count of the strings remaining in the list box.
//		The return value is LB_ERR if nIndex specifies an index greater than 
//		the number of items in the list.
//
int CListBoxST::DeleteString(int nIndex)
{
	int	nRetValue = LB_ERR;

	DeleteItemData(nIndex);
	nRetValue = CListBox::DeleteString(nIndex);

	return nRetValue;
} // End of DeleteString
Beispiel #2
0
void CListBoxST::FreeResources()
{
	int	nCount = 0;

	nCount = GetCount();
	if (nCount != LB_ERR)
		for (;nCount > 0; nCount--)
		{
			DeleteItemData(nCount-1);
		} // for
} // End of FreeResources
Beispiel #3
0
void CMyTreeCtrl::DeleteItemData( HTREEITEM hItem )
{
	if( hItem == (HTREEITEM)NULL )
		return;

	PSrvrData pData		= (PSrvrData)GetItemData( hItem );
	if( NULL != pData )
	{
		safe_delete( pData );
		SetItemData( hItem, NULL );
	}
	
	if( TRUE == ItemHasChildren( hItem ) )
	{
		DeleteItemData( GetChildItem( hItem ) );
		DeleteItemData( GetNextSiblingItem( hItem ) );
	}
	else
	{
		DeleteItemData( GetNextSiblingItem( hItem ) );
	}
}
Beispiel #4
0
void CMyTreeCtrl::Clear( void )
{
	DeleteItemData( GetRootItem() );
	DeleteAllItems();
}