function BuildUIControls (fig)

global Communication
global ButtonBackColor
global Selection
global Line

h = get(gcf,'Position');

Communication.X0 = h(3)/2;
Communication.Y0 = 0;
Communication.Width = h(3)/2;
Communication.Height = h(4);

%%posFileName      = [850 880 500 40];

%distances between controls for file names
% d1 = distance to the half of the figure
% d2 = width of the filename box, dependes from the width of the figure
% d3 = distance between filename box and browse button
% d4 = width browse button
% d5 = distance to total figure width

% d1             d2          d3  d4 d5
% ---||||||||||||||||||||||||--|||||--
%    begin1                    begin2

dXY  = 20;
d0   = 10;
d1   = dXY + d0;
d3   = 20;
d4   = 65;
d5   = 10;
dSum = d1+d3+d4+d5;
d2 = Communication.Width - dSum;

h1 = 20;
h2 = 40;

FontName = 'Arial';

p1 = Communication.X0 + d1;
p2 = Communication.Y0 + Communication.Height - 10 - h1;
posFileHeader      = [p1 p2 d2 h1];
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',FontName,...
                                    'Fontsize',12,'FontWeight','bold');

% posFileName    = posFileHeader;
% posFileName(2) = posFileName(2) - 45;
% posFileName(4) = h2;
% handles.txtFileName = uicontrol(gcf,'UserData','UIControl','Style','text','Max',1,'Min',1,'String','','Position',posFileName,...
%                                     'HorizontalAlignment','left','BackgroundColor',[.95 .95 .95],'Enable','inactive','Fontname',FontName,...
%                                     'Tag','txtFileName','Fontsize',10,'FontWeight','bold');

poslstFileNames = posFileHeader;
poslstFileNames(2)=poslstFileNames(2)-80;
poslstFileNames(3) = 150;
poslstFileNames(4) = 80;
FileNames = dir('.\Coast\*.tif');
for i=1:length(FileNames)
    Name{i}=strtok(FileNames(i).name,'.');
end
Name=sort(Name);
handles.lstFileNames = uicontrol(gcf,'Userdata','UIControl', ...
                                    'Style','listbox',...
                                    'FontSize',10,'Enable','on',...
                                    'Position',poslstFileNames,'BackgroundColor',[1 1 1],'HorizontalAlignment','left',...
                                    'String',Name ,'Callback','clblstFileNames','Tag','lstFileNames');


%Browse button                                
posbtnBrowse      = poslstFileNames;
posbtnBrowse(1)   = posbtnBrowse(1)+posbtnBrowse(3)+d3;
posbtnBrowse(2)   = posbtnBrowse(2)+(h2-h1)/2;
posbtnBrowse(3)   = d4;
posbtnBrowse(4)   = h1;
handles.btnBrowse = uicontrol(gcf,'UserData','UIControl','Style','pushbutton','String','Browse','Position',posbtnBrowse,...
                                    'Fontname',FontName,'BackgroundColor',ButtonBackColor.on,...
                                    'FontSize',8,'FontWeight','bold','Callback','clbBtnFilename','Tag','btnFileName');
                                

% Map extents Lower left and Upper right

postxtLowerLeft = poslstFileNames;
postxtLowerLeft(1) = postxtLowerLeft(1) + 50;
postxtLowerLeft(2) = postxtLowerLeft(2) - 50;
postxtLowerLeft(3) = 190;
postxtLowerLeft(4) = h1;
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',FontName,...
                                    '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',FontName,...
                                    'Fontsize',10,'FontWeight','bold');


postxtX(1) = Communication.X0 +d1;
postxtX(2) = postxtLowerLeft(2) - 30;
postxtX(3) = dXY;
postxtX(4) = h1;

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',FontName,...
                                    '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',FontName,...
                                    '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',FontName,...
                                    'Tag','edtXUpperRight','Fontsize',10,'FontWeight','bold','Callback','clbedtXUpperRight');
                                
postxtY    = postxtX;
postxtY(2) = postxtY(2)-35;

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',FontName,...
                                    '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',FontName,...
                                    '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',FontName,...
                                    'Tag','edtYUpperRight','Fontsize',10,'FontWeight','bold','Callback','clbedtYUpperRight');

