samer@0: % emousepos - Arrow that generates mouse-move events samer@0: % samer@0: % emousepos :: samer@0: % options { samer@0: % fig :: handles / gcf ~'figure to track'; samer@0: % xlim :: [[1,2]] / [] ~'if not empty, set X limits of axes'; samer@0: % ylim :: [[1,2]] / [] ~'if not empty, set Y limits of axes' samer@0: % } samer@0: % -> arrow({},boxed([[2,1]]),empty). samer@0: % samer@0: % The output of the emousepos arrow is a stream of events carrying samer@0: % two element column vectors containing the X and Y coordinates of samer@0: % the last mouse-move event in the current time-slice. samer@0: samer@0: function o=mousepos(varargin) samer@37: s.opts=options('fig',[],'xlim',[],'ylim',[],varargin{:}); samer@0: if isempty(s.opts.fig), s.opts.fig=gcf; end samer@0: o=class(s,'emousepos',arrow(0,1)); samer@0: end samer@0: