model_server/gala/src/view.cxx
// GetDraggedX - Returns X value adjusted for other Sash sizes.
//    This is called by a horizontal sash after it is dragged.
Returns X value adjusted for other Sash sizes.
This is called by a horizontal sash after it is dragged.
Returns X value adjusted for other Sash sizes . This is called by a horizontal sash after it is dragged .
int View::GetDraggedX(int newX, int oldX, sideType side)
{
    int adjustedX = newX;
    int sashWidth = mySash->GetRect()->GetWidth();
    if (newX < oldX) {  
        int minX = BORDER;
        for (View* v=this; v->LeftView; v=v->LeftView)
            minX += sashWidth;
        if (newX < minX) {
            adjustedX = minX;
        }
    } else if (newX > oldX) {  
        int maxX = ParentView->myRect.w - sashWidth - BORDER - sashWidth;
        for (View* v=this; v->RightView; v=v->RightView)
            maxX -= sashWidth;
        if (newX > maxX) {
            adjustedX = maxX;
        }
    } else
        adjustedX = newX;
    return(adjustedX);
}
int View :: GetDraggedX ( int newX , int oldX , sideType side ) { int adjustedX = newX ; int sashWidth = mySash -> GetRect ( ) -> GetWidth ( ) ; if ( newX < oldX ) { int minX = BORDER ; for ( View * v = this ; v -> LeftView ; v = v -> LeftView ) minX += sashWidth ; if ( newX < minX ) { adjustedX = minX ; } } else if ( newX > oldX ) { int maxX = ParentView -> myRect . w - sashWidth - BORDER - sashWidth ; for ( View * v = this ; v -> RightView ; v = v -> RightView ) maxX -= sashWidth ; if ( newX > maxX ) { adjustedX = maxX ; } } else adjustedX = newX ; return ( adjustedX ) ; }
GetDraggedX - Returns X value adjusted for other Sash sizes.
GetDraggedX - Returns X value adjusted for other Sash sizes .
// If moving left, adjust for sashes on the left. // Moving left. // The min X starts with the Border. // Make sure there is enough room for all the sashes. // Else if moving right, adjust for sashes on the right. // Moving right. // The max X starts at the far right less my sash and Border and //    another sashs. (No, I don't know why.) // Decrement the max X for each sash. // Make sure there is enough room for the sashes. // Otherwise, we didn't move and we don't need to do anything.