%Matrix file with results
posMatrixFileHeader    = posFileHeader;
posMatrixFileHeader(2) = posedtYLowerLeft(2)- 45;
handles.txtFileHeader  = uicontrol(gcf,'UserData','UIControl','Style','text','Max',1,'Min',1,'String','Results from file:','Position',posMatrixFileHeader,...
                                    'HorizontalAlignment','left','BackgroundColor',[.8 .8 .8],'Enable','inactive','Fontname',FontName,...
                                    'Fontsize',12,'FontWeight','bold');

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

%Browse button                                
posbtnMatrixBrowse      = posMatrixFileName;
posbtnMatrixBrowse(1)   = posMatrixFileName(1)+posMatrixFileName(3)+d3;
posbtnMatrixBrowse(2)   = posMatrixFileName(2)+(h2-h1)/2;
posbtnMatrixBrowse(3)   = d4;
posbtnMatrixBrowse(4)   = h1;
handles.btnMatrixFileName = uicontrol(gcf,'UserData','UIControl','Style','pushbutton','String','Browse','Position',posbtnMatrixBrowse,...
                                    'Fontname',FontName,'Enable','inactive','BackgroundColor',ButtonBackColor.inactive,...
                                    'FontSize',8,'FontWeight','bold','Callback','clbBtnMatrixFilename','Tag','btnMatrixBrowse');
 

postxtYears = posMatrixFileName;
postxtYears(2) = postxtYears(2) - 50;
postxtYears(3) = 40;
postxtYears(4) = h1;

handles.txtYears = uicontrol(gcf,'UserData','UIControl','Style','text','Max',1,'Min',1,'String','Years:','Position',postxtYears,...
                                    'HorizontalAlignment','left','BackgroundColor',[.8 .8 .8],'Enable','inactive','Fontname',FontName,...
                                    'Fontsize',10,'FontWeight','bold');
                                
                                
poslstYears = postxtYears;
poslstYears(1) =poslstYears(1)+postxtYears(3)+20;
poslstYears(2)=poslstYears(2)-50;
poslstYears(3) = 100;
poslstYears(4) = 70;
handles.lstYears        = uicontrol(gcf,'Userdata','UIControl', ...
                                    'Style','listbox',...
                                    'FontSize',10,'Enable','on',...
                                    'Position',poslstYears,'BackgroundColor',[1 1 1],'HorizontalAlignment','left',...
                                    'String',Selection.Years ,'Callback','clbLstYears','Tag','lstYears','Enable','inactive');
                                

postxtExceedance = postxtYears;
postxtExceedance(1) = poslstYears(1)+ poslstYears(3)+20;
postxtExceedance(3) = 85;
handles.txtExceedance = uicontrol(gcf,'UserData','UIControl','Style','text','Max',1,'Min',1,'String','Exceedance:','Position',postxtExceedance,...
                                    'HorizontalAlignment','left','BackgroundColor',[.8 .8 .8],'Enable','inactive','Fontname',FontName,...
                                    'Fontsize',10,'FontWeight','bold');
                                
                                
poslstExceedance = postxtExceedance;
poslstExceedance(1) =poslstExceedance(1)+postxtExceedance(3)+20;
poslstExceedance(2)=poslstExceedance(2)-50;
poslstExceedance(3) = poslstYears(3);
poslstExceedance(4) = poslstYears(4);
handles.lstExceedance        = uicontrol(gcf,'Userdata','UIControl',...
                                    'Style','listbox',...
                                    'FontSize',10,'Enable','on',...
                                    'Position',poslstExceedance,'BackgroundColor',[1 1 1],'HorizontalAlignment','left',...
                                    'String',Selection.Exceedances ,'Callback','clbLstExceedance','Tag','lstExceedance'...
                                    ,'Enable','inactive');
%Plot all exceedances for the given year                                
posbtnPlotAll   = poslstExceedance;
posbtnPlotAll(2)   = poslstYears(2)-30;
posbtnPlotAll(3)   = d4;
posbtnPlotAll(4)   = h1;
handles.btnPlot = uicontrol(gcf,'UserData','UIControl','Style','pushbutton','String','Plot all','Position',posbtnPlotAll,...
                                    'Fontname',FontName,'Enable','inactive','BackgroundColor',ButtonBackColor.inactive,...
                                    'FontSize',8,'FontWeight','bold','Callback','clbbtnPlotAll','Tag','btnPlotAll');

