Skip to content
Snippets Groups Projects
Commit 2409f4ff authored by marwan's avatar marwan
Browse files

small speed up by using simpler commands

parent ab847594
No related branches found
No related tags found
No related merge requests found
......@@ -42,7 +42,7 @@ function fout = waitbar(x,whichbar, varargin)
% Vlad Kolesnikov 06-7-99
% Copyright 1984-2000 The MathWorks, Inc.
% $Revision$ $Date$
% Modified: Norbert Marwan, 2002-12-11, 2004-07-28, 2004-10-25
% Modified: Norbert Marwan, 2002-12-11, 2004-07-28, 2004-10-25, 2005-09-13
if nargin>=2
......@@ -75,7 +75,7 @@ switch type
case 1, % waitbar(x) update
p = findobj(f,'Type','patch');
pr = findobj(f,'Type','text'); pr=pr(1);
if isempty(f) | isempty(p) | isempty(pr)
if isempty(f) || isempty(p) || isempty(pr)
error('Couldn''t find waitbar handles.');
end
......@@ -89,7 +89,7 @@ switch type
end
timeRemain = [];
if (secRemain > lastUpdate.showTime | lastUpdate.flag) & lastUpdate.showTime >= 0
if (secRemain > lastUpdate.showTime || lastUpdate.flag) && lastUpdate.showTime >= 0
tx = datestr(datenum(0, 0, 0, 0, 0, secRemain),13);
if secRemain > 86400
tx = [datestr(datenum(0, 0, 0, 0, 0, secRemain),7),'d:',datestr(datenum(0, 0, 0, 0, 0, secRemain),13)];
......@@ -176,7 +176,7 @@ switch type
cancelBtnCreated = 0;
for ii = 1:length( propList )
try
if strcmp(lower(propList{ii}), 'createcancelbtn' ) & ~cancelBtnCreated
if strcmpi(propList{ii}, 'createcancelbtn' ) && ~cancelBtnCreated
cancelBtnHeight = 23 * pointsPerPixel;
cancelBtnWidth = 60 * pointsPerPixel;
newPos = pos;
......@@ -243,9 +243,9 @@ switch type
if titleHeight>pos(4)
pos(4)=titleHeight;
pos(2)=screenSize(4)/2-pos(4)/2;
figPosDirty=logical(1);
figPosDirty=true;
else
figPosDirty=logical(0);
figPosDirty=false;
end
if tExtent(3)>pos(3)*1.10;
......@@ -255,7 +255,7 @@ switch type
axPos([1,3])=axNorm([1,3])*pos(3);
set(h,'Position',axPos);
figPosDirty=logical(1);
figPosDirty=true;
end
if figPosDirty
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment