model_server/gala/src/view.cxx
// AddPane - Adds a new  pane into the view tree.
//    Very similar to split_horizontal/vertical. 
//    It inserts a new view into the view tree.
Adds a new  pane into the view tree.
Very similar to split_horizontal/vertical.
It inserts a new view into the view tree.
Adds a new pane into the view tree . Very similar to split_horizontal / vertical . It inserts a new view into the view tree .
void View::addPane(int ratio)
{
    if (!ParentView) { 
        printf("@addPane: No parent view!!!\n");
    } else if (Unsplitable_) {
        ParentView->addPane(ratio);
    } else {
        AddRightView();
        if (ParentView->view_type == HorizontalGroupView) {
            int totalWidth = myRect.w;
            float newWidth = ((totalWidth - SASH_SIZE) * ratio)
                             / (float) 100.0;
            myRect.w = (int) (newWidth + 0.5);
            MoveView(myRect.x, myRect.y, myRect.w, myRect.h);
            RightView->MoveView( (myRect.x + myRect.w + SASH_SIZE),
                                RightView->myRect.y, 
                                (totalWidth - myRect.w - SASH_SIZE),
                                RightView->myRect.h);
            vrect *sashRect = new vrect;
            sashRect->Set(myRect.x + myRect.w, myRect.y,
                          SASH_SIZE, myRect.h);
            RightView->mySash = new Sash(sashRect, ParentView->myPane,
                                        Horizontal, RightView);
            RightView->mySash->Open();
        } else {
            int totalHeight = myRect.h; 
            float newHeight = ((totalHeight - SASH_SIZE) * ratio) 
                              / (float) 100.0;
            myRect.h = (int) (newHeight + 0.5);
            RightView->MoveView(myRect.x, myRect.y, myRect.w,
                                (totalHeight - myRect.h - SASH_SIZE) );
            MoveView(RightView->myRect.x, (RightView->myRect.y +
                     RightView->myRect.h + SASH_SIZE),
                     RightView->myRect.w, RightView->myRect.h);
            vrect *sashRect = new vrect;
            sashRect->Set(myRect.x, myRect.y - SASH_SIZE,
                          myRect.w , SASH_SIZE);
            RightView->mySash = new Sash(sashRect, ParentView->myPane,
                                        Vertical, RightView);
            RightView->mySash->Open();
        }
        RightView->UpdatePane();
        UpdatePane();
    }
}
void View :: addPane ( int ratio ) { if ( ! ParentView ) { printf ( " \n " ) ; } else if ( Unsplitable_ ) { ParentView -> addPane ( ratio ) ; } else { AddRightView ( ) ; if ( ParentView -> view_type == HorizontalGroupView ) { int totalWidth = myRect . w ; float newWidth = ( ( totalWidth - SASH_SIZE ) * ratio ) / ( float ) 100.0 ; myRect . w = ( int ) ( newWidth + 0.5 ) ; MoveView ( myRect . x , myRect . y , myRect . w , myRect . h ) ; RightView -> MoveView ( ( myRect . x + myRect . w + SASH_SIZE ) , RightView -> myRect . y , ( totalWidth - myRect . w - SASH_SIZE ) , RightView -> myRect . h ) ; vrect * sashRect = new vrect ; sashRect -> Set ( myRect . x + myRect . w , myRect . y , SASH_SIZE , myRect . h ) ; RightView -> mySash = new Sash ( sashRect , ParentView -> myPane , Horizontal , RightView ) ; RightView -> mySash -> Open ( ) ; } else { int totalHeight = myRect . h ; float newHeight = ( ( totalHeight - SASH_SIZE ) * ratio ) / ( float ) 100.0 ; myRect . h = ( int ) ( newHeight + 0.5 ) ; RightView -> MoveView ( myRect . x , myRect . y , myRect . w , ( totalHeight - myRect . h - SASH_SIZE ) ) ; MoveView ( RightView -> myRect . x , ( RightView -> myRect . y + RightView -> myRect . h + SASH_SIZE ) , RightView -> myRect . w , RightView -> myRect . h ) ; vrect * sashRect = new vrect ; sashRect -> Set ( myRect . x , myRect . y - SASH_SIZE , myRect . w , SASH_SIZE ) ; RightView -> mySash = new Sash ( sashRect , ParentView -> myPane , Vertical , RightView ) ; RightView -> mySash -> Open ( ) ; } RightView -> UpdatePane ( ) ; UpdatePane ( ) ; } }
AddPane - Adds a new  pane into the view tree.
AddPane - Adds a new pane into the view tree .
// Make sure I have a parent view. // Else, if I am unsplitable, add the pane to my parent. // Else add a pane. // Create my new right neighbor. // If this is a vertical group, set up the rectangles. // Save the original width. // Get my new width. // Adjust me to the new width. // Move the new guy to my right. // Set up the new guy's sash. // Else set up for a vertical group. // Save the current height. // Get my new height. // Move the new guy below me. // Move me to the top with the new height. // Set up the new guy's sash. // Update me and the new guy.