Skip to content
Snippets Groups Projects

cleanup ita_preferences gui spacing

Merged Hark Simon Braren requested to merge feature/cleanupPreferencesGUIonMac into master
1 file
+ 9
5
Compare changes
  • Side-by-side
  • Inline
@@ -38,7 +38,7 @@ for idx = 1:size(defined_preferences,1)
@@ -38,7 +38,7 @@ for idx = 1:size(defined_preferences,1)
end
end
%% GUI Initialization
%% GUI Initialization
h_textbox = 22; %height of each line
h_textbox = 22; %height of each line - default
top_margin = 22+40; %space on top of the ita logo
top_margin = 22+40; %space on top of the ita logo
%height of the entire gui (with some headroom +1)
%height of the entire gui (with some headroom +1)
height = top_margin + (nh+4)*(h_textbox+1);
height = top_margin + (nh+4)*(h_textbox+1);
@@ -55,7 +55,7 @@ height = height - 100;
@@ -55,7 +55,7 @@ height = height - 100;
fontsize = 10;
fontsize = 10;
rightMargin = 720; % where ui elements end
rightMargin = 720; % where ui elements end
stPos = 280; % where the second column starts
stPos = 280; % where the second column starts
topMargin = 0; %space before first line starts
topMargin = 10; %space before first line starts
popupStart = stPos;
popupStart = stPos;
popupSpace = 450; %space to right after dropdown menu - control the popup width
popupSpace = 450; %space to right after dropdown menu - control the popup width
textSpace = popupSpace; %space to right after text/double fields - control the width
textSpace = popupSpace; %space to right after text/double fields - control the width
@@ -172,6 +172,7 @@ for I = 1:nTabs %go thru all tabs to plot
@@ -172,6 +172,7 @@ for I = 1:nTabs %go thru all tabs to plot
'BackgroundColor',bgColor);
'BackgroundColor',bgColor);
pref = ita_preferences(defined_preferences{idx,1});
pref = ita_preferences(defined_preferences{idx,1});
set(h.(defined_preferences{idx,1}),'String',num2str(pref));
set(h.(defined_preferences{idx,1}),'String',num2str(pref));
 
case {'popup_double','popup_string','popup_char'}
case {'popup_double','popup_string','popup_char'}
token = defined_preferences{idx,5};
token = defined_preferences{idx,5};
startIdx = strfind(token,'[')+1;endIdx = strfind(token,']')-1;
startIdx = strfind(token,'[')+1;endIdx = strfind(token,']')-1;
@@ -224,7 +225,7 @@ for I = 1:nTabs %go thru all tabs to plot
@@ -224,7 +225,7 @@ for I = 1:nTabs %go thru all tabs to plot
end
end
h.(defined_preferences{idx,1}) = uicontrol(...
h.(defined_preferences{idx,1}) = uicontrol(...
'Parent', tab(tabNo),...
'Parent', tab(tabNo),...
'Position',[popupStart height-topMargin-4-(idx2)*(h_textbox+3) rightMargin-popupSpace h_textbox+8],...
'Position',[popupStart height-topMargin-8-(idx2)*(h_textbox+3) rightMargin-popupSpace h_textbox+8],...
'FontSize',fontsize,...
'FontSize',fontsize,...
'BackgroundColor',[1 1 1],...
'BackgroundColor',[1 1 1],...
'HorizontalAlignment','right',...
'HorizontalAlignment','right',...
@@ -236,7 +237,7 @@ for I = 1:nTabs %go thru all tabs to plot
@@ -236,7 +237,7 @@ for I = 1:nTabs %go thru all tabs to plot
comportlist = com_DevStr;
comportlist = com_DevStr;
h.(defined_preferences{idx,1}) = uicontrol(...
h.(defined_preferences{idx,1}) = uicontrol(...
'Parent', tab(tabNo),...
'Parent', tab(tabNo),...
'Position',[popupStart height-4-(idx2)*(h_textbox+3) rightMargin-popupSpace h_textbox+8],...
'Position',[popupStart height-topMargin-8-(idx2)*(h_textbox+3) rightMargin-popupSpace h_textbox+8],...
'FontSize',fontsize,...
'FontSize',fontsize,...
'HorizontalAlignment','right',...
'HorizontalAlignment','right',...
'String',comportlist,...
'String',comportlist,...
@@ -255,7 +256,7 @@ for I = 1:nTabs %go thru all tabs to plot
@@ -255,7 +256,7 @@ for I = 1:nTabs %go thru all tabs to plot
end
end
h.(defined_preferences{idx,1}) = uicontrol(...
h.(defined_preferences{idx,1}) = uicontrol(...
'Parent', tab(tabNo),...
'Parent', tab(tabNo),...
'Position',[popupStart height-topMargin-4-(idx2)*(h_textbox+3) rightMargin-popupSpace h_textbox+8],...
'Position',[popupStart height-topMargin-8-(idx2)*(h_textbox+3) rightMargin-popupSpace h_textbox+8],...
'FontSize',fontsize,...
'FontSize',fontsize,...
'HorizontalAlignment','right',...
'HorizontalAlignment','right',...
'String',devicelist,...
'String',devicelist,...
@@ -273,6 +274,7 @@ for I = 1:nTabs %go thru all tabs to plot
@@ -273,6 +274,7 @@ for I = 1:nTabs %go thru all tabs to plot
'BackgroundColor',bgColor);
'BackgroundColor',bgColor);
pref = ita_preferences(defined_preferences{idx,1});
pref = ita_preferences(defined_preferences{idx,1});
set(h.(defined_preferences{idx,1}),'String',pref);
set(h.(defined_preferences{idx,1}),'String',pref);
 
case {'password'}
case {'password'}
h.(defined_preferences{idx,1}) = uicontrol(...
h.(defined_preferences{idx,1}) = uicontrol(...
'Parent', tab(tabNo), ...
'Parent', tab(tabNo), ...
@@ -284,6 +286,7 @@ for I = 1:nTabs %go thru all tabs to plot
@@ -284,6 +286,7 @@ for I = 1:nTabs %go thru all tabs to plot
'BackgroundColor',bgColor);
'BackgroundColor',bgColor);
pref = repmat('*',1,40);
pref = repmat('*',1,40);
set(h.(defined_preferences{idx,1}),'String',pref);
set(h.(defined_preferences{idx,1}),'String',pref);
 
case {'bool','bool_ispc'}
case {'bool','bool_ispc'}
if strcmpi(type,'bool_ispc') && ispc || strcmpi(type,'bool')
if strcmpi(type,'bool_ispc') && ispc || strcmpi(type,'bool')
h.(defined_preferences{idx,1}) = uicontrol(...
h.(defined_preferences{idx,1}) = uicontrol(...
@@ -303,6 +306,7 @@ for I = 1:nTabs %go thru all tabs to plot
@@ -303,6 +306,7 @@ for I = 1:nTabs %go thru all tabs to plot
idx2 = idx2-1; %pdi: skip this entry and put another gui element instead
idx2 = idx2-1; %pdi: skip this entry and put another gui element instead
draw_line = false;
draw_line = false;
end
end
 
case {'path'}
case {'path'}
h.(defined_preferences{idx,1}) = uicontrol(...
h.(defined_preferences{idx,1}) = uicontrol(...
'Parent', tab(tabNo), ...
'Parent', tab(tabNo), ...
Loading