model_server/gala/src/view.cxx
// find_item_recurs - Calls the container's FindItem method.
Calls the container's FindItem method.
Calls the container ' s FindItem method .
vdialogItem* find_item_recurs(vdialogItemList* itemList, const vname* tagName)
{
  vdialogItem * result = NULL;
    for (int i=0; i<itemList->GetCount() && !result; i++) {
        vobjectAttributed* vo = itemList->GetAt(i); 
        if (vo->IsKindOf(&vnotebook::Kind)) {
            vdialogItemList* il = vnotebook::CastDown(vo)->GetItemList();
            result = find_item_recurs(il, tagName);
#if 0
           if (!result) {    
               vnotebookPage* page;
               page = vnotebook::CastDown(vo)->DetermineCurrentPage();
               result = page->FindItem(tagName);
            }
            if (!result)
                result = find_item_recurs(page->GetItemList(), tagName);
#endif
        } else if (vo->IsKindOf(&vcontainer::Kind)) {
            vcontainer* container = vcontainer::CastDown(vo);
            const vchar* containerTagName = container->GetTag();
            if (containerTagName && (vcharCompare(container->GetTag(),tagName) == 0))
                result = container;
            else result = container->FindItem(tagName);
            if (!result) {
                vdialogItemList* item_list = container->GetItemList();
                result = find_item_recurs(item_list, tagName);
            }
        }
    }    
  return result;
}
vdialogItem * find_item_recurs ( vdialogItemList * itemList , const vname * tagName ) { vdialogItem * result = NULL ; for ( int i = 0 ; i < itemList -> GetCount ( ) && ! result ; i ++ ) { vobjectAttributed * vo = itemList -> GetAt ( i ) ; if ( vo -> IsKindOf ( & vnotebook :: Kind ) ) { vdialogItemList * il = vnotebook :: CastDown ( vo ) -> GetItemList ( ) ; result = find_item_recurs ( il , tagName ) ; #if 0 if ( ! result ) { vnotebookPage * page ; page = vnotebook :: CastDown ( vo ) -> DetermineCurrentPage ( ) ; result = page -> FindItem ( tagName ) ; } if ( ! result ) result = find_item_recurs ( page -> GetItemList ( ) , tagName ) ; #endif } else if ( vo -> IsKindOf ( & vcontainer :: Kind ) ) { vcontainer * container = vcontainer :: CastDown ( vo ) ; const vchar * containerTagName = container -> GetTag ( ) ; if ( containerTagName && ( vcharCompare ( container -> GetTag ( ) , tagName ) == 0 ) ) result = container ; else result = container -> FindItem ( tagName ) ; if ( ! result ) { vdialogItemList * item_list = container -> GetItemList ( ) ; result = find_item_recurs ( item_list , tagName ) ; } } } return result ; }
find_item_recurs - Calls the container's FindItem method.
find_item_recurs - Calls the container ' s FindItem method .
// Loop through all items in this container. // Get next object. // If it is a notebook, recursively check its items. // I don't know why this Notebook page stuff isn't used. // If not found yet, check in this Notebook page. // If still not found, recursively check this page. // Else if it is a container, look in it. // If not found, recursively check the container. // End of item loop.