model_server/gala/src/view.cxx
// split_horizontal - Handles a vertical 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 vertical 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 vertical 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_horizontal(int ratio)
{
    if (ratio == 0) {
        printf("@split_horizontal:Zero ratio given!!!\n");
    } else if (Unsplitable_) {
        printf("@split_horizontal: View is Unsplitable, trying the parent.\n");
        if (ParentView)
            ParentView->split_horizontal(ratio);
    } else {
        AddParentView(VerticalGroupView);
        ParentView->hasBorder_ = vFALSE;
        ParentView->UpdatePane();
        AddRightView();
        float newHeight = ((ParentView->myRect.h - SASH_SIZE) * ratio) / (float)100.0;
        int height = (int) (newHeight + 0.5);
        RightView->MoveView(0, 0, ParentView->myRect.w, height);
        height = ParentView->myRect.h - height - SASH_SIZE;
        MoveView(RightView->myRect.x, (RightView->myRect.y +
                 RightView->myRect.h + SASH_SIZE), 
                 RightView->myRect.w, height);
        vrect *sashRect = new vrect;  
        sashRect->Set(0, RightView->myRect.h, myRect.w , SASH_SIZE);
        RightView->mySash = new Sash(sashRect, ParentView->myPane,
                                     Vertical, RightView);
        delete sashRect;
        RightView->mySash->Open();
        RightView->UpdatePane();
        UpdatePane();
                Layer* layer = GetLayer();
                if (layer) {
                        layer->reopen();
                }
    }
}
void View :: split_horizontal ( int ratio ) { if ( ratio == 0 ) { printf ( " \n " ) ; } else if ( Unsplitable_ ) { printf ( " \n " ) ; if ( ParentView ) ParentView -> split_horizontal ( ratio ) ; } else { AddParentView ( VerticalGroupView ) ; ParentView -> hasBorder_ = vFALSE ; ParentView -> UpdatePane ( ) ; AddRightView ( ) ; float newHeight = ( ( ParentView -> myRect . h - SASH_SIZE ) * ratio ) / ( float ) 100.0 ; int height = ( int ) ( newHeight + 0.5 ) ; RightView -> MoveView ( 0 , 0 , ParentView -> myRect . w , height ) ; height = ParentView -> myRect . h - height - SASH_SIZE ; MoveView ( RightView -> myRect . x , ( RightView -> myRect . y + RightView -> myRect . h + SASH_SIZE ) , RightView -> myRect . w , height ) ; vrect * sashRect = new vrect ; sashRect -> Set ( 0 , RightView -> myRect . h , myRect . w , SASH_SIZE ) ; RightView -> mySash = new Sash ( sashRect , ParentView -> myPane , Vertical , RightView ) ; delete sashRect ; RightView -> mySash -> Open ( ) ; RightView -> UpdatePane ( ) ; UpdatePane ( ) ; Layer * layer = GetLayer ( ) ; if ( layer ) { layer -> reopen ( ) ; } } }
split_horizontal - Handles a vertical split.
split_horizontal - Handles a vertical split .
//    fprintf(stderr, "Start of split_horizontal:\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 view and place in a new parent. // Add new parent and make sure it doesn't have a border. // Add new right neighbor. // My neighbor's new height is determined by //     his ratio of what the Sash doesn't use. // Move my right neighbor to the bottom. // My new height is what's left over. // Move me to above my neighbor. // Add a sash to my new right neightbor. // Create a vertical sash // Update all of the changes //    print(0); //    fprintf(stderr, ":End of split_horizontal\n");