0001 function s=get(obj, property)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 if nargin==1
0019 if numel(obj)==1
0020 s.hgcontainer=obj.hgcontainer;
0021 s.hgcontrol=obj.hgcontrol;
0022 s.hghandle=obj.hghandle;
0023 else
0024 display(obj);
0025 end
0026 return
0027 end
0028
0029
0030 if nargin>2
0031 error('Too many input arguments');
0032 end
0033
0034
0035 property=lower(property);
0036
0037
0038
0039 if numel(obj)>1
0040 if nargout>0
0041
0042 s=cell(1,numel(obj));
0043 for idx=1:numel(obj)
0044
0045 s{idx}=get(obj(idx),property);
0046 end
0047 return
0048 else
0049
0050 error('Must specify a left-hand side assignment with vector input');
0051 end
0052 end
0053
0054
0055 if isprop(obj.hgcontainer, property) &&...
0056 isprop(obj.hgcontrol, property)
0057 if strcmp(property,'visible')
0058
0059
0060 s=obj.hgcontainer.Visible;
0061 return
0062 else
0063 error('Shared property name ''%s''\nYou must explicitly specify the target object',...
0064 property);
0065 end
0066 end
0067
0068
0069 switch property
0070 case 'hghandle'
0071 s=obj.hghandle;
0072 case 'hgcontainer'
0073 s=obj.hgcontainer;
0074 case 'hgcontrol'
0075 s=obj.hgcontrol;
0076 otherwise
0077 if isprop(obj.hgcontainer, property)
0078
0079 s=obj.hgcontainer.(property);
0080 elseif isprop(obj.hgcontrol, property)
0081
0082 s=obj.hgcontrol.(property);
0083 elseif isempty(obj.hghandle)
0084
0085 s=[];
0086 else
0087
0088 error('No such property');
0089 end
0090 end
0091
0092 end