function BuildUIControls (fig)


theFont = 'Arial';

posFileName      = [850 880 500 40];
posFileHeader    = posFileName;
posFileHeader(2) = posFileName(2)+45;
posFileHeader(4) = 20;

handles.txtFileHeader = uicontrol(gcf,'UserData','UIControl','Style','text','Max',1,'Min',1,'String','Geography from file:','Position',posFileHeader,...
                                    'HorizontalAlignment','left','BackgroundColor',[.8 .8 .8],'Enable','inactive','Fontname',theFont,...
                                    'Fontsize',12,'FontWeight','bold');
handles.txtFileName = uicontrol(gcf,'UserData','UIControl','Style','text','Max',1,'Min',1,'String','','Position',posFileName,...
                                    'HorizontalAlignment','left','BackgroundColor',[.95 .95 .95],'Enable','inactive','Fontname',theFont,...
                                    'Tag','txtFileName','Fontsize',10,'FontWeight','bold');

%Browse button                                
posbtnBrowse      = posFileName;
posbtnBrowse(1)   =posFileName(1)+posFileName(3)+20;
posbtnBrowse(2)   = posFileName(2)+10;
posbtnBrowse(3)   = 60;
posbtnBrowse(4)   = 20;
handles.btnFileName = uicontrol(gcf,'UserData','UIControl','Style','pushbutton','String','Browse','Position',posbtnBrowse,...
                                    'FontSize',11,'FontWeight','bold','Callback','clbBtnFilename','Tag','btnFileName');
                                
%Extent of the map
postxtLowerLeft = posFileName;
postxtLowerLeft(1) = postxtLowerLeft(1) + 50;
postxtLowerLeft(2) = postxtLowerLeft(2) - 50;
postxtLowerLeft(3) = 90;
postxtLowerLeft(4) = 20;
handles.txtLowerLeft = uicontrol(gcf,'UserData','UIControl','Style','text','Max',1,'Min',1,'String','Lower left','Position',postxtLowerLeft,...
                                    'HorizontalAlignment','left','BackgroundColor',[.8 .8 .8],'Enable','inactive','Fontname',theFont,...
                                    'Fontsize',10,'FontWeight','bold');
postxtUpperRight = postxtLowerLeft;
postxtUpperRight(1) = postxtUpperRight(1)+130;

handles.txtUpperRight = uicontrol(gcf,'UserData','UIControl','Style','text','Max',1,'Min',1,'String','Upper right','Position',postxtUpperRight,...
                                    'HorizontalAlignment','left','BackgroundColor',[.8 .8 .8],'Enable','inactive','Fontname',theFont,...
                                    'Fontsize',10,'FontWeight','bold');
postxtX = postxtLowerLeft;
postxtX(1) = postxtX(1)-50;
postxtX(2) = postxtX(2)-25;
postxtX(3) = 20;

handles.txtX = uicontrol(gcf,'UserData','UIControl','Style','text','Max',1,'Min',1,'String','X','Position',postxtX,...
                                    'HorizontalAlignment','left','BackgroundColor',[.8 .8 .8],'Enable','inactive','Fontname',theFont,...
                                    'Fontsize',10,'FontWeight','bold');

posedtXLowerLeft    = postxtX;
posedtXLowerLeft(1) = postxtLowerLeft(1);
posedtXLowerLeft(3) = 100;
handles.edtXLowerLeft = uicontrol(gcf,'UserData','UIControl','Style','edit','Max',1,'Min',1,'String','','Position',posedtXLowerLeft,...
                                    'HorizontalAlignment','left','BackgroundColor',[1 1 1],'Enable','on','Fontname',theFont,...
                                    'Tag','edtXLowerLeft','Fontsize',10,'FontWeight','bold','Callback','clbedtXLowerLeft');
