Mercurial > hg > ape
view listeningTest/multiComp/MpushW.m @ 11:0014c50188da
New and modified auxiliary scripts
author | Brecht De Man <b.deman@qmul.ac.uk> |
---|---|
date | Fri, 19 Jun 2015 19:16:08 +0100 |
parents | 4fd284285159 |
children |
line wrap: on
line source
function MpushW(hf,typ) switch typ case '2D' sel=get(hf,'selectiontype'); switch sel case 'normal' % create a box dat=get(hf,'userdata'); pc=get(hf,'currentpoint'); %display box pos=rbbox([pc(1) pc(2) 0 0]); x1=pos(1); x2=pos(3)+x1; y1=pos(2); y2=pos(4)+y1; grp=[]; for noIc=1:length(dat.hIcon) posIc=get(dat.hIcon(noIc),'position'); xic=posIc(1); yic=posIc(2); if ((xic>x1) & (xic<x2) & (yic>y1) & (yic<y2)) grp(end+1)=noIc; end end if ~isempty(grp) dat.group{end+1}=grp; dat.com{end+1}=[]; dat.hbox(end+1)=line([x1 x1 x2 x2 x1],[y1 y2 y2 y1 y1]); set(dat.hbox,'color','k'); set(dat.hbox,'linestyle','--'); set(dat.hbox,'linewidth',1); end set(hf,'userdata',dat); end end