BOOL CCedtView::RefreshMacroBufferFilePathForMenu()
{
	for( INT i = 0; i < 8; i++ ) m_szMacroBufferFilePath[i] = "";

	CSortStringArray arrPathName;
	CString szPathName = CCedtApp::m_szInstallDirectory + "\\tools\\*.mac";

	BOOL bFound = FindAllFilePath(arrPathName, szPathName);
	arrPathName.QuickSort();

	INT size = arrPathName.GetSize(); if( size > 8 ) size = 8;
	for( i = 0; i < size; i++ ) m_szMacroBufferFilePath[i] = arrPathName[i];

	return TRUE;
}
示例#2
0
void CDirTreeCtrl::DisplayPath(HTREEITEM hParent, LPCTSTR strPath)
{
	//
	// Displaying the Path in the TreeCtrl
	//
	CFileFind find;
	CString   strPathFiles = strPath;
	BOOL      bFind;
	CSortStringArray strDirArray;
	CSortStringArray strFileArray;
	
	if ( strPathFiles.Right(1) != _T("\\") )
		strPathFiles += _T("\\");
	strPathFiles += _T("*.*");

	bFind = find.FindFile( strPathFiles );

	while ( bFind )
	{
		bFind = find.FindNextFile();
		if ( find.IsDirectory() && !find.IsDots() )
		{		
			strDirArray.Add( find.GetFilePath() );
		}
		if ( !find.IsDirectory() && m_bFiles )
			strFileArray.Add( find.GetFilePath() );

	}
    
	strDirArray.Sort();
	SetRedraw( FALSE );
	CWaitCursor wait;
    
	for ( int i = 0; i < strDirArray.GetSize(); i++ )
	{
			HTREEITEM hItem = AddItem( hParent, strDirArray.GetAt(i) );
			if ( FindSubDir( strDirArray.GetAt(i) ) )
				InsertItem( _T(""), 0, 0, hItem );
	}

	if ( m_bFiles )
	{
		strFileArray.Sort();
		for (int i = 0; i < strFileArray.GetSize(); i++ )
		{
			HTREEITEM hItem = AddItem( hParent, strFileArray.GetAt(i) );
			
		}
	}
    
	SetRedraw( TRUE );

	
}