Exemple #1
0
void CPropTree::SelectItems(CPropTreeItem* pItem, BOOL bSelect)
{
	if (!pItem)
		pItem = &m_Root;

	EnumItems(pItem, EnumSelectAll, (LPARAM)bSelect);
}
void CEGPropertyGrid::SelectItems(CEGPropertyGridItem* pItem, BOOL bSelect)
{
	if (!pItem)
		pItem = &m_Root;

	EnumItems(pItem, EnumSelectAll, (LPARAM)bSelect);
}
Exemple #3
0
BOOL COptionTree::EnumItems(COptionTreeItem* otiItem, ENUM_OPTIONITEMPROC enumProc, LPARAM lParam)
{
	// Declare variables
	COptionTreeItem* otiNext;
	BOOL bRet = TRUE;

	// Validate items
	if (!otiItem || !enumProc)
	{
		return FALSE;
	}

	// Don't count the root item in any enumerations
	if (otiItem != &m_otiRoot && !enumProc(this, otiItem, lParam))
	{
		return FALSE;
	}

	// Recurse thru all child items
	otiNext = otiItem->GetChild();
	while (otiNext != NULL)
	{
		if (!EnumItems(otiNext, enumProc, lParam))
		{
			bRet = FALSE;
		}

		otiNext = otiNext->GetSibling();
	}

	return bRet;
}
CEGPropertyGridItem* CEGPropertyGrid::FindItem(UINT nCtrlID)
{
	s_pFound = NULL;

	EnumItems(&m_Root, EnumFindItem, nCtrlID);

	return s_pFound;
}
Exemple #5
0
CPropTreeItem* CPropTree::FindItem(UINT nCtrlID)
{
	s_pFound = NULL;

	EnumItems(&m_Root, EnumFindItem, nCtrlID);

	return s_pFound;
}
Exemple #6
0
void CPropTree::RefreshItems(CPropTreeItem* pItem)
{
	if (!pItem)
		pItem = &m_Root;

	EnumItems(pItem, EnumRefreshAll);

	UpdatedItems();
}
void CEGPropertyGrid::RefreshItems(CEGPropertyGridItem* pItem)
{
	if (!pItem)
		pItem = &m_Root;

	EnumItems(pItem, EnumRefreshAll);

	UpdatedItems();
}
Exemple #8
0
COptionTreeItem * COptionTree::FindItem(UINT uCtrlID)
{
	// Mark found as NULL
	m_otiFound = NULL;

	// Enumerate items
	EnumItems(&m_otiRoot, EnumFindItem, uCtrlID);

	return m_otiFound;
}
Exemple #9
0
CRect COptionTree::GetLargestVisibleLabel()
{
	// Set as negative
	m_rcLargestLabel = CRect(0, 0, 0, 0);

	// Enumerate items
	EnumItems(&m_otiRoot, EnumGetLargestVisibleLabelRect, NULL);

	return m_rcLargestLabel;
}
Exemple #10
0
void COptionTree::SelectItems(COptionTreeItem *otiItem, BOOL bSelect)
{
	// Declare variables
	if (otiItem == NULL)
	{
		otiItem = &m_otiRoot;
	}

	// Enum items
	EnumItems(otiItem, EnumSelectAll, (LPARAM) bSelect);
}
Exemple #11
0
void COptionTree::RefreshItems(COptionTreeItem *otiItem)
{
	// If item is NULL, refresh from root
	if (otiItem == NULL)
	{
		otiItem = &m_otiRoot;
	}

	// Enum refresh all
	EnumItems(otiItem, EnumRefreshAll);

	// Update items
	UpdatedItems();
}
Exemple #12
0
void COptionTree::ExpandAllItems()
{
	// Declare variables
	COptionTreeItem *otiItem;

	// If item is NULL, refresh from root
	otiItem = &m_otiRoot;

	// Enum refresh all
	EnumItems(otiItem, EnumExpandAll);

	// Update items
	UpdatedItems();
}
Exemple #13
0
void EnumItems(int nId, std::vector< std::pair<int, int> >& vIds)
{
	Assist::IItemIteratorPtr item = CItems::GetItem(nId);

	IStatementPtr st = CApplicationImpl::Get().GetStatement();
	st->sql(_T("select id from adx_items where parent = :parent"));
	int id;
	st->use((int&)nId, _T(":parent"));
	st->into(id, _T("id"));
	while (st->exec())
	{
		EnumItems(id, vIds);
	}
	
	if (item->GetParentId() > 0)
	{
		std::pair<int, int> pairItem(nId, item->IsFolder());
		vIds.push_back(pairItem);
	}
}
Exemple #14
0
void CItems::Delete(std::vector<int>& vIds, BOOL bRemove /*= FALSE*/)
{
	std::map<int, int> setIds;
	for (std::vector<int>::iterator it = vIds.begin(); it != vIds.end(); ++it)
	{
		if (setIds.find(*it) == setIds.end())
		{
			std::vector< std::pair<int, int> > v;
			EnumItems(*it, v);
			for (std::vector< std::pair<int, int> >::iterator vi = v.begin(); vi != v.end(); ++vi)
			{
				// first - id, second - is folder
				setIds[vi->first] = vi->second;
			}
		}
	}

	for (std::map<int, int>::iterator it = setIds.begin(); it != setIds.end(); ++it)
	{
		if (bRemove)
		{
			RemoveItem(it->first);
		}
		else
		{
			MarkDeleted(it->first);
		}
		if (it->second) // folder
		{
			CApplicationImpl::Get().UpdateViews(UNM_FOLDER_DELETED, it->first);
		}
		else
		{
			CApplicationImpl::Get().UpdateViews(UNM_ITEM_DELETED, it->first);
		}
	}
}
BOOL CEGPropertyGrid::EnumItems(CEGPropertyGridItem* pItem, ENUMPROPITEMPROC proc, LPARAM lParam)
{
	if (!pItem || !proc)
		return FALSE;

	CEGPropertyGridItem* pNext;

	// don't count the root item in any enumerations
	if (pItem!=&m_Root && !proc(this, pItem, lParam))
		return FALSE;

	// recurse thru all child items
	pNext = pItem->GetChild();

	while (pNext)
	{
		if (!EnumItems(pNext, proc, lParam))
			return FALSE;

		pNext = pNext->GetSibling();
	}

	return TRUE;
}
void PropertyTree::UpdateMoveAllItems()
{
    EnumItems(&m_Root, EnumMoveAll);
}
void CEGPropertyGrid::UpdateMoveAllItems()
{
	EnumItems(&m_Root, EnumMoveAll);
}
Exemple #18
0
void CPropTree::UpdateMoveAllItems()
{
	EnumItems(&m_Root, EnumMoveAll);
}
Exemple #19
0
void COptionTree::UpdateMoveAllItems()
{
	// Enum move all
	EnumItems(&m_otiRoot, EnumMoveAll);
}
Exemple #20
0
void COptionTree::ClearAllLabelRect()
{
	// Enumerate items
	EnumItems(&m_otiRoot, EnumClearAllLabelRect, NULL);
}
Exemple #21
0
void COptionTree::Expand(COptionTreeItem *pItem, BOOL bExpand)
{
	// Enum move all
	EnumItems(pItem, EnumNotifyExpand, (LPARAM) bExpand);
}