/////////////////////////////////////////////////////////////////////////////
// CResourceFolderView message handlers
void CResourceFolderView::SetupTree()
{
	// stop updates
	SetRedraw( FALSE );

	// clear the tree
	GetTreeCtrl().DeleteAllItems();

	// use the member variable as path
	StdString pszPath = m_strResouceDirectory;

	//add the directories (ony one level will be added)
	AddDirectories( TVI_ROOT, pszPath );	

	// set updates
	SetRedraw( TRUE );
}
Beispiel #2
0
void 
ReadInPalettes(
        char *text )
{
/*
**  if text is NULL then open only the global dir and user dir, 
**  otherwise open all the directories listed *text. 
*/
   AddSystemPath();

   if (text != NULL)
      AddDirectories(text);

   AddHomePath();
   
   ReadPaletteLoop(False);

}
Beispiel #3
0
void CDriveView::OnItemExpanding(NMHDR* pNMHDR, LRESULT* pResult) 
{
	NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
    HTREEITEM hItem = pNMTreeView->itemNew.hItem;
    CString string = GetPathFromItem (hItem);

    *pResult = FALSE;

    if (pNMTreeView->action == TVE_EXPAND) {
        DeleteFirstChild (hItem);
        if (AddDirectories (hItem, string) == 0)
            *pResult = TRUE;
    }
    else { // pNMTreeView->action == TVE_COLLAPSE
        DeleteAllChildren (hItem);
        if (GetTreeCtrl ().GetParentItem (hItem) == NULL)
            GetTreeCtrl ().InsertItem (_T (""), ILI_CLOSED_FOLDER,
                ILI_CLOSED_FOLDER, hItem);
        else
            SetButtonState (hItem, string);
    }
}