%postxtParam = postxtExceedance;
%postxtParam(1) = poslstExceedance(1)+ poslstExceedance(3)+20;
%postxtParam(3) = 80;
%handles.txtParam = uicontrol(gcf,'UserData','UIControl','Style','text','Max',1,'Min',1,'String','Parameters:','Position',postxtParam,...
%                                    'HorizontalAlignment','left','BackgroundColor',[.8 .8 .8],'Enable','inactive','Fontname',FontName,...
%                                    'Fontsize',10,'FontWeight','bold');
%                                
                                
%poslstParam = postxtParam;
%poslstParam(1) =poslstParam(1)+postxtParam(3)+20;
%poslstParam(2)=poslstParam(2)-50;
%poslstParam(3) = poslstYears(3);
%poslstParam(4) = poslstYears(4);
%handles.lstParam        = uicontrol(gcf,'UserData','UIControl',...
%                                    'Style','listbox',...
%                                    'FontSize',10,'Enable','inactive',...
%                                    'Position',poslstParam,'BackgroundColor',[1 1 1],'HorizontalAlignment','left',...
%                                    'String',['Xr'; 'Xp'] ,'Callback','clbLstParam','Tag','lstParam','Enable','inactive');
                                
postxtMethod = postxtExceedance;
postxtMethod(1) = poslstExceedance(1)+ poslstExceedance(3)+20;
postxtMethod(3) = 60;
handles.txtMethod = uicontrol(gcf,'UserData','UIControl','Style','text','Max',1,'Min',1,'String','Methods:','Position',postxtMethod,...
                                    'HorizontalAlignment','left','BackgroundColor',[.8 .8 .8],'Enable','inactive','Fontname',FontName,...
                                    'Fontsize',10,'FontWeight','bold');
                                
                                
poslstMethod = postxtMethod;
poslstMethod(1) =poslstMethod(1)+postxtMethod(3)+10;
poslstMethod(2)=poslstMethod(2)-50;
poslstMethod(3) = poslstYears(3);
poslstMethod(4) = poslstYears(4);
handles.lstMethod        = uicontrol(gcf,'UserData','UIControl',...
                                    'Style','listbox',...
                                    'FontSize',10,'Enable','inactive',...
                                    'Position',poslstMethod,'BackgroundColor',[1 1 1],'HorizontalAlignment','left',...
                                    'String',{'Instantanious'; 'Trend    '} ,'Callback','clblstMethod','Tag','lstMethod','Enable','inactive');

%Plot for the selected combination button                                
posbtnPlot      = postxtYears;
posbtnPlot(2)   = poslstYears(2)-50;
posbtnPlot(3)   = d4;
posbtnPlot(4)   = h1;
handles.btnPlot = uicontrol(gcf,'UserData','UIControl','Style','pushbutton','String','Plot','Position',posbtnPlot,...
                                    'Fontname',FontName,'Enable','inactive','BackgroundColor',ButtonBackColor.inactive,...
                                    'FontSize',8,'FontWeight','bold','Callback','clbbtnPlot','Tag','btnPlot');

%Plot for the selected combination button                                
posbtnClear      = posbtnPlot;
posbtnClear(1)   = posbtnClear(1)+ posbtnClear(3) + 10;
handles.btnClear = uicontrol(gcf,'UserData','UIControl','Style','pushbutton','String','Clear','Position',posbtnClear,...
                                    'Fontname',FontName,'Enable','on','BackgroundColor',ButtonBackColor.on,...
                                    'FontSize',8,'FontWeight','bold','Callback','clbBtnClear','Tag','btnClear');
                                
                                

return                                
posPanel =  posbtnPlot;
posPanel(2)=posPanel(2) - 10;

Panel.Xul    = posPanel(1)/h(3);
Panel.Yul    = posPanel(2)/h(4);
Panel.Xlr    = 1;
Panel.Ylr    = 0;
Panel.Width  = (Panel.Xlr-Panel.Xul)*h(3); 
Panel.Height = Panel.Yul*h(4);

posPanel(1)=Panel.Xul;
posPanel(2)=0;
posPanel(3)=Panel.Width;
posPanel(4)=Panel.Yul;
LineProperties = uipanel(gcf,'FontSize',12,'FontWeight','bold',...
                                  'BackgroundColor',[.8 .8 .8],'Title','Line properties',...
                                  'Position',posPanel,'Bordertype','etchedout','BorderWidth',2);
p=[];
p(1)=20;
p(2)=Panel.Height - 60;
p(3)=80;
p(4)=20;

