From 617cd2fba295a25cf3a55c7773bb74285ad910f9 Mon Sep 17 00:00:00 2001
From: Jacques Grelet <jacques.grelet@ird.fr>
Date: Fri, 18 Jan 2008 15:43:10 +0000
Subject: [PATCH] =?UTF-8?q?creation=20d'un=20uipanel=20pour=20l'affichage?=
 =?UTF-8?q?=20interactive=20de=20la=20position=20des=20mesures=20Affichage?=
 =?UTF-8?q?=20des=20statistiques=20du=20QC=20dans=20un=20panel=20horizonta?=
 =?UTF-8?q?l,=20a=20revoir=20sur=20un=20bandeau=20vertical=20Test=20de=20l?=
 =?UTF-8?q?a=20taille=20de=20l'ecran=20pour=20definir=20la=20taille=20de?=
 =?UTF-8?q?=20la=20propriete=20FontSize=20--tion=20dCette=20ligne,=20et=20?=
 =?UTF-8?q?les=20suivantes=20ci-dessous,=20seront=20ignor=C3=A9es--?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

M    trunk/tsgqc_GUI.m
M    trunk/tsg_util/display_QC.m
---
 tsg_util/display_QC.m |  10 ++--
 tsgqc_GUI.m           | 122 +++++++++++++++++++++++++-----------------
 2 files changed, 77 insertions(+), 55 deletions(-)

diff --git a/tsg_util/display_QC.m b/tsg_util/display_QC.m
index c1f1313..33b1f32 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 ca0b3b5..df3f3ce 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
     % ---------------
-- 
GitLab