void StrucViewItem::expandNode( int index ) //----------------------------------------- { VerboseListBox * listbox = _parent->getListBox(); WVList * listobjs = _parent->getObjs(); int childIndex = index + 1; int i; initState(); if( _expandState == Collapsed ) { _expandState=Expanded; } else { return; } char * tmp = name(); listbox->deleteString( index ); listbox->insertString( tmp, index ); delete tmp; listobjs->removeAt( index ); listobjs->insertAt( index, this ); for( i = 0; i < _kids.count(); i++ ) { char *tmp = ((StrucViewItem *)_kids[i])->name(); listbox->insertString( tmp, childIndex ); delete tmp; listobjs->insertAt( childIndex, _kids[i] ); childIndex ++; } listbox->select( index ); return; }
void StrucViewItem::expandAllNode( int &index ) //--------------------------------------------- { WVList * listobjs = _parent->getObjs(); VerboseListBox * listbox = _parent->getListBox(); initState(); if( (*listobjs)[ index ] != this ) { if( _expandState == Collapsed ) { _expandState = Expanded; } listobjs->insertAt( index, this ); char * tmp = name(); listbox->insertString( tmp, index ); delete tmp; if( _expandState == Collapsed ) { _expandState = Expanded; } } else { if( _expandState == Collapsed ) { _expandState = Expanded; listbox->deleteString( index ); char * tmp = name(); listbox->insertString( tmp, index ); delete tmp; } } index += 1; if( _expandState != LeafNode ) { for( int i = 0; i < _kids.count(); i++ ) { ((StrucViewItem *)_kids[ i ])->expandAllNode( index ); } } }