function uirestore(uistate)
%UIRESTORE will restore the interactive functionality state of a 
%   figure window.
%
%   UIRESTORE(UISTATE) restores the state of a figure window to
%   what it was before it was suspended by a call to UISUSPEND.
%   The input UISTATE is the structure returned by UISUSPEND which
%   contains information about the window properties and the button
%   down functions for all of the objects in the figure.
%
%   See also UISUSPEND.

%   Chris Griffin, 6-19-97
%   Copyright (c) 1984-98 by The MathWorks, Inc.
%   $Revision: 1.6 $ $Date: 1998/10/23 15:29:11 $

if ~isempty(uistate.ploteditEnable)
   plotedit(uistate.figureHandle,...
           'setenabletools',uistate.ploteditEnable);
end

set(uistate.figureHandle, 'pointer',uistate.Pointer, ...
   'PointerShapeCData', uistate.PointerCdata, ...
   'PointerShapeHotSpot', uistate.PointerHotSpot, ...
   'KeyPressFcn', uistate.KeyPressFcn, ...
   'WindowButtonMotionFcn', uistate.WindowButtonMotionFcn ,...
   'WindowButtonDownFcn', uistate.WindowButtonDownFcn, ...
   'WindowButtonUpFcn', uistate.WindowButtonUpFcn);
stillAround = ishandle(uistate.children);
set(uistate.children(stillAround), ...
   {'buttondownfcn'},uistate.ButtonDownFcns(stillAround), ...
   {'BusyAction'}, uistate.BusyAction(stillAround), ...
   {'Interruptible'}, uistate.Interruptible(stillAround));
