void CDirstatDoc::SetSelection(const CItem *item, bool keepReselectChildStack) { CItem *newzoom= CItem::FindCommonAncestor(m_zoomItem, item); if (newzoom != m_zoomItem) SetZoomItem(newzoom); bool keep= keepReselectChildStack || m_selectedItem == item; m_selectedItem= const_cast<CItem *>(item); GetMainFrame()->SetSelectionMessageText(); if (!keep) ClearReselectChildStack(); }
// Starts a refresh of an item. // If the physical item has been deleted, // updates selection, zoom and working item accordingly. // void CDirstatDoc::RefreshItem(CItem *item) { ASSERT(item != NULL); CWaitCursor wc; ClearReselectChildStack(); if(item->IsAncestorOf(GetZoomItem())) { SetZoomItem(item); } // FIXME: Multi-select if(item->IsAncestorOf(GetSelection(0))) { SetSelection(item); UpdateAllViews(NULL, HINT_SELECTIONCHANGED); } SetWorkingItemAncestor(item); CItem *parent = item->GetParent(); if(!item->StartRefresh()) { if(GetZoomItem() == item) { SetZoomItem(parent); } // FIXME: Multi-select if(GetSelection(0) == item) { SetSelection(parent); UpdateAllViews(NULL, HINT_SELECTIONCHANGED); } if(m_workingItem == item) { SetWorkingItem(parent); } } UpdateAllViews(NULL); }