model_server/gala/src/view.cxx
// LoadMultiView - Loads in multi-views.
//    It splits the current view based on the panes within the new pane.
Loads in multi-views.
It splits the current view based on the panes within the new pane.
Loads in multi - views . It splits the current view based on the panes within the new pane .
void View::LoadMultiView(Pane* newPane)
{
    int isHorizontal = vFALSE;
    const vchar *tagName = newPane->GetTag();
    if (*tagName == '|')
        isHorizontal = vTRUE;
    else if (*tagName != '-') {    
        printf("@LoadMutliView:Invalid tag name '%s' given!!!\n",
               tagName);
    }
    tagName++;
    myPane->GrowViewTree();
    View* v = NULL;
    View* nextView;
    Pane* subPane;
    int ratio;
    if (isHorizontal) {    
        subPane = newPane->FindSmallestXElt(&ratio);
        myPane->childViewTree_->split_vertical(ratio);
    } else {        
        subPane = newPane->FindLargestYElt(&ratio);
        myPane->childViewTree_->split_horizontal(ratio);
    }
    newPane->DeleteItem(subPane);
    myPane->childViewTree_->ChildView->SetPane(subPane);
    v = myPane->childViewTree_->ChildView->RightView;
    while (newPane->GetItemCount()) {  
        if (isHorizontal)
            subPane = newPane->FindSmallestXElt(&ratio);
        else
            subPane = newPane->FindLargestYElt(&ratio);
        newPane->DeleteItem(subPane);
        if (newPane->GetItemCount())
            v->addPane(ratio);  
        nextView = v->RightView;
        v->SetPane(subPane);      
        if (nextView)
            v = nextView;
    }
    if (*tagName == *UNSPLITABLE) {
        Unsplitable_ = vTRUE;
        hasBorder_ = vFALSE;
    } else {
        Unsplitable_ = vFALSE;
        hasBorder_ = vTRUE;
    }
    UpdatePane();
    MakeCurrent();
    if (isHorizontal)
       v->ParentView->ResizeChildrenHorz();
    else
       v->ParentView->ResizeChildrenVert();
}
void View :: LoadMultiView ( Pane * newPane ) { int isHorizontal = vFALSE ; const vchar * tagName = newPane -> GetTag ( ) ; if ( * tagName == ' ' ) isHorizontal = vTRUE ; else if ( * tagName != ' ' ) { printf ( " \n " , tagName ) ; } tagName ++ ; myPane -> GrowViewTree ( ) ; View * v = NULL ; View * nextView ; Pane * subPane ; int ratio ; if ( isHorizontal ) { subPane = newPane -> FindSmallestXElt ( & ratio ) ; myPane -> childViewTree_ -> split_vertical ( ratio ) ; } else { subPane = newPane -> FindLargestYElt ( & ratio ) ; myPane -> childViewTree_ -> split_horizontal ( ratio ) ; } newPane -> DeleteItem ( subPane ) ; myPane -> childViewTree_ -> ChildView -> SetPane ( subPane ) ; v = myPane -> childViewTree_ -> ChildView -> RightView ; while ( newPane -> GetItemCount ( ) ) { if ( isHorizontal ) subPane = newPane -> FindSmallestXElt ( & ratio ) ; else subPane = newPane -> FindLargestYElt ( & ratio ) ; newPane -> DeleteItem ( subPane ) ; if ( newPane -> GetItemCount ( ) ) v -> addPane ( ratio ) ; nextView = v -> RightView ; v -> SetPane ( subPane ) ; if ( nextView ) v = nextView ; } if ( * tagName == * UNSPLITABLE ) { Unsplitable_ = vTRUE ; hasBorder_ = vFALSE ; } else { Unsplitable_ = vFALSE ; hasBorder_ = vTRUE ; } UpdatePane ( ) ; MakeCurrent ( ) ; if ( isHorizontal ) v -> ParentView -> ResizeChildrenHorz ( ) ; else v -> ParentView -> ResizeChildrenVert ( ) ; }
LoadMultiView - Loads in multi-views.
LoadMultiView - Loads in multi - views .
// Find out if this is a horizontal or verticle grouping. //    This is done by checking the first char. // Uh oh. // Skip past the horizontal/verticle marker. // Add a View tree to my Pane. // Set up the first sup-pane. // Load in next horizontal pane. // Load in next vertical pane. // Remove the item from the new Pane. // Recursively add the new pane to the view tree. // Loop through all remaining sub-panes. // While there are still more panes // Remove the item from the new Pane. // Add a new view // Load the new pane into the new view // Update this pane. // Resize all me and my neighbors.