model_server/gala/src/sash.cxx
/*SetX and SetY are called by ObserveDrag, which is called whenever a dragged
  sash is dropped.  They can be called from any side.  If called from the left
  (top), it means that either the sash in question was the one moved or one to
  the left (top) was moved far enough, causing this one to move. The function
  asks its owner what its boundaries are, and then adjustes its rect, its 
  owners rect, and the the rect of the view to the left accordingly adjusting 
  for SASH_SIZES*/
SetX and SetY are called by ObserveDrag, which is called whenever a dragged
sash is dropped.  They can be called from any side.  If called from the left
(top), it means that either the sash in question was the one moved or one to
the left (top) was moved far enough, causing this one to move. The function
asks its owner what its boundaries are, and then adjustes its rect, its
owners rect, and the the rect of the view to the left accordingly adjusting
for SASH_SIZES
SetX and SetY are called by ObserveDrag which is called whenever a dragged sash is dropped . They can be called from any side . If called from the left ( top ) it means that either the sash in question was the one moved or one to the left ( top ) was moved far enough causing this one to move . The function asks its owner what its boundaries are and then adjustes its rect its owners rect and the the rect of the view to the left accordingly adjusting for SASH_SIZES
void Sash::SetX(int newX, sideType side) 
{
    gInit (Sash::SetX);
    newX = newX - myOwner->GetParentView()->GetAbsoluteX();
    vrect myRect;
    myRect = *(GetRect());
    if (side==gside_left) {
	newX= myOwner->GetDraggedX(newX, myRect.GetX());
	myOwner->SetLeft(newX + SASH_SIZE);
	if(myOwner->GetLeftView()->GetSash())
	    myOwner->GetLeftView()->GetSash()->SetX(
                     newX + myOwner->GetParentView()->GetAbsoluteX(), gside_right);
	else
	    myOwner->GetLeftView()->SetRight(newX);
	myRect.SetX(newX);
	SetRect(&myRect);
    } else {
	newX= myOwner->GetDraggedX(newX, myRect.GetX(), gside_right);
	if (newX<myRect.GetX() + SASH_SIZE) {
	    myOwner->SetRight(newX);
	    if(myOwner->GetLeftView()->GetSash())
	      myOwner->GetLeftView()->GetSash()->SetX(newX - SASH_SIZE +
              myOwner->GetParentView()->GetAbsoluteX(), gside_right);
	    else
	      myOwner->GetLeftView()->SetRight(newX - SASH_SIZE );
	    myRect.SetX(newX);
	    SetRect (&myRect);
	}
	else
	    myOwner->SetRight(newX);
    }
}
void Sash :: SetX ( int newX , sideType side ) { gInit ( Sash :: SetX ) ; newX = newX - myOwner -> GetParentView ( ) -> GetAbsoluteX ( ) ; vrect myRect ; myRect = * ( GetRect ( ) ) ; if ( side == gside_left ) { newX = myOwner -> GetDraggedX ( newX , myRect . GetX ( ) ) ; myOwner -> SetLeft ( newX + SASH_SIZE ) ; if ( myOwner -> GetLeftView ( ) -> GetSash ( ) ) myOwner -> GetLeftView ( ) -> GetSash ( ) -> SetX ( newX + myOwner -> GetParentView ( ) -> GetAbsoluteX ( ) , gside_right ) ; else myOwner -> GetLeftView ( ) -> SetRight ( newX ) ; myRect . SetX ( newX ) ; SetRect ( & myRect ) ; } else { newX = myOwner -> GetDraggedX ( newX , myRect . GetX ( ) , gside_right ) ; if ( newX < myRect . GetX ( ) + SASH_SIZE ) { myOwner -> SetRight ( newX ) ; if ( myOwner -> GetLeftView ( ) -> GetSash ( ) ) myOwner -> GetLeftView ( ) -> GetSash ( ) -> SetX ( newX - SASH_SIZE + myOwner -> GetParentView ( ) -> GetAbsoluteX ( ) , gside_right ) ; else myOwner -> GetLeftView ( ) -> SetRight ( newX - SASH_SIZE ) ; myRect . SetX ( newX ) ; SetRect ( & myRect ) ; } else myOwner -> SetRight ( newX ) ; } }
SetX and SetY are called by ObserveDrag, which is called whenever a dragged
sash is dropped.
SetX and SetY are called by ObserveDrag which is called whenever a dragged sash is dropped .
// Convert from absolute screen coords into relative window coords.