annotate aim-mat/tools/@parameter/setradiobutton.m @ 4:537f939baef0 tip

various bug fixes and changed copyright message
author Stefan Bleeck <bleeck@gmail.com>
date Tue, 16 Aug 2011 14:37:17 +0100
parents 20ada0af3d7d
children
rev   line source
tomwalters@0 1 % method of class @parameter
tomwalters@0 2 %
bleeck@3 3 % (c) 2011, University of Southampton
bleeck@3 4 % Maintained by Stefan Bleeck (bleeck@gmail.com)
bleeck@3 5 % download of current version is on the soundsoftware site:
bleeck@3 6 % http://code.soundsoftware.ac.uk/projects/aimmat
bleeck@3 7 % documentation and everything is on http://www.acousticscale.org
tomwalters@0 8 function param=setradiobutton(param,text,inbox)
tomwalters@0 9
tomwalters@0 10
tomwalters@0 11 cont=param.entries;
tomwalters@0 12 nrent=length(cont);
tomwalters@0 13
tomwalters@0 14
tomwalters@0 15 for i=1:nrent
tomwalters@0 16 type=cont{i}.type;
tomwalters@0 17 if strcmp(type,'radiobutton') && strcmp(cont{i}.panel,inbox)
tomwalters@0 18 if strcmp(cont{i}.text,text)
tomwalters@0 19 cont{i}.value=1;
tomwalters@0 20 param.entries=cont;
tomwalters@0 21 return
tomwalters@0 22 end
tomwalters@0 23 end
tomwalters@0 24 end
tomwalters@0 25
tomwalters@0 26 % if still here, then it could have been an 'other' enty:
tomwalters@0 27 for i=1:nrent
tomwalters@0 28 type=cont{i}.type;
tomwalters@0 29 if strcmp(type,'radiobutton') && strcmp(cont{i}.panel,inbox) && strcmp(cont{i}.text,'other...')
tomwalters@0 30 cont{i}.userdata=text;
tomwalters@0 31 cont{i}.value=1;
tomwalters@0 32 param.entries=cont;
tomwalters@0 33 return
tomwalters@0 34 end
tomwalters@0 35 end
tomwalters@0 36
tomwalters@0 37 val='error, the entry does not exist';