model_server/gala/src/view.cxx
// split_vertical - Handles a horizontal split.
//    Insures that this view is Splitable and the the ration is non-Zero.
//    Creates a new parent view and and a new Right view for this view.
Handles a horizontal split.
Insures that this view is Splitable and the the ration is non-Zero.
Creates a new parent view and and a new Right view for this view.
Handles a horizontal split . Insures that this view is Splitable and the the ration is non - Zero . Creates a new parent view and and a new Right view for this view .
void View::split_vertical(int ratio)
{
    if (ratio == 0) {
        printf("@split_vertical:Zero ratio given!!!\n");
    } else if (Unsplitable_) {
        printf("@split_vertical: View is Unsplitable, trying the parent.\n");
        if (ParentView)
            ParentView->split_vertical(ratio);
    } else {
        AddParentView(HorizontalGroupView);
        ParentView->hasBorder_ = vFALSE;
        ParentView->UpdatePane();
        AddRightView();
        float myWidth = ((ParentView->myRect.w - SASH_SIZE) * (float)ratio) / (float)100.0;
        int width = (int) (myWidth + 0.5);
        MoveView(0, 0, width, ParentView->myRect.h);
        width = ParentView->myRect.w - width - SASH_SIZE;
        RightView->MoveView(myRect.x + myRect.w + SASH_SIZE,
                            myRect.y, width, myRect.h);
        vrect *sashRect = new vrect;  
        sashRect->Set(myRect.w, myRect.y, SASH_SIZE, myRect.h);
        RightView->mySash = new Sash(sashRect, ParentView->myPane,
                                    Horizontal, RightView);
        delete sashRect;
        RightView->mySash->Open();
        RightView->UpdatePane();
        UpdatePane();
        Layer* layer = GetLayer();
                if (layer) {
                        layer->reopen();
                }
    }
}
void View :: split_vertical ( int ratio ) { if ( ratio == 0 ) { printf ( " \n " ) ; } else if ( Unsplitable_ ) { printf ( " \n " ) ; if ( ParentView ) ParentView -> split_vertical ( ratio ) ; } else { AddParentView ( HorizontalGroupView ) ; ParentView -> hasBorder_ = vFALSE ; ParentView -> UpdatePane ( ) ; AddRightView ( ) ; float myWidth = ( ( ParentView -> myRect . w - SASH_SIZE ) * ( float ) ratio ) / ( float ) 100.0 ; int width = ( int ) ( myWidth + 0.5 ) ; MoveView ( 0 , 0 , width , ParentView -> myRect . h ) ; width = ParentView -> myRect . w - width - SASH_SIZE ; RightView -> MoveView ( myRect . x + myRect . w + SASH_SIZE , myRect . y , width , myRect . h ) ; vrect * sashRect = new vrect ; sashRect -> Set ( myRect . w , myRect . y , SASH_SIZE , myRect . h ) ; RightView -> mySash = new Sash ( sashRect , ParentView -> myPane , Horizontal , RightView ) ; delete sashRect ; RightView -> mySash -> Open ( ) ; RightView -> UpdatePane ( ) ; UpdatePane ( ) ; Layer * layer = GetLayer ( ) ; if ( layer ) { layer -> reopen ( ) ; } } }
split_vertical - Handles a horizontal split.
split_vertical - Handles a horizontal split .
//    fprintf(stderr, "Start of split_vertical:\n"); //    print(0); // If the ratio is zero, can't do anything. // Else if this view is Un-Splitable, try the parent. // Else split this this view and place in a new parent. // Add new parent and make sure it doesn't have a border. // Add new Right neighbor. // My width is my ratio of what the Sash doesn't use. // Move me to the left side. // Move my right neighbor to my right side. // Add a sash to my new right neighbor. // Create a horizontal sash // Update all of the changes //    print(0); //    fprintf(stderr, ":End of split_vertical\n");