function theResult = subsref(self, theStruct)

% subsref -- Get a field value.
%  subsref(self, theStruct) returns the field value of
%   self, a "px" object, for "theResult = self.theField",
%   including fields of the associated "HandleGraphics"
%   entity, which take precedent.  The empty matrix []
%   is returned for fields that do not exist.  Use the
%   case-sensitive spelling 'UserData' for that field.
%   Self is a "px" object.

% Copyright (C) 1997 Dr. Charles R. Denham, ZYDECO.
%  All Rights Reserved.
%   Disclosure without explicit written consent from the
%    copyright owner does not constitute publication.
 
% Version of 05-Apr-1997 09:57:00.

if nargin < 1, help(mfilename), return, end

theValue = [];

theSyntax = theStruct(1).type;
theField = theStruct(1).subs;

switch theSyntax
case '.'
   theValue = pxget(self, theField);
case '()'
   if strcmp(theField, ':')
      theValue = get(px(self), 'UserData');
   end
otherwise
   warning([' ## The "' theSyntax '" syntax is' ...
           ' not available to "px" objects.'])
   help(mfilename)
end

if nargout > 0
   theResult = theValue;
else
   disp(theValue)
end
