diff --git a/tsg_util/display_QC.m b/tsg_util/display_QC.m index c1f1313e4156f8d14a6455e048cff946b8218988..33b1f32f369f21f34fb8edfe87edcddc7cfa11fa 100644 --- a/tsg_util/display_QC.m +++ b/tsg_util/display_QC.m @@ -22,17 +22,17 @@ hdlPanel = findobj(hGUI, 'tag', 'TAG_QC_DISPLAY_PANEL'); % get color axes and set 'BackgroundColor' properties of panel handle % give a transparency effect % ------------------------------------------------------------------- -bgColor = get(hAxes(1), 'Color'); -set(hdlPanel, 'BackgroundColor', bgColor); +%bgColor = get(hAxes(1), 'Color'); +%set(hdlPanel, 'BackgroundColor', bgColor); % and to his chlidren uicontrol % ----------------------------- -set(findobj(get(hdlPanel,'children'),'style','text'),... - 'BackgroundColor', bgColor) +%set(findobj(get(hdlPanel,'children'),'style','text'),... +% 'BackgroundColor', bgColor) % set panel visible % ----------------- -set(hdlPanel, 'visible', 'on'); +%set(hdlPanel, 'visible', 'on'); % get list of keys from hashtable tsg.qc.hash, defined inside % tsg_initialisation.m diff --git a/tsgqc_GUI.m b/tsgqc_GUI.m index ca0b3b5a66509d8ff6a36449bffc9c9b5c7a5b05..df3f3ce8d64c04805c6c8da1d1f017482ac99ee4 100644 --- a/tsgqc_GUI.m +++ b/tsgqc_GUI.m @@ -49,6 +49,19 @@ p = [pathsep,... addpath( p, '-END' ); rehash; +% get screen dimensions (pixels) +% ------------------------------ +set(0,'Units','pixels'); +screenSize = get(0,'ScreenSize'); + +% define default font size based on screen resolution +% --------------------------------------------------- +if screenSize(3) <= 1024 + fontSize = 9; +else + fontSize = 11; +end + % Screen limits for the GUI % ------------------------- set(0,'Units','normalized'); @@ -218,155 +231,164 @@ hHeaderPushtool = uipushtool(... % Open headerForm button % salinity, temperature % --------------------------------------------------- +% create an uipanel +% ----------------- +hInfoPanel = uipanel( ... + 'Parent', hMainFig, ... + 'Units', 'normalized', ... + 'BorderType', 'none',... + 'Visible', 'on', ... + 'Position',[.01, .95, .98, .04]); + % Dynamic text area that displays the date % ---------------------------------------- uicontrol(... - 'Parent', hMainFig, ... + 'Parent', hInfoPanel, ... 'Units', 'normalized', ... 'Style', 'Text', ... - 'Fontsize', 11, ... + 'Fontsize', fontSize, ... 'Fontweight', 'bold', ... 'HorizontalAlignment', 'left', ... - 'Position',[.02, .95, .03, .03], ... + 'Position',[.01, .25, .04, .5], ... 'String', 'File:'); hInfoFileText = uicontrol(... - 'Parent', hMainFig, ... + 'Parent', hInfoPanel, ... 'Style', 'text', ... - 'Fontsize', 11, ... + 'Fontsize', fontSize, ... 'Visible','on',... 'Units', 'normalized',... 'HorizontalAlignment', 'left', ... 'String', 'No file loaded', ... - 'Position', [.05, .95, .10, .03]); + 'Position', [.05, .25, .1, .5]); % Text area that displays the date % -------------------------------- uicontrol(... - 'Parent', hMainFig, ... + 'Parent', hInfoPanel, ... 'Units', 'normalized', ... 'Style', 'Text', ... - 'Fontsize', 11, ... + 'Fontsize', fontSize, ... 'Fontweight', 'bold', ... 'HorizontalAlignment', 'left', ... - 'Position',[.17, .95, .03, .03], ... + 'Position',[.16, .25, .03, .5], ... 'String', 'Date:'); hInfoDateText = uicontrol(... - 'Parent', hMainFig, ... + 'Parent', hInfoPanel, ... 'Style', 'text', ... - 'Fontsize', 11, ... + 'Fontsize', fontSize, ... 'Visible','on',... 'Units', 'normalized',... 'HorizontalAlignment', 'left', ... 'String', 'N/A', ... - 'Position', [.21, .95, .11, .03]); + 'Position', [.20, .25, .13, .5]); % Text area that displays the latitude % ------------------------------------ uicontrol(... - 'Parent', hMainFig, ... + 'Parent', hInfoPanel, ... 'Units', 'normalized', ... 'Style', 'Text', ... - 'Fontsize', 11, ... + 'Fontsize', fontSize, ... 'Fontweight', 'bold', ... 'HorizontalAlignment', 'left', ... - 'Position',[.35, .95, .05, .03], ... + 'Position',[.34, .25, .05, .5], ... 'String', 'Latitude:'); hInfoLatText = uicontrol(... - 'Parent', hMainFig, ... + 'Parent', hInfoPanel, ... 'Style', 'text', ... - 'Fontsize', 11, ... + 'Fontsize', fontSize, ... 'Visible','on',... 'Units', 'normalized',... 'HorizontalAlignment', 'left', ... 'String', 'N/A', ... - 'Position', [.41, .95, .07, .03]); + 'Position', [.4, .25, .9, .5]); % Text area that displays the longitude % ------------------------------------- uicontrol(... - 'Parent', hMainFig, ... + 'Parent', hInfoPanel, ... 'Units', 'normalized', ... 'Style', 'Text', ... - 'Fontsize', 11, ... + 'Fontsize', fontSize, ... 'Fontweight', 'bold', ... 'HorizontalAlignment', 'left', ... - 'Position',[.50, .95, .06, .03], ... + 'Position',[.50, .25, .06, .5], ... 'String', 'Longitude:'); hInfoLongText = uicontrol(... - 'Parent', hMainFig, ... + 'Parent', hInfoPanel, ... 'Style', 'text', ... - 'Fontsize', 11, ... + 'Fontsize', fontSize, ... 'Visible','on',... 'Units', 'normalized',... 'HorizontalAlignment', 'left', ... 'String', 'N/A', ... - 'Position', [.57, .95, .07, .03]); + 'Position', [.57, .25, .07, .5]); % Text area that display salinity and temperature % ----------------------------------------------- uicontrol(... - 'Parent', hMainFig, ... + 'Parent', hInfoPanel, ... 'Units', 'normalized', ... 'Style', 'Text', ... - 'Fontsize', 11, ... + 'Fontsize', fontSize, ... 'Fontweight', 'bold', ... 'HorizontalAlignment', 'left', ... - 'Position',[.65, .95, .03, .03], ... + 'Position',[.65, .25, .03, .5], ... 'String', 'SSPS:'); hInfoSSPSText = uicontrol(... - 'Parent', hMainFig, ... + 'Parent', hInfoPanel, ... 'Style', 'text', ... - 'Fontsize', 11, ... + 'Fontsize', fontSize, ... 'Visible','on',... 'Units', 'normalized',... 'HorizontalAlignment', 'left', ... 'String', 'N/A', ... - 'Position', [.69, .95, .05, .03]); + 'Position', [.69, .25, .05, .5]); uicontrol(... - 'Parent', hMainFig, ... + 'Parent', hInfoPanel, ... 'Units', 'normalized', ... 'Style', 'Text', ... - 'Fontsize', 11, ... + 'Fontsize', fontSize, ... 'Fontweight', 'bold', ... 'HorizontalAlignment', 'left', ... - 'Position',[.75, .95, .03, .03], ... + 'Position',[.75, .25, .03, .5], ... 'String', 'SSJT:'); hInfoSSJTText = uicontrol(... - 'Parent', hMainFig, ... + 'Parent', hInfoPanel, ... 'Style', 'text', ... - 'Fontsize', 11, ... + 'Fontsize', fontSize, ... 'Visible','on',... 'Units', 'normalized',... 'HorizontalAlignment', 'left', ... 'String', 'N/A', ... - 'Position', [.79, .95, .05, .03]); + 'Position', [.79, .25, .05, .5]); uicontrol(... - 'Parent', hMainFig, ... + 'Parent', hInfoPanel, ... 'Units', 'normalized', ... 'Style', 'Text', ... - 'Fontsize', 11, ... + 'Fontsize', fontSize, ... 'Fontweight', 'bold', ... 'HorizontalAlignment', 'left', ... - 'Position',[.85, .95, .03, .03], ... + 'Position',[.85, .25, .03, .5], ... 'String', 'SSTP:'); hInfoSSTPText = uicontrol(... - 'Parent', hMainFig, ... + 'Parent', hInfoPanel, ... 'Style', 'text', ... - 'Fontsize', 11, ... + 'Fontsize', fontSize, ... 'Visible','on',... 'Units', 'normalized',... 'HorizontalAlignment', 'left', ... 'String', 'N/A', ... - 'Position', [.89, .95, .05, .03]); + 'Position', [.89, .25, .05, .5]); %% Construct the plot axes % ----------------------- @@ -379,7 +401,7 @@ hPlotsPanel = uipanel( ... 'Units', 'normalized', ... 'BorderType', 'none',... 'Visible', 'on', ... - 'Position',[0, 0, 1, .95]); + 'Position',[0, 0, 1, .93]); hPlotAxes(1) = axes(... % the axes for plotting Salinity 'Parent', hPlotsPanel, ... @@ -415,7 +437,7 @@ hPlotAxes(4) = axes(... % the axes for plotting ship track map 'Visible', 'off', ... 'Color', 'none', ... 'UserData', 'off', ... - 'HandleVisibility','callback', ... + 'HandleVisibility','on', ... 'Position',[.05, .05, .9, .9]); @@ -425,9 +447,9 @@ hQcPanel = uipanel(... 'Parent', hMainFig, ... 'tag', 'TAG_QC_DISPLAY_PANEL',... 'HandleVisibility','on',... - 'Visible', 'off',... + 'Visible', 'on',... 'BorderType', 'none',... - 'Position', [.85, .80, .1, .13]); + 'Position', [.01, .92, .98, .03]); % Construct the context menu for the Quality control codes % ------------------------------------------------------- @@ -475,12 +497,12 @@ for i=1:numel(qc_list) 'Style', 'text',... 'Units', 'normalized', ... 'Style', 'Text', ... - 'Fontsize', 11, ... + 'Fontsize', fontSize, ... 'HorizontalAlignment', 'left', ... 'HandleVisibility','on', ... 'String', label,... 'ForegroundColor', color,... - 'Position', [.1, .9-count*.12, .7, 0.12]); + 'Position', [.01+count*.12, .35, .07, 0.5]); % add text QC display statistic on hQcPanel % ----------------------------------------- @@ -489,13 +511,13 @@ for i=1:numel(qc_list) 'Style', 'text',... 'Units', 'normalized', ... 'Style', 'Text', ... - 'Fontsize', 11, ... + 'Fontsize', fontSize, ... 'HorizontalAlignment', 'right', ... 'HandleVisibility','on', ... 'String', 'N/A',... 'ForegroundColor', color,... 'Tag', ['TAG_QC_TEXT_' key],... - 'Position', [.7, .9-count*.12, .25, 0.12]); + 'Position', [.09+count*.12, .35, .03, 0.5]); % increment count % ---------------