Mercurial > hg > ltpda
view m-toolbox/m/gui/gltpda/g_editNameCallback.m @ 52:daf4eab1a51e database-connection-manager tip
Fix. Default password should be [] not an empty string
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 07 Dec 2011 17:29:47 +0100 |
parents | f0afece42f48 |
children |
line wrap: on
line source
function g_editNameCallback(hObject, varargin) global params if strcmp(get(gcbh,'Tag'),'arithmetic') currParamIndex = get(hObject,'UserData'); newName = get(hObject,'String'); oldName = params.params(currParamIndex).key; params.params(currParamIndex).setKey(newName); paramcommand = BuildParamCommand(params); for kk=1:length(selBlocks) set_param(selBlocks(kk),'Description',paramcommand); end block2change = find_system(gcb,'SearchDepth',1,'LookUnderMasks','all','Name',lower(oldName)); while ~isempty(find_system(gcb,'SearchDepth',1,'LookUnderMasks','all','Name',lower(newName))), newName = [newName,'x']; end set_param(block2change{1},'Name',lower(newName)) UpdateInports(lower(newName),2); return; end currParamIndex = get(hObject,'UserData'); newName = get(hObject,'String'); oldName = params.params(currParamIndex).key; addedPar = 0; try if strcmpi(oldName(1:7),'addPar_'), addedPar = 1; oldName(1:7)=[]; end; catch, end if strcmp(params.params(currParamIndex).val,'-->') block2change = find_system(gcb,'SearchDepth',1,'LookUnderMasks','all','Name',lower(oldName)); while ~isempty(find_system(gcb,'SearchDepth',1,'LookUnderMasks','all','Name',lower(newName))), newName = [newName,'x']; end set_param(block2change{1},'Name',lower(newName)) end if addedPar, newName = ['addPar_',newName]; end setKey(params.params(currParamIndex),newName); % To change the drawing command: if strcmp(params.params(currParamIndex).val,'-->'), UpdateInports(lower(newName),2); end set(findobj('Tag','apply'),'Enable','on'); set(findobj('Tag','undo'),'Enable','on'); end