function B = subsref(cObj, S)
%HGBIN/SUBSREF

%   Copyright 1984-2000 The MathWorks, Inc. 
%   $Revision: 1.8 $  $Date: 2000/06/01 02:52:45 $
%   J.H. Roh & B.A. Jones 4-25-97.

switch S(1).type
case '.'
   switch lower(S(1).subs)
   case 'resetparent'
      B = cObj.ResetParent;
   case 'items'
      B = validatehandles(cObj.Items);
      cObj.Items = B;
      if (length(S)>1)
         B = subsref(B,S(2:end));
      end
   case 'scribehgobj'
      if (length(S)>1)
         B = subsref(cObj.scribehgobj,S(2:end));
      end
   otherwise
      theHGobj = cObj.scribehgobj;
      B = subsref(theHGobj, S);
   end
otherwise
   theHGobj = cObj.scribehgobj;
   B = subsref(theHGobj, S);
end

