function zoomcleanup(RespObj,ZoomType)
%ZOOMCLEANUP - Cleans up after X or Y zoom

%   Authors: K. Gondoly
%            P. Gahinet
%            A. DiVergilio
%   Copyright 1986-2000 The MathWorks, Inc. 
%   $Revision: 1.4 $  $Date: 2000/06/14 20:07:32 $

%---Callback to clean up after X, Y, or XY zoom.
ContextMenu = RespObj.UIContextMenu;
LTIdisplayAxes = RespObj.PlotAxes;

% Reset figure pointer style
set(RespObj.Parent,'Pointer','arrow')

%---Turn zoom off (done with zooming task)
RespObj.Zoom = 'off';

%---Set new axis limits
%   RE: SET will take care of updating RespObj in UIContextMenu
switch ZoomType,  % pre-existing zoom mode
case 'xzoom',
   %---Updates Response object when turning X zoom off
   set(ContextMenu.ZoomMenu.ZoomX,'Check','off')
   %---Set the new axis limits
   set(RespObj,'Xlim',get(LTIdisplayAxes(end,:),{'Xlim'}))
   
case 'yzoom',
   %---Updates Response object when turning Y zoom off
   set(ContextMenu.ZoomMenu.ZoomY,'Check','off')
   set(RespObj,'Ylim',get(LTIdisplayAxes(:,1),{'Ylim'}))
   
case 'xyzoom',
   %---Updates Response object when turning XY zoom off
   set(ContextMenu.ZoomMenu.ZoomXY,'Check','off')
   set(RespObj,'Xlim',get(LTIdisplayAxes(end,:),{'Xlim'}),...
      'Ylim',get(LTIdisplayAxes(:,1),{'Ylim'}))
end
