model_server/gala/src/view.cxx
// AddParentView - Makes current view the only child of a new node.
Makes current view the only child of a new node.
Makes current view the only child of a new node .
void View::AddParentView(ViewType horizOrVert)
{
    View * newParent = new View(ParentView, myViewer, myRect, horizOrVert);
    if (mySash) {
        newParent->mySash = mySash;
        mySash->SetOwner(newParent);
        mySash->Inval(vwindowINVAL_IMMEDIATE);
        mySash = NULL;
    }
    DeleteItem(myPane);
    newParent->DeleteItem(newParent->myPane);
    if (myViewer->layerViews == this)
        myViewer->layerViews = newParent;
    if (myOwnerPane) {
        newParent->myOwnerPane = myOwnerPane;
        myOwnerPane->childViewTree_ = newParent;
        myOwnerPane = NULL;
    }
    if (ParentView && ParentView->ChildView == this) 
        ParentView->ChildView = newParent;
    if (LeftView) {
        LeftView->RightView = newParent;
        newParent->LeftView = LeftView;
        LeftView = NULL;
    }
    if (RightView) {
        RightView->LeftView = newParent;
        newParent->RightView = RightView;
        RightView = NULL;
    }
    newParent->ChildView = this;
    ParentView = newParent;
    newParent->percentX_ = percentX_;
    newParent->percentY_ = percentY_;
    AppendItem(myPane);
    newParent->AppendItem(newParent->myPane);
    if (ParentView->RightView && ParentView->RightView->mySash)
        ParentView->RightView->mySash->Inval(vwindowINVAL_IMMEDIATE);
}
void View :: AddParentView ( ViewType horizOrVert ) { View * newParent = new View ( ParentView , myViewer , myRect , horizOrVert ) ; if ( mySash ) { newParent -> mySash = mySash ; mySash -> SetOwner ( newParent ) ; mySash -> Inval ( vwindowINVAL_IMMEDIATE ) ; mySash = NULL ; } DeleteItem ( myPane ) ; newParent -> DeleteItem ( newParent -> myPane ) ; if ( myViewer -> layerViews == this ) myViewer -> layerViews = newParent ; if ( myOwnerPane ) { newParent -> myOwnerPane = myOwnerPane ; myOwnerPane -> childViewTree_ = newParent ; myOwnerPane = NULL ; } if ( ParentView && ParentView -> ChildView == this ) ParentView -> ChildView = newParent ; if ( LeftView ) { LeftView -> RightView = newParent ; newParent -> LeftView = LeftView ; LeftView = NULL ; } if ( RightView ) { RightView -> LeftView = newParent ; newParent -> RightView = RightView ; RightView = NULL ; } newParent -> ChildView = this ; ParentView = newParent ; newParent -> percentX_ = percentX_ ; newParent -> percentY_ = percentY_ ; AppendItem ( myPane ) ; newParent -> AppendItem ( newParent -> myPane ) ; if ( ParentView -> RightView && ParentView -> RightView -> mySash ) ParentView -> RightView -> mySash -> Inval ( vwindowINVAL_IMMEDIATE ) ; }
AddParentView - Makes current view the only child of a new node.
AddParentView - Makes current view the only child of a new node .
// Create the parent. // If I have a sash, move it to my parent. // Remove my Pane and new Parent's Pane until heritage is settled. // If I was the top of the View tree, make the new parent the top. // If I have an Owner Pane, move it to the new parent. // If my old parent points to me, make it point to the new parent. // If I had a left neighbor, move it up to my new parent. // If I had a right neighbor, move it up to my new parent. // Make my new parent point to me and make me point to it. // Move my X and Y ratios to my new parent. // Now that our heritage is settled, add the panes back. // If my new parent's right neighbor has a sash, it needs to redraw too.