function g_KeepResultCallback(hObject,varargin)
   % Whenever the user clicks on the checkbox to maintain local results.
   
   global selBlocks
   
   switch get(hObject,'Value')
      case 0
         % Cycle to restore proper color
         [meth,clas] = strtok(get_param(gcbh,'Tag'),' ');
         infoObj = eval([clas,'.getInfo(''',getappdata(0,'ltpda_currFunctionName'),''')']);
         switch infoObj.mcategory
            case 'Constructor'
               for kk=1:length(selBlocks)
                  try %#ok<ALIGN>
                     set_param(selBlocks(kk),'Backgroundcolor','green')
                     set_param(selBlocks(kk),'MaskHelp','')
                  catch, end
               end
            case 'Output'
               for kk=1:length(selBlocks)
                  try %#ok<ALIGN>
                     set_param(selBlocks(kk),'Backgroundcolor','lightBlue')
                     set_param(selBlocks(kk),'MaskHelp','')
                  catch, end
               end
            otherwise
               for kk=1:length(selBlocks)
                  try %#ok<ALIGN>
                     set_param(selBlocks(kk),'Backgroundcolor','red')
                     set_param(selBlocks(kk),'MaskHelp','')
                  catch, end
               end
         end
      case 1
         for kk=1:length(selBlocks)
            try %#ok<ALIGN>
               set_param(selBlocks(kk),'Backgroundcolor','magenta');
               set_param(selBlocks(kk),'MaskHelp','probe');
            catch, end
         end
   end
end
