void CUSBLogView::OnExpand(void) { CWaitCursor waitcursor; CArrayData arData; CMyDWORDArray arURBS; if(!m_Log.GetSelectionArrays(arData, arURBS)) { return; } // find the URB which has the focus... int nFocusedURB = m_Log.FindFocusedURB(); m_Log.SetFocusedURB(nFocusedURB, FALSE); int nIndex = arURBS.GetUpperBound(); while(0 <= nIndex) { ExpandItem(m_Log.FindURB(arURBS.GetAt(nIndex))); nIndex--; } // unselect all OnEditSelectNone(); // reselect the right things.... nIndex = 0; while(nIndex < arURBS.GetSize()) { m_Log.SetItemState(m_Log.FindURB(arURBS.GetAt(nIndex)), LVIS_SELECTED, LVIS_SELECTED); nIndex++; } // set the focus back... m_Log.SetFocusedURB(nFocusedURB); }
void CUSBLogView::OnInitialUpdate() { TRACE("CUSBLogView::OnInitialUpdate()\n"); CFormView::OnInitialUpdate(); ResizeParentToFit(); CUSBLogDoc *pDoc = GetDocument(); m_Log.OnInitialUpdate(); m_Log.SetURBArray(&pDoc->m_arURB); for(int nURB = 0; nURB < pDoc->m_arURB.GetSize(); nURB++) { CURB *pURB = pDoc->m_arURB.GetAt(nURB); if(pURB->IsExpanded()) { CollapseItem(m_Log.FindURB(nURB)); ExpandItem(m_Log.FindURB(nURB)); } } m_cStop.SetBitmap(m_hbmStop); m_cPlayPause.SetBitmap(m_hbmStop); OnUpdate(NULL, 0, NULL); }
void EXWaitingTreeCtrl::PopulateRoot() { PreExpandItem(TVI_ROOT); ExpandItem(TVI_ROOT); // force update, don't scroll SetRedraw(FALSE); SCROLLINFO si; GetScrollInfo(SB_HORZ, &si); EnsureVisible(GetChildItem(TVI_ROOT)); SetScrollInfo(SB_HORZ, &si, FALSE); SetRedraw(); }
void EXWaitingTreeCtrl::RefreshSubItems(HTREEITEM hParent) { // if (hParent != TVI_ROOT && !ItemHasChildren(hParent)) // return; SetRedraw(FALSE); DeleteChildren(hParent); if (hParent == TVI_ROOT) PopulateRoot(); else { PreExpandItem(hParent); ExpandItem(hParent); } SetRedraw(TRUE); }
int KGListCtrl::Expand(LPKGLISTITEM pExpandItem) { ASSERT(pExpandItem); if (pExpandItem->nItemState) { ShrinkItem(pExpandItem); pExpandItem->nItemState = false; } else { ExpandItem(pExpandItem->pFirstChildItem, pExpandItem); pExpandItem->nItemState = true; } Update(FindItemPos(pExpandItem)); return true; }
void CTangramHtmlTreeExWnd::RefreshSubItems(HTREEITEM hParent) { if (hParent != TVI_ROOT && !ItemHasChildren(hParent)) return; SetRedraw(false); DeleteChildren(hParent); if (hParent == TVI_ROOT) PopulateRoot(); else { PreExpandItem(hParent); ExpandItem(hParent); } SetRedraw(true); }
void CUSBLogView::OnClickUsblog(NMHDR* /*pNMHDR*/, LRESULT* pResult) { // TRACE("OnClickUsbLog()\n"); LVHITTESTINFO HitTestInfo; ZeroMemory(&HitTestInfo, sizeof(HitTestInfo)); GetCursorPos(&HitTestInfo.pt); m_Log.ScreenToClient(&HitTestInfo.pt); int nResult = m_Log.SubItemHitTest(&HitTestInfo); /* TRACE("Result: %d\n", nResult); TRACE(" iItem: %d\n", HitTestInfo.iItem); TRACE(" iSubItem: %d\n", HitTestInfo.iSubItem); TRACE(" flags: %08x\n", HitTestInfo.flags); if(LVHT_ONITEM & HitTestInfo.flags) TRACE(" ONITEM\n"); if(LVHT_ONITEMICON & HitTestInfo.flags) TRACE(" ONITEMICON\n"); if(LVHT_ONITEMLABEL & HitTestInfo.flags) TRACE(" ONITEMLABEL\n"); if(LVHT_ONITEMSTATEICON & HitTestInfo.flags) TRACE(" ONITEMSTATEICON\n"); TRACE(" pt: %d/%d\n", HitTestInfo.pt.x, HitTestInfo.pt.y); */ if(-1 != nResult) { int nURB = m_Log.GetURB(HitTestInfo.iItem); int nLine = m_Log.GetLine(HitTestInfo.iItem); if(0 == nLine) { // TRACE("On 0 line... acting if subitem is also 0...\n"); if((0 == HitTestInfo.iSubItem) && (HitTestInfo.pt.x < 16)) { CUSBLogDoc *pDoc = GetDocument(); CURB *pURB = pDoc->m_arURB[nURB]; if(pURB->IsExpanded()) CollapseItem(HitTestInfo.iItem); else ExpandItem(HitTestInfo.iItem); } } } *pResult = 0; }
void EXWaitingTreeCtrl::OnItemExpanded(NMHDR* pNMHDR, LRESULT* pResult) { NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR; if (pNMTreeView->action & TVE_EXPAND) ExpandItem(pNMTreeView->itemNew.hItem); else if (pNMTreeView->action & TVE_COLLAPSE) { if (WantsRefresh(pNMTreeView->itemNew.hItem)) { // delete child items DeleteChildren(pNMTreeView->itemNew.hItem); } } *pResult = 0; }
void CDirTreeCtrl::OnItemexpanded(NMHDR* pNMHDR, LRESULT* pResult) { NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR; CString strPath; if ( pNMTreeView->itemNew.state & TVIS_EXPANDED ) { //UINT uTest = TVIS_EXPANDEDONCE; ExpandItem( pNMTreeView->itemNew.hItem, TVE_EXPAND ); /* // // Delete All items // And display the subpath // HTREEITEM hChild = GetChildItem( pNMTreeView->itemNew.hItem ); while ( hChild ) { DeleteItem( hChild ); hChild = GetChildItem( pNMTreeView->itemNew.hItem ); } strPath = GetFullPath( pNMTreeView->itemNew.hItem ); DisplayPath( pNMTreeView->itemNew.hItem, strPath ); */ } else { // // Delete the Items, but leave one there, for // expanding the item next time // HTREEITEM hChild = GetChildItem( pNMTreeView->itemNew.hItem ); while ( hChild ) { DeleteItem( hChild ); hChild = GetChildItem( pNMTreeView->itemNew.hItem ); } InsertItem( _T(""), pNMTreeView->itemNew.hItem ); } *pResult = 0; }
static void Percents_Expand( QE_ExpandArgs *args /* %-substitution args. */ ) { struct { TreeCtrl *tree; /* Must be first. See Percents_Any(). */ int id; } *data = args->clientData; switch (args->which) { case 'I': ExpandItem(data->tree, data->id, args->result); break; default: Percents_Any(args, Percents_Expand, "I"); break; } }
bool CFolderTree::OnItemExpanding(cTreeItem * pItem, tUINT& nChildren) { return ExpandItem(pItem); }
void CFolderTree::OnInited() { Item()->SetImageList(m_hTreeImageList); ExpandItem(NULL); Item()->ExpandItem(Item()->GetChildItem(NULL)); }
TElTreeItem* CFolderHelper::ExpandItem(TElTree* tv, AnsiString full_name) { TElTreeItem* last_valid=0; FindItem(tv,full_name,&last_valid); return ExpandItem(tv,last_valid); }
int KGTreeCtrl::ExpendAll() { return ExpandItem(GetRootItem()); }