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

    function h=waitbar(varargin)
%WAITBAR Create a waitbar object
%
%  OBJ = WAITBAR(PROP, VAL, ...

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


h = xregGui.waitbar;
set(h,varargin{:});

if isempty(h.Parent)
    h.Parent = gcf;
end

hComp = com.mathworks.toolbox.mbc.gui.peer.MBCProgressBarPeer(h.Min, h.Max, h.Value);
h.JavaProgress = mbcwidgets.javacomponent(hComp, ...
    'parent', h.Parent, ...
    'visible', h.visible, ...
    'position', h.position);
h.JavaProgress.connect(h, 'up');
if isnan(h.Value)
    hComp.setIndeterminateMode(true);
end

% create listeners
h.doSetupL;

h.connect(xregfigurehook(h.parent),'up');