ColorText = uicontrol('Parent',LineProperties,'Style','text','FontSize',10,'String','Line color',...
                                    'Position',p,'BackgroundColor',[.8 .8 .8],...
                                    'HorizontalAlignment','left','Fontname',FontName,'FontWeight','bold');

p(2)=p(2)-30;

Line.LastColor.h     = -1;
Line.LastColor.name  = '';
Line.LastColor.index = -1;
Line.LastColor.tag = '';
Line.LastColor.color = [];
Move = 20;
Line.Color = [];
Line.Color(1).h = uicontrol('Parent',LineProperties,'Style','radiobutton','FontSize',8,...
                                    'String','Blue','Position',p,'BackgroundColor','blue',...
                                    'HorizontalAlignment','left','Fontname',FontName,...
                                    'FontWeight','bold','Tag','lineBlue','Callback','clboptColor');
Line.Color(1).name = 'blue';
Line.Color(1).tag = 'lineBlue';

p(2)=p(2)-Move;
Line.Color(2).h = uicontrol('Parent',LineProperties,'Style','radiobutton','FontSize',8,...
                                    'String','Green','Position',p,'BackgroundColor','green',...
                                    'HorizontalAlignment','left','Fontname',FontName,...
                                    'FontWeight','bold','Tag','lineGreen','Callback','clboptColor');
Line.Color(2).name = 'green';
Line.Color(2).tag = 'lineGreen';

p(2)=p(2)-Move;
Line.Color(3).h = uicontrol('Parent',LineProperties,'Style','radiobutton','FontSize',8,...
                                    'String','Red','Position',p,'BackgroundColor','red',...
                                    'HorizontalAlignment','left','Fontname',FontName,...
                                    'FontWeight','bold','Tag','lineRed','Callback','clboptColor');
Line.Color(3).name = 'red';
Line.Color(3).tag = 'lineRed';

p(2)=p(2)-Move;
Line.Color(4).h = uicontrol('Parent',LineProperties,'Style','radiobutton','FontSize',8,...
                                    'String','Cyan','Position',p,'BackgroundColor','cyan',...
                                    'HorizontalAlignment','left','Fontname',FontName,...
                                    'FontWeight','bold','Tag','lineCyan','Callback','clboptColor');

Line.Color(4).name = 'cyan';
Line.Color(4).tag = 'lineCyan';

p(2)=p(2)-Move;
Line.Color(5).h = uicontrol('Parent',LineProperties,'Style','radiobutton','FontSize',8,...
                                    'String','Magenta','Position',p,'BackgroundColor','magenta',...
                                    'HorizontalAlignment','left','Fontname',FontName,...
                                    'FontWeight','bold','Tag','lineMagenta','Callback','clboptColor');
Line.Color(5).name = 'magenta';
Line.Color(5).tag = 'lineMagenta';

p(2)=p(2)-Move;
Line.Color(6).h = uicontrol('Parent',LineProperties,'Style','radiobutton','FontSize',8,...
                                    'String','Yellow','Position',p,'BackgroundColor','yellow',...
                                    'HorizontalAlignment','left','Fontname',FontName,...
                                    'FontWeight','bold','Tag','lineYellow','Callback','clboptColor');
Line.Color(6).name = 'yellow';
Line.Color(6).tag = 'lineYellow';

p(2)=p(2)-Move;
Line.Color(7).h = uicontrol('Parent',LineProperties,'Style','radiobutton','FontSize',8,...
                                    'String','Black','Position',p,'BackgroundColor','black',...
                                    'ForegroundColor',[1 1 1],...
                                    'HorizontalAlignment','left','Fontname',FontName,...
                                    'FontWeight','bold','Tag','lineBlack','Callback','clboptColor');
Line.Color(7).name = 'black';
Line.Color(7).tag = 'lineBlack';

p(2)=p(2)-Move;
Line.Color(8).h = uicontrol('Parent',LineProperties,'Style','radiobutton','FontSize',8,...
                                    'String','White','Position',p,'BackgroundColor','white',...
                                    'HorizontalAlignment','left','Fontname',FontName,...
                                    'FontWeight','bold','Tag','lineWhite','Callback','clboptColor');
Line.Color(8).name = 'white';
Line.Color(8).tag = 'lineWhite';

