Beispiel #1
0
HTREEITEM FolderView::SetupRoot(FolderPathPtr path, bool folder_as_root)
{
	if (path == 0)
		return 0;

	ShellFolder* shl_folder= 0;

	try
	{
		if (path)
			shl_folder = path->CreateShellFolder(m_hWnd, folder_as_root);
		else
			shl_folder = new ShellFolder(m_hWnd, 0);

		//Path path= path->GetPath();
		//if (path.MatchExtension(_T("catalog")) && !path.IsFolder())
		//	shl_folder = new CatalogFolder(path, m_hWnd, folder_as_root);
		//else
		//{
		//	const ITEMIDLIST* idl= idlRoot;
		//	shl_folder = new ShellFolder(m_hWnd, folder_as_root ? idl : 0);
		//}
	}
	catch (int)
	{
		return NULL;
	}

	if (shl_folder)
	{
		if (HTREEITEM item= InsertItem(shl_folder))
		{
			if (folder_as_root)
				return item;

			Expand(item, TVE_EXPAND);

	//TODO ======== make it work for catalog paths =================================TODO
			// find item 'path' and expand tree to this node folder
			ItemIdList pidl= path ? path->GetPIDL() : ItemIdList();
			return ExpandTo(item, pidl);
		}

		delete shl_folder;
	}

	return NULL;
}
void CXTPReportRecordItemRange::ExpandTo(
	const CXTPReportRecordItemId expand)
{
	ExpandTo(expand.m_nColumn, expand.m_nRecord);
}
Beispiel #3
0
void AABB::ExpandTo(const AABB& a) {
  ExpandTo(a.m_Min);
  ExpandTo(a.m_Max);
}
Beispiel #4
0
 /**
  * @tparam Random the type of the random generator.
  * @param[in,out] r a random generator.
  * @param[in] k the index of a digit of the fraction
  * @return digit number \e k, generating it if necessary.
  **********************************************************************/
 template<class Random> unsigned Digit(Random& r, unsigned k) {
   ExpandTo(r, k + 1);
   return _f[k];
 }