function addToProgress(isNewTick,beginValue1,endValue1)

global ProgressDataX;
global ProgressDataY;
global beginValue;
global endValue;
global ProgressHandle;
global ProgressHandleChildren;
global ProgressCoeff;

if isNewTick==0
    ProgressDataX=0;
    ProgressDataY=0.5;
    beginValue=beginValue1;
    endValue=endValue1;
    ProgressCoeff=1/(endValue-beginValue);
    progressFigure;
    set(ProgressHandle.axes1,'XLim',[-0.1 1.1],'XLimMode','manual','XTick',[],'XTickLabel',[],'XTickLabelMode','manual','XTickMode','manual');
    set(ProgressHandle.axes1,'YLim',[0 1],'YLimMode','manual','YTick',[],'YTickLabel',[],'YTickLabelMode','manual','YTickMode','manual');
    ProgressHandleChildren=get(ProgressHandle.axes1,'Children');
    set(ProgressHandleChildren,'LineStyle','none','Marker','Square','MarkerSize',24,'MarkerFaceColor','blue');
    pause(0.001);
    return;
end

ProgressDataX=[ProgressDataX (isNewTick-beginValue)*ProgressCoeff];
ProgressDataY=[ProgressDataY 0.5];
set(ProgressHandleChildren,'XData',ProgressDataX,'YData',ProgressDataY);
pause(0.001);

if isNewTick==endValue
    delete(ProgressHandle.figure1);
end