posedtXUpperRight    = postxtX;
posedtXUpperRight(1) = postxtUpperRight(1);
posedtXUpperRight(3) = posedtXLowerLeft(3);
handles.edtXLowerLeft = uicontrol(gcf,'UserData','UIControl','Style','edit','Max',1,'Min',1,'String','','Position',posedtXUpperRight,...
                                    'HorizontalAlignment','left','BackgroundColor',[1 1 1],'Enable','on','Fontname',theFont,...
                                    'Tag','edtXUpperRight','Fontsize',10,'FontWeight','bold','Callback','clbedtXUpperRight');
                                
postxtY = postxtX;
postxtY(2) = postxtY(2)-25;

handles.txtY = uicontrol(gcf,'UserData','UIControl','Style','text','Max',1,'Min',1,'String','Y','Position',postxtY,...
                                    'HorizontalAlignment','left','BackgroundColor',[.8 .8 .8],'Enable','inactive','Fontname',theFont,...
                                    'Fontsize',10,'FontWeight','bold');

posedtYLowerLeft    = postxtY;
posedtYLowerLeft(1) = postxtLowerLeft(1);
posedtYLowerLeft(3) = 100;
handles.edtYLowerLeft = uicontrol(gcf,'UserData','UIControl','Style','edit','Max',1,'Min',1,'String','','Position',posedtYLowerLeft,...
                                    'HorizontalAlignment','left','BackgroundColor',[1 1 1],'Enable','on','Fontname',theFont,...
                                    'Tag','edtYLowerLeft','Fontsize',10,'FontWeight','bold','Callback','clbedtYLowerLeft');
posedtYUpperRight    = postxtY;
posedtYUpperRight(1) = postxtUpperRight(1);
posedtYUpperRight(3) = posedtYLowerLeft(3);
handles.edtYUpperRight = uicontrol(gcf,'UserData','UIControl','Style','edit','Max',1,'Min',1,'String','','Position',posedtYUpperRight,...
                                    'HorizontalAlignment','left','BackgroundColor',[1 1 1],'Enable','on','Fontname',theFont,...
                                    'Tag','edtYUpperRight','Fontsize',10,'FontWeight','bold','Callback','clbedtYUpperRight');

%Browse for the results file 

postxtMatrixHeader = posFileHeader;
postxtMatrixHeader(2) = posedtYLowerLeft(2) - 35;

handles.txtMatrixHeader = uicontrol(gcf,'UserData','UIControl','Style','text','Max',1,'Min',1,'String','Results from file:','Position',postxtMatrixHeader,...
                                    'HorizontalAlignment','left','BackgroundColor',[.8 .8 .8],'Enable','inactive','Fontname',theFont,...
                                    'Fontsize',12,'FontWeight','bold');

postxtMatrixFileName    = postxtMatrixHeader;
postxtMatrixFileName(2) = postxtMatrixFileName(2) - 45;
postxtMatrixFileName(3) = posFileName(3);
postxtMatrixFileName(4) = posFileName(4);
                                
handles.txtMatrixFileName = uicontrol(gcf,'UserData','UIControl','Style','text','Max',1,'Min',1,'String','','Position',postxtMatrixFileName,...
                                    'HorizontalAlignment','left','BackgroundColor',[.95 .95 .95],'Enable','inactive','Fontname',theFont,...
                                    'Tag','txtMatrixFileName','Fontsize',10,'FontWeight','bold');

%Browse button                                
posbtnMatrixFile    = postxtMatrixFileName;
posbtnMatrixFile(1) = posbtnMatrixFile(1)+posbtnMatrixFile(3)+20;
posbtnMatrixFile(2) = posbtnMatrixFile(2)+10;
posbtnMatrixFile(3) = 60;
posbtnMatrixFile(4) = 20;
handles.btnBrowseMatrix = uicontrol(gcf,'UserData','UIControl','Style','pushbutton','String','Browse','Position',posbtnMatrixFile,...
                                    'FontSize',11,'FontWeight','bold','Callback','clbBtnMatrixFile','Tag','btnMatrixFile');
