view m-toolbox/classes/+utils/@prog/gcbsh.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 varargout = gcbsh()

% GCBSH gets the handles for the currently selected blocks.
% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 
% GCBSH gets the handles for the currently selected blocks.
% 
% Usage: >> gcbsh
%        >> h = gcbsh
% 
% M Hewitson 29-08-07
% 
% $Id: gcbsh.m,v 1.1 2008/06/18 13:35:11 hewitson Exp $
% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

h = [];

blks = find_system(gcs, 'SearchDepth',1, 'LookUnderMasks', 'all', 'Type', 'block');
hs   = get_param(blks, 'Handle');

% get selected blocks
for j=1:length(hs)
  if get_param(gcs, 'Handle') ~= hs{j}
    if strcmp(get(hs{j}, 'Selected'), 'on')
      h = [h hs{j}];
    end
  end
end

if nargout == 0
  disp(h.')
elseif nargout == 1
  varargout{1} = h.';
else
  error('### Too many output arguments')
end