function s=di_inp(txt,def)

% function s=di_inp(txt,def)
%
% This function is used in conjuction with FD3.  It creates a dialog box with
% one input labeled 'txt'.  The default value for that input is 'def'.  The
% string which is input is returned as 's'.
%
% ACP

% Last update:  July 7, 1993
% Author:       Adrian C. Penisson

global FD3DITEMP FD3PXPERCM FD3FIGURE

FD3DITEMP=0;

%%%%%%%%%%%%%%%%%%%%%
% set up dialog box %
%%%%%%%%%%%%%%%%%%%%%

c=[2.75 2.125];
cv=2.54*[FD3PXPERCM FD3PXPERCM];

fh=uicontrol('Sty','frame','Pos',[c(1)-1.5 c(2)-1 3 2].*cv);
th=uicontrol('Sty','text','Pos',[c(1)-1.4 c(2)+.1 2.8 .3].*cv,'Str',txt);
eh=uicontrol('Sty','edit','Pos',[c(1)-1.4 c(2)-.6 1.8 .2].*cv,'Str',def);
bh=uicontrol('Sty','push','Pos',[c(1)+.6 c(2)-.7 .8 .4].*cv,'Str','DONE',...
   'Call','FD3DITEMP=1;');

h=[fh th eh bh];

set(h,'Units','Pixels');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% make necessary changes if B&W %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%if get(0,'ScreenDepth')==1
%   for i=1:4
%      set(h(i),'ForegroundColor',[1 1 1],'BackgroundColor',[0 0 0])
%   end
%end

%%%%%%%%%%%%%%%%%%%%%%%%%%%
% wait for user to finish %
%%%%%%%%%%%%%%%%%%%%%%%%%%%

while FD3DITEMP==0
   pause(.01)
   s=get(eh,'String');
end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% remove initial and trailing blanks %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

s=deblank(fliplr(deblank(fliplr(s))));

close(h)
FD3DITEMP=[];
