annotate aim-mat/tools/@parameter/getradiobutton.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 str=getradiobutton(param,panel)
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')
tomwalters@0 18 if strcmp(cont{i}.panel,panel)
tomwalters@0 19 handleb=gethandle(param,cont{i}.text,cont{i}.panel,1);
tomwalters@0 20 if ~isequal(handleb,0) && ishandle(handleb) % yes, there is a screen representation
tomwalters@0 21 val=get(handleb,'value');
tomwalters@0 22 if val==1
tomwalters@0 23 text=cont{i}.text;
tomwalters@0 24 panel=cont{i}.panel;
tomwalters@0 25 if strcmp(text,'other...')
tomwalters@0 26 handle2=gethandle(param,text,panel,2);
tomwalters@0 27 str=get(handle2,'string');
tomwalters@0 28 else
tomwalters@0 29 str=text;
tomwalters@0 30 end
tomwalters@0 31 return
tomwalters@0 32 end
tomwalters@0 33 else
tomwalters@0 34 if cont{i}.value==1
tomwalters@0 35 str=cont{i}.text;
tomwalters@0 36 if strcmp(str,'other...')
tomwalters@0 37 str=cont{i}.userdata;
tomwalters@0 38 end
tomwalters@0 39 return
tomwalters@0 40 end
tomwalters@0 41 end
tomwalters@0 42 end
tomwalters@0 43 end
tomwalters@0 44 end
tomwalters@0 45
tomwalters@0 46
tomwalters@0 47
tomwalters@0 48 % if still here then non identical fit
tomwalters@0 49 % search for fragment
tomwalters@0 50
tomwalters@0 51 for i=1:nrent
tomwalters@0 52 type=cont{i}.type;
tomwalters@0 53 if strcmp(type,'radiobutton')
tomwalters@0 54 if ~isempty(strfind(cont{i}.panel,panel))
tomwalters@0 55 handleb=gethandle(param,cont{i}.text,cont{i}.panel,1);
tomwalters@0 56 if ishandle(handleb) % yes, there is a screen representation
tomwalters@0 57 val=get(handleb,'value');
tomwalters@0 58 if val==1
tomwalters@0 59 text=cont{i}.text;
tomwalters@0 60 panel=cont{i}.panel;
tomwalters@0 61 if strcmp(text,'other...')
tomwalters@0 62 handle2=gethandle(param,text,panel,2);
tomwalters@0 63 str=get(handle2,'string');
tomwalters@0 64 else
tomwalters@0 65 str=text;
tomwalters@0 66 end
tomwalters@0 67 return
tomwalters@0 68 end
tomwalters@0 69 else
tomwalters@0 70 if cont{i}.value==1
tomwalters@0 71 str=cont{i}.text;
tomwalters@0 72 if strcmp(str,'other...')
tomwalters@0 73 str=cont{i}.userdata;
tomwalters@0 74 end
tomwalters@0 75 return
tomwalters@0 76 end
tomwalters@0 77 end
tomwalters@0 78 end
tomwalters@0 79 end
tomwalters@0 80 end
tomwalters@0 81
tomwalters@0 82 str='error, the entry does not exist';