p(2)=p(2)-Move;
Line.Color(9).h = uicontrol('Parent',LineProperties,'Style','radiobutton','FontSize',8,...
                                    'String','User color','Position',p,'BackgroundColor',[.75 .75 .75],...
                                    'HorizontalAlignment','left','Fontname',FontName,...
                                    'FontWeight','bold','Tag','lineUser','Callback','clboptColor');
Line.Color(9).name = 'user';
Line.Color(9).tag = 'lineUser';

p(2) = p(2) - 40;
Line.LastColor.color = [.75 .75 .75];
Line.ColorMenu = uicontrol('Parent',LineProperties,'Style','pushbutton','String','Set color','Position',p,...
                                    'Fontname',FontName,'Enable','inactive','BackgroundColor',ButtonBackColor.inactive,...
                                    'FontSize',8,'FontWeight','bold','Callback','clbBtnSetColor','Tag','btnColor');
                                
p(1)=p(1)+ p(3)+45;
p(2)=Panel.Height - 60;

MarkerText = uicontrol('Parent',LineProperties,'Style','text','FontSize',10,'String','Line marker',...
                                    'Position',p,'BackgroundColor',[.8 .8 .8],...
                                    'HorizontalAlignment','left','Fontname',FontName,'FontWeight','bold');

p(2) = p(2)-30;
p(3) = p(3) + 10;
Line.LastMarker.h     = -1;
Line.LastMarker.name  = '';
Line.LastMarker.index = -1;
Line.LastMarker.tag = '';
Move = 20;
Line.Marker = [];
Line.Marker(1).h = uicontrol('Parent',LineProperties,'Style','radiobutton','FontSize',8,...
                                    'String','. dot','Position',p,'BackgroundColor',[.8 .8 .8],...
                                    'HorizontalAlignment','left','Fontname',FontName,...
                                    'FontWeight','bold','Tag','markerDot','Callback','clboptMarker');
Line.Marker(1).name = 'dot';
Line.Marker(1).tag = 'markerDot';

p(2)=p(2)-Move;
Line.Marker(2).h = uicontrol('Parent',LineProperties,'Style','radiobutton','FontSize',8,...
                                    'String','o circle','Position',p,'BackgroundColor',[.8 .8 .8],...
                                    'HorizontalAlignment','left','Fontname',FontName,...
                                    'FontWeight','bold','Tag','markerCircle','Callback','clboptMarker');
Line.Marker(2).name = 'circle';
Line.Marker(2).tag = 'markerCircle';

p(2)=p(2)-Move;
Line.Marker(3).h = uicontrol('Parent',LineProperties,'Style','radiobutton','FontSize',8,...
                                    'String','x cross','Position',p,'BackgroundColor',[.8 .8 .8],...
                                    'HorizontalAlignment','left','Fontname',FontName,...
                                    'FontWeight','bold','Tag','markerCross','Callback','clboptMarker');
Line.Marker(3).name = 'cross';
Line.Marker(3).tag = 'markerCross';

p(2)=p(2)-Move;
Line.Marker(4).h = uicontrol('Parent',LineProperties,'Style','radiobutton','FontSize',8,...
                                    'String','+ plus','Position',p,'BackgroundColor',[.8 .8 .8],...
                                    'HorizontalAlignment','left','Fontname',FontName,...
                                    'FontWeight','bold','Tag','markerPlus','Callback','clboptMarker');
Line.Marker(4).name = 'plus';
Line.Marker(4).tag = 'markerPlus';

p(2)=p(2)-Move;
Line.Marker(5).h = uicontrol('Parent',LineProperties,'Style','radiobutton','FontSize',8,...
                                    'String','* star','Position',p,'BackgroundColor',[.8 .8 .8],...
                                    'HorizontalAlignment','left','Fontname',FontName,...
                                    'FontWeight','bold','Tag','markerStar','Callback','clboptMarker');
Line.Marker(5).name = 'star';
Line.Marker(5).tag = 'markerStar';

p(2)=p(2)-Move;
Line.Marker(6).h = uicontrol('Parent',LineProperties,'Style','radiobutton','FontSize',8,...
                                    'String','s square','Position',p,'BackgroundColor',[.8 .8 .8],...
                                    'HorizontalAlignment','left','Fontname',FontName,...
                                    'FontWeight','bold','Tag','markerSquare','Callback','clboptMarker');
Line.Marker(6).name = 'square';
Line.Marker(6).tag = 'markerSquare';

p(2)=p(2)-Move;
Line.Marker(7).h = uicontrol('Parent',LineProperties,'Style','radiobutton','FontSize',8,...
                                    'String','d diamond','Position',p,'BackgroundColor',[.8 .8 .8],...
                                    'HorizontalAlignment','left','Fontname',FontName,...
                                    'FontWeight','bold','Tag','markerDiamond','Callback','clboptMarker');
Line.Marker(7).name = 'diamond';
Line.Marker(7).tag = 'markerDiamond';

p(2)=p(2)-Move;
Line.Marker(8).h = uicontrol('Parent',LineProperties,'Style','radiobutton','FontSize',8,...
                                    'String','v triangle','Position',p,'BackgroundColor',[.8 .8 .8],...
                                    'HorizontalAlignment','left','Fontname',FontName,...
                                    'FontWeight','bold','Tag','markerTriangleD','Callback','clboptMarker');
Line.Marker(8).name = 'triangled';
Line.Marker(8).tag = 'markerTriangleD';

p(2)=p(2)-Move;
Line.Marker(9).h = uicontrol('Parent',LineProperties,'Style','radiobutton','FontSize',8,...
                                    'String','^ triangle','Position',p,'BackgroundColor',[.8 .8 .8],...
                                    'HorizontalAlignment','left','Fontname',FontName,...
                                    'FontWeight','bold','Tag','markerTriangleU','Callback','clboptMarker');
Line.Marker(9).name = 'triangleu';
Line.Marker(9).tag = 'markerTriangleU';

p(2)=p(2)-Move;
Line.Marker(10).h = uicontrol('Parent',LineProperties,'Style','radiobutton','FontSize',8,...
                                    'String','< triangle','Position',p,'BackgroundColor',[.8 .8 .8],...
                                    'HorizontalAlignment','left','Fontname',FontName,...
                                    'FontWeight','bold','Tag','markerTriangleL','Callback','clboptMarker');
Line.Marker(10).name = 'trianglel';
Line.Marker(10).tag = 'markerTriangleL';

p(2)=p(2)-Move;
Line.Marker(11).h = uicontrol('Parent',LineProperties,'Style','radiobutton','FontSize',8,...
                                    'String','> triangle','Position',p,'BackgroundColor',[.8 .8 .8],...
                                    'HorizontalAlignment','left','Fontname',FontName,...
                                    'FontWeight','bold','Tag','markerTriangelR','Callback','clboptMarker');
Line.Marker(11).name = 'triangler';
Line.Marker(11).tag = 'markerTriangelR';

p(2)=p(2)-Move;
Line.Marker(12).h = uicontrol('Parent',LineProperties,'Style','radiobutton','FontSize',8,...
                                    'String','p pentagram','Position',p,'BackgroundColor',[.8 .8 .8],...
                                    'HorizontalAlignment','left','Fontname',FontName,...
                                    'FontWeight','bold','Tag','markerPentagram','Callback','clboptMarker');
Line.Marker(12).name = 'pentagram';
Line.Marker(12).tag = 'markerPentagram';

p(2)=p(2)-Move;
Line.Marker(13).h = uicontrol('Parent',LineProperties,'Style','radiobutton','FontSize',8,...
                                    'String','h hexagram','Position',p,'BackgroundColor',[.8 .8 .8],...
                                    'HorizontalAlignment','left','Fontname',FontName,...
                                    'FontWeight','bold','Tag','markerHexagram','Callback','clboptMarker');
Line.Marker(13).name = 'hexagram';
Line.Marker(13).tag = 'markerHexagram';

p(2)=p(2)-Move;
Line.Marker(14).h = uicontrol('Parent',LineProperties,'Style','radiobutton','FontSize',8,...
                                    'String','no marker','Position',p,'BackgroundColor',[.8 .8 .8],...
                                    'HorizontalAlignment','left','Fontname',FontName,...
                                    'FontWeight','bold','Tag','markerNomarker','Callback','clboptMarker');
Line.Marker(14).name = 'nomarker';
Line.Marker(14).tag = 'markerNomarker';


p(1)=p(1)+ p(3)+45;
p(2)=Panel.Height - 60;

LineText = uicontrol('Parent',LineProperties,'Style','text','FontSize',10,'String','Line type',...
                                    'Position',p,'BackgroundColor',[.8 .8 .8],...
                                    'HorizontalAlignment','left','Fontname',FontName,'FontWeight','bold');
p(2) = p(2)-30;
p(3) = p(3) + 10;
Line.LastLine.h     = -1;
Line.LastLine.name  = '';
Line.LastLine.index = -1;
Line.LastLine.tag = '';
Move = 20;
Line.Line = [];
Line.Line(1).h = uicontrol('Parent',LineProperties,'Style','radiobutton','FontSize',8,...
                                    'String','- solid','Position',p,'BackgroundColor',[.8 .8 .8],...
                                    'HorizontalAlignment','left','Fontname',FontName,...
                                    'FontWeight','bold','Tag','lineSolid','Callback','clboptLine');
Line.Line(1).name = 'solid';
Line.Line(1).tag = 'lineSolid';

p(2)=p(2)-Move;
Line.Line(2).h = uicontrol('Parent',LineProperties,'Style','radiobutton','FontSize',8,...
                                    'String',': dotted','Position',p,'BackgroundColor',[.8 .8 .8],...
                                    'HorizontalAlignment','left','Fontname',FontName,...
                                    'FontWeight','bold','Tag','lineDotted','Callback','clboptLine');
Line.Line(2).name = 'dotted';
Line.Line(2).tag = 'lineDotted';


p(2)=p(2)-Move;
Line.Line(3).h = uicontrol('Parent',LineProperties,'Style','radiobutton','FontSize',8,...
                                    'String','- . dash dot','Position',p,'BackgroundColor',[.8 .8 .8],...
                                    'HorizontalAlignment','left','Fontname',FontName,...
                                    'FontWeight','bold','Tag','lineDashdot','Callback','clboptLine');
Line.Line(3).name = 'dashdot';
Line.Line(3).tag = 'lineDashdot';

p(2)=p(2)-Move;
Line.Line(4).h = uicontrol('Parent',LineProperties,'Style','radiobutton','FontSize',8,...
                                    'String','- - dashed','Position',p,'BackgroundColor',[.8 .8 .8],...
                                    'HorizontalAlignment','left','Fontname',FontName,...
                                    'FontWeight','bold','Tag','lineDashed','Callback','clboptLine');
Line.Line(4).name = 'dashed';
Line.Line(4).tag = 'lineDashed';

p(2)=p(2)-Move;
Line.Line(5).h = uicontrol('Parent',LineProperties,'Style','radiobutton','FontSize',8,...
                                    'String','no line','Position',p,'BackgroundColor',[.8 .8 .8],...
                                    'HorizontalAlignment','left','Fontname',FontName,...
                                    'FontWeight','bold','Tag','lineNoline','Callback','clboptLine');
Line.Line(5).name = 'noline';
Line.Line(5).tag = 'lineNoline';

p(1)=p(1)+ p(3)+45;
p(2)=Panel.Height - 60;

WidthText = uicontrol('Parent',LineProperties,'Style','text','FontSize',10,'String','Line width',...
                                    'Position',p,'BackgroundColor',[.8 .8 .8],...
                                    'HorizontalAlignment','left','Fontname',FontName,'FontWeight','bold');
p(2) = p(2)-65;
p(3) = 45;
p(4) = 50;
%Line.LastWidth.h     = -1;
%Line.LastWidth.name  = '';
%Line.LastWidth.index = -1;
%Line.LastWidth.tag = '';
Line.LastWidth.Value = 1;

Line.Width(1).h = uicontrol('Parent',LineProperties,...
                                    'Style','listbox',...
                                    'FontSize',10,'Enable','on',...
                                    'Position',p,'BackgroundColor',[1 1 1],'HorizontalAlignment','left',...
                                    'String',[6.0;5.0;4.0;3.0;2.0;1.0;.9;.8;,.7;.6;.5;.4;.2;.1] ,...
                                    'Callback','clbLstLineWidth','Tag','lstLineWidth','Enable','on',...
                                    'Callback','clblstLineWidth');
p(1) = p(1) + p(3) + 20;
p(4) = 20;
Line.Width(2).h = uicontrol('Parent',LineProperties,'Style','edit','FontSize',10,'String',Line.LastWidth.Value,...
                                    'Position',p,'BackgroundColor',[1 1 1],...
                                    'HorizontalAlignment','left','Fontname',FontName,'FontWeight','bold',...
                                    'Tag','edtLineWidth','Callback','clbedtLineWidth');

