view m-toolbox/m/gui/gltpda/g_EnableCallback.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_EnableCallback(hObject,varargin)
   % Callback function: run when the user click on the checkbox associated
   % to each parameter, to enable its setting.
   
   global params paramEnabled objName
   
   currParamID   = get(hObject,'UserData');
   [xx,yy]       = size(objName);
   switch get(hObject,'Value')
      case 1 % enable parameter
         jj=2;
         while jj<=yy && ~isempty(objName{currParamID,jj})
            try set(objName{currParamID,jj},'Enable','on'); set(objName{currParamID,jj},'ForegroundColor',[0 0 0]); catch, end
            jj=jj+1;
         end
         paramEnabled(currParamID)=1;
      case 0 % disable parameter
         jj=2;
         while jj<=yy && ~isempty(objName{currParamID,jj})
            try %#ok<ALIGN>
               if strcmp(get(objName{currParamID,jj},'Style'),'checkbox') && strcmp(get(objName{currParamID,jj},'String'),'From Simulink')
               else
                  set(objName{currParamID,jj},'Enable','off');
                  set(objName{currParamID,jj},'ForegroundColor',[0.7 0.7 0.7]);
               end
            catch, end
            jj=jj+1;
         end
         paramEnabled(currParamID)=0;
   end
   
   set(findobj('Tag','apply'),'Enable','on');
   set(findobj('Tag','undo'),'Enable','on');
   
end