Mercurial > hg > ltpda
comparison m-toolbox/m/gui/gltpda/g_unitValCallback.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 function g_unitValCallback(hObject, varargin) | |
2 | |
3 global params | |
4 | |
5 currParamIndex = get(hObject,'UserData'); | |
6 oldUnit = char(params.params(currParamIndex).val); | |
7 oldUnit = oldUnit(2:end-1); | |
8 newUnit = strrep(get(hObject,'String'),'''',''); | |
9 try | |
10 params = pset(params,params.params(currParamIndex).key,unit(newUnit)); | |
11 set(hObject,'String',['''',newUnit,'''']); | |
12 catch | |
13 set(hObject,'String',['''',oldUnit,'''']); | |
14 return; | |
15 end | |
16 set(findobj('Tag','apply'),'Enable','on'); | |
17 set(findobj('Tag','undo'),'Enable','on'); | |
18 | |
19 end |