comparison aim-mat/tools/@parameter/setradiobutton.m @ 0:74dedb26614d

Initial checkin of AIM-MAT version 1.5 (6.4.2011).
author tomwalters
date Fri, 20 May 2011 12:32:31 +0100
parents
children 20ada0af3d7d
comparison
equal deleted inserted replaced
-1:000000000000 0:74dedb26614d
1 % method of class @parameter
2 %
3 % (c) 2003-2008, University of Cambridge
4 % Maintained by Tom Walters (tcw24@cam.ac.uk), written by Stefan Bleeck (stefan@bleeck.de)
5 % http://www.pdn.cam.ac.uk/cnbh/aim2006/tools/parameter
6 % $Date: 2008-06-10 18:00:16 +0100 (Tue, 10 Jun 2008) $
7 function param=setradiobutton(param,text,inbox)
8
9
10 cont=param.entries;
11 nrent=length(cont);
12
13
14 for i=1:nrent
15 type=cont{i}.type;
16 if strcmp(type,'radiobutton') && strcmp(cont{i}.panel,inbox)
17 if strcmp(cont{i}.text,text)
18 cont{i}.value=1;
19 param.entries=cont;
20 return
21 end
22 end
23 end
24
25 % if still here, then it could have been an 'other' enty:
26 for i=1:nrent
27 type=cont{i}.type;
28 if strcmp(type,'radiobutton') && strcmp(cont{i}.panel,inbox) && strcmp(cont{i}.text,'other...')
29 cont{i}.userdata=text;
30 cont{i}.value=1;
31 param.entries=cont;
32 return
33 end
34 end
35
36 val='error, the entry does not exist';