annotate listeningTest/multiComp/MpushW.m @ 15:24be5e9ce25b tip

Update README
author Brecht De Man <brecht.deman@bcu.ac.uk>
date Thu, 20 Sep 2018 12:23:20 +0200
parents 4fd284285159
children
rev   line source
b@0 1 function MpushW(hf,typ)
b@0 2
b@0 3 switch typ
b@0 4 case '2D'
b@0 5 sel=get(hf,'selectiontype');
b@0 6 switch sel
b@0 7
b@0 8 case 'normal'
b@0 9 % create a box
b@0 10 dat=get(hf,'userdata');
b@0 11 pc=get(hf,'currentpoint');
b@0 12
b@0 13 %display box
b@0 14 pos=rbbox([pc(1) pc(2) 0 0]);
b@0 15 x1=pos(1); x2=pos(3)+x1; y1=pos(2); y2=pos(4)+y1;
b@0 16 grp=[];
b@0 17 for noIc=1:length(dat.hIcon)
b@0 18 posIc=get(dat.hIcon(noIc),'position');
b@0 19 xic=posIc(1); yic=posIc(2);
b@0 20 if ((xic>x1) & (xic<x2) & (yic>y1) & (yic<y2))
b@0 21 grp(end+1)=noIc;
b@0 22 end
b@0 23 end
b@0 24 if ~isempty(grp)
b@0 25 dat.group{end+1}=grp;
b@0 26 dat.com{end+1}=[];
b@0 27 dat.hbox(end+1)=line([x1 x1 x2 x2 x1],[y1 y2 y2 y1 y1]);
b@0 28 set(dat.hbox,'color','k');
b@0 29 set(dat.hbox,'linestyle','--');
b@0 30 set(dat.hbox,'linewidth',1);
b@0 31 end
b@0 32 set(hf,'userdata',dat);
b@0 33 end
b@0 34 end