www.gusucode.com > mbcguitools 工具箱 matlab 源码程序 > mbcguitools/@roller/get.m
function out=get(rl,varargin) %ROLLER/GET /get interface for roller object % Implements get interface for graph1d object % Currently supported properties are: % 'Position' - 4 element vector % 'Visible' - 'on'/'off' % 'Value' - 1/0 % 'String' - two element cell array, for % the 0 and then the 1 state. % 'Callback' - callback string % Copyright 2000-2010 The MathWorks, Inc. and Ford Global Technologies, Inc. % Bail if we've not been given a graph1d object if ~isa(rl,'roller') error(message('mbc:roller:InvalidObject')) end % loop over varargin for n=1:(nargin-1) switch lower(varargin{n}) case 'position' out=get(rl.frame1,'Position'); case 'visible' out=get(rl.frame1,'UserData'); if out out='on'; else out='off'; end case 'value' out=get(rl.frame2,'UserData'); case 'string' out=get([rl.text1;rl.text2],{'String'}); case 'callback' out=get(rl.text2,'UserData'); out=out.callback; otherwise out=get([rl.text1;rl.text2],varargin{n}); end end