www.gusucode.com > mbcguitools 工具箱 matlab 源码程序 > mbcguitools/@xregrangeinput/get.m

    function out = get(obj, property)
%% xregrangeinput/SET
%%     get(xregrangeinput, 'Property', Value)
%%     Property = {'numCells', 'Position', 'varName', 'Parent'}
%%
%%     Also at this time only one property per call
%%

%  Copyright 2000-2010 The MathWorks, Inc. and Ford Global Technologies, Inc.




ud = get(obj.name,'UserData');

switch upper(property)
   
case {'VARNAME','NAME'}
   out = get(obj.name,'String');
   
case 'VISIBLE'
   out = get(obj.name,'Visible');   
   
case 'PARENT'
   out = get(obj.name,'Parent');
   
case 'POSITION'
   pos1 = get(obj.name,'Position');
   bl = [pos1(1) pos1(2) 0 0];
   pos2 = get(obj.edit(3),'Position');
   ur = [0 0 pos2(1)+pos2(3)-pos1(1) pos2(2)+pos2(4)-pos1(2)];
   out = bl+ur;
   
case 'MIN'
   out = ud.min;
   
case 'MAX'
   out = ud.max;
   
case 'CALLBACK'
   out = ud.callback;
   
case 'VALUE'
   out = linspace(ud.min,ud.max,ud.points);
   
case 'RANGE'
   out = [ud.min, ud.max];
   
case 'USERDATA'
   out = ud.UserData;
   
end %switch