model_server/gala/src/view.cxx
// GetDraggedY - Returns Y value adjusted for other Sash sizes.
//    This is called by a horizontal sash after it is dragged.
Returns Y value adjusted for other Sash sizes.
This is called by a horizontal sash after it is dragged.
Returns Y value adjusted for other Sash sizes . This is called by a horizontal sash after it is dragged .
int View::GetDraggedY(int newY, int oldY, sideType)
{
    int adjustedY = newY;   
    int sashHeight = mySash->GetRect()->GetHeight();
    if (newY > oldY) {  
        int maxY = ParentView->myRect.h - sashHeight - BORDER;
        for (View* v=this; v->LeftView; v=v->LeftView)
            maxY -= sashHeight;
        if (newY > maxY) {
            adjustedY = maxY;
        }
    } else if (newY < oldY) {  
        int minY = BORDER;
        for (View* v=this; v->RightView; v=v->RightView)
            minY += sashHeight;
        if (newY < minY) {
            adjustedY = minY;
        }
    } else
        adjustedY = newY;
    return(adjustedY);
}
int View :: GetDraggedY ( int newY , int oldY , sideType ) { int adjustedY = newY ; int sashHeight = mySash -> GetRect ( ) -> GetHeight ( ) ; if ( newY > oldY ) { int maxY = ParentView -> myRect . h - sashHeight - BORDER ; for ( View * v = this ; v -> LeftView ; v = v -> LeftView ) maxY -= sashHeight ; if ( newY > maxY ) { adjustedY = maxY ; } } else if ( newY < oldY ) { int minY = BORDER ; for ( View * v = this ; v -> RightView ; v = v -> RightView ) minY += sashHeight ; if ( newY < minY ) { adjustedY = minY ; } } else adjustedY = newY ; return ( adjustedY ) ; }
GetDraggedY - Returns Y value adjusted for other Sash sizes.
GetDraggedY - Returns Y value adjusted for other Sash sizes .
// Will probably return the new Y value. // Get the height of my sash. // If moving up, make sure there is room for sashes above us. // Moving up. // Start at the top but leave room for my sash and my border. // Leave room for each of the my neighbors. // Make sure the new Y has enough room for the sashes. // Else if moving down, make sure there is room for sashes on the right. // Moving down. // The minimum starts with the Border size. // Leave room for each of my downstairs neighbors. // Make sure the new Y has enough room for the sashes. // Otherwise, we didn't move and we don't need to do anything.