view m-toolbox/classes/+utils/@prog/gcbsh.m @ 21:8be9deffe989 database-connection-manager

Update ltpda_uo.update
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Mon, 05 Dec 2011 16:20:06 +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