%function [PointerType,Status] = hoverstatus(Editor,RLAxes,CP,Status)
function out = hoverstatus(Editor,RLAxes,CP,Status)
%HOVERSTATUS  Sets pointer type and status when hovering editor.

%   Author(s): P. Gahinet
%   Copyright 1986-2000 The MathWorks, Inc. 
%   $Revision: 1.10 $  $Date: 2000/07/24 20:53:20 $

HG = Editor.HG;
SISOfig = get(HG.PlotAxes,'Parent');
MovableHandles = [HG.ClosedLoop ; comphandles(Editor)];

% Get currently hovered object
HitObject = hittest(SISOfig);   

if any(HitObject==MovableHandles)
    % Movable object is in focus
    PointerType = 'hand';
    % Give informative status
    if any(HitObject==HG.ClosedLoop)
        Status = sprintf('Left-click and move this closed-loop pole to adjust the loop gain.');
    else
        Status = sprintf('Left-click to grab and move this compensator pole/zero.');
    end
else
    PointerType = 'arrow';
    % If close to the locus, hint at selectgain feature
    if any(HitObject==HG.Locus)
        Status = sprintf('Root locus.  Left-click to move closed-loop pole to this location.');
    end
end

% REVISIT
out = {PointerType,Status};