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) ...@@ -42,7 +42,7 @@ function fout = waitbar(x,whichbar, varargin)
% Vlad Kolesnikov 06-7-99 % Vlad Kolesnikov 06-7-99
% Copyright 1984-2000 The MathWorks, Inc. % Copyright 1984-2000 The MathWorks, Inc.
% $Revision$ $Date$ % $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 if nargin>=2
...@@ -75,7 +75,7 @@ switch type ...@@ -75,7 +75,7 @@ switch type
case 1, % waitbar(x) update case 1, % waitbar(x) update
p = findobj(f,'Type','patch'); p = findobj(f,'Type','patch');
pr = findobj(f,'Type','text'); pr=pr(1); 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.'); error('Couldn''t find waitbar handles.');
end end
...@@ -89,7 +89,7 @@ switch type ...@@ -89,7 +89,7 @@ switch type
end end
timeRemain = []; 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); tx = datestr(datenum(0, 0, 0, 0, 0, secRemain),13);
if secRemain > 86400 if secRemain > 86400
tx = [datestr(datenum(0, 0, 0, 0, 0, secRemain),7),'d:',datestr(datenum(0, 0, 0, 0, 0, secRemain),13)]; 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 ...@@ -176,7 +176,7 @@ switch type
cancelBtnCreated = 0; cancelBtnCreated = 0;
for ii = 1:length( propList ) for ii = 1:length( propList )
try try
if strcmp(lower(propList{ii}), 'createcancelbtn' ) & ~cancelBtnCreated if strcmpi(propList{ii}, 'createcancelbtn' ) && ~cancelBtnCreated
cancelBtnHeight = 23 * pointsPerPixel; cancelBtnHeight = 23 * pointsPerPixel;
cancelBtnWidth = 60 * pointsPerPixel; cancelBtnWidth = 60 * pointsPerPixel;
newPos = pos; newPos = pos;
...@@ -243,9 +243,9 @@ switch type ...@@ -243,9 +243,9 @@ switch type
if titleHeight>pos(4) if titleHeight>pos(4)
pos(4)=titleHeight; pos(4)=titleHeight;
pos(2)=screenSize(4)/2-pos(4)/2; pos(2)=screenSize(4)/2-pos(4)/2;
figPosDirty=logical(1); figPosDirty=true;
else else
figPosDirty=logical(0); figPosDirty=false;
end end
if tExtent(3)>pos(3)*1.10; if tExtent(3)>pos(3)*1.10;
...@@ -255,7 +255,7 @@ switch type ...@@ -255,7 +255,7 @@ switch type
axPos([1,3])=axNorm([1,3])*pos(3); axPos([1,3])=axNorm([1,3])*pos(3);
set(h,'Position',axPos); set(h,'Position',axPos);
figPosDirty=logical(1); figPosDirty=true;
end end
if figPosDirty 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