Mercurial > hg > ltpda
comparison m-toolbox/m/gui/ltpdv/callbacks/ltpdv_properties_apply.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 % LTPDV_PROPERTIES_APPLY callback for apply button on the object properties | |
2 % panel. | |
3 % | |
4 % M Hewitson 26-08-08 | |
5 % | |
6 % $Id: ltpdv_properties_apply.m,v 1.1 2008/09/02 07:51:47 hewitson Exp $ | |
7 % | |
8 | |
9 function ltpdv_properties_apply(varargin) | |
10 | |
11 % Handles | |
12 myh = varargin{1}; | |
13 oldVals = varargin{end-2}; | |
14 obj = varargin{end-1}; | |
15 mainfig = varargin{end}; | |
16 panh = get(myh, 'Parent'); | |
17 | |
18 % go through each label and edit box in order | |
19 lhs = findobj(panh, 'Style', 'text'); | |
20 ehs = findobj(panh, 'Style', 'edit'); | |
21 | |
22 for kk=numel(lhs):-1:1 | |
23 fcn = get(lhs(kk), 'String'); | |
24 val = get(ehs(kk), 'String'); | |
25 | |
26 % check the value has changed | |
27 ov = oldVals{numel(lhs)-kk+1}; | |
28 if ~strcmp(val, ov) | |
29 feval(fcn, obj, val); | |
30 end | |
31 end | |
32 | |
33 % Refresh object list | |
34 ltpdv_refresh_object_list(mainfig); | |
35 | |
36 display(obj) | |
37 end |