From ad37fe3b549de04f4bfdc1d107f7c457b24cc057 Mon Sep 17 00:00:00 2001
From: Yves Gouriou <yves.gouriou@ird.fr>
Date: Thu, 17 Jan 2008 16:14:39 +0000
Subject: [PATCH] J'ai commence a modifier TSG_COR : pushbutton en togglebutton

---
 tsgcor_GUI.m | 128 +++++++++++++++++++++++++++------------------------
 1 file changed, 67 insertions(+), 61 deletions(-)

diff --git a/tsgcor_GUI.m b/tsgcor_GUI.m
index bad45a8..6220fb1 100644
--- a/tsgcor_GUI.m
+++ b/tsgcor_GUI.m
@@ -74,82 +74,88 @@ hQuitMenu = uimenu(...
   'HandleVisibility','callback',...
   'Callback',@QuitMenuCallback);
 
-%  Construct the Toolbar
+%%  Construct the Toolbar
 %   --------------------
 hToolbar       =   uitoolbar(...   % Toolbar for Open and Print buttons
   'Parent',hTsgCorGUI, ...
   'HandleVisibility','callback');
-hZoomPushtool  =   uipushtool(...   % Open Zoom toolbar button
+hZoomToggletool  =   uitoggletool(...   % Open Zoom toolbar button
   'Parent',hToolbar,...
   'Separator', 'on', ...
   'TooltipString','Zoom',...
   'CData', iconRead(fullfile(matlabroot, ...
-          '/toolbox/matlab/icons/zoom.mat')),...
+  '/toolbox/matlab/icons/zoom.mat')),...
   'HandleVisibility','callback', ...
-  'ClickedCallback', @ZoomMenuCallback);
-
-hPanPushtool  =   uipushtool(...   % Open Pan toolbar button
+  'Tag','PUSHTOOL_ZOOM',...
+  'Enable', 'off',...
+  'OffCallback', @Zoom_OffMenuCallback,...
+  'ONCallback',  @Zoom_OnMenuCallback);
+hPanToggletool  =   uitoggletool(...   % Open Pan toolbar button
   'Parent',hToolbar,...
   'TooltipString','Pan',...
   'CData',iconRead(fullfile(matlabroot, ...
-          '/toolbox/matlab/icons/pan.mat')),...
+  '/toolbox/matlab/icons/pan.mat')),...
   'HandleVisibility','callback', ...
-  'ClickedCallback', @PanMenuCallback);
+  'Tag','PUSHTOOL_PAN',...
+  'Enable', 'off',...
+  'OffCallback', @Pan_OffMenuCallback,...
+  'ONCallback',  @Pan_OnMenuCallback);
+  %'ClickedCallback', @PanMenuCallback);
 
 hBottlePushtool  = uipushtool(...   % Open toolbar button
-                        'Parent',hToolbar,...
-                        'TooltipString','Plot the Samples',...
-                        'Separator', 'on', ...
-                        'Tag', 'off', ...
-                        'CData',iconRead(...
-                         [DEFAULT_PATH_FILE 'tsg_icon' filesep 'bottleicon.mat']),...
-                        'HandleVisibility','callback', ...
-                        'ClickedCallback', @BottleMenuCallback);
-    hStartlimitPushtool  = uipushtool(...   % Open toolbar button
-                        'Parent',hToolbar,...
-                        'TooltipString','Start time',...
-                        'Separator', 'on', ...
-                        'Tag', 'off', ...
-                        'CData',iconRead(...
-                         [DEFAULT_PATH_FILE 'tsg_icon' filesep 'startlimit.mat']),...
-                        'HandleVisibility','callback', ...
-                        'ClickedCallback', @TimeLimitCallback);
-    hEndlimitPushtool  = uipushtool(...   % Open toolbar button
-                        'Parent',hToolbar,...
-                        'TooltipString','End time',...
-                        'Tag', 'off', ...
-                        'CData',iconRead(...
-                         [DEFAULT_PATH_FILE 'tsg_icon' filesep 'endlimit.mat']),...
-                        'HandleVisibility','callback', ...
-                        'ClickedCallback', @TimeLimitCallback);
-
-    % Static text that displays the position, salinity and temperature
-    % ----------------------------------------------------------------
-    hInfoText = uicontrol(...
-                'Parent', hTsgCorGUI, ...
-                'Style', 'text', ...
-                'Fontsize', 12, ...
-                'Fontweight', 'bold', ...
-                'Visible','on',...
-                'Units', 'normalized',...
-                'String', 'Information sur la position du curseur', ...
-                'Position', [.05, .95, .9, .03]);
-    
-    % Construct the plot axes
-    % -----------------------
-    hPlotAxes(1) = axes(...     % the axes for plotting Salinity
-                'Parent', hTsgCorGUI, ...
-                'Units', 'normalized', ...
-                'Visible', 'off', ...
-                'HandleVisibility','callback', ...
-                'Position',[.25, .6, .7, .32]); 
-    hPlotAxes(2) = axes(...     % the axes for plotting sample
-                'Parent', hTsgCorGUI, ...
-                'Units', 'normalized', ...
-                'Visible', 'off', ...
-                'HandleVisibility','callback', ...
-                'Position',[.25, .3, .7, .25]); 
-    hPlotAxes(3) = axes(...     % the axes for plotting ship velocity
+  'Parent',hToolbar,...
+  'TooltipString','Plot the Samples',...
+  'Separator', 'on', ...
+  'Tag', 'off', ...
+  'CData',iconRead(...
+  [DEFAULT_PATH_FILE 'tsg_icon' filesep 'bottleicon.mat']),...
+  'HandleVisibility','callback', ...
+  'ClickedCallback', @BottleMenuCallback);
+hStartlimitPushtool  = uipushtool(...   % Open toolbar button
+  'Parent',hToolbar,...
+  'TooltipString','Start time',...
+  'Separator', 'on', ...
+  'Tag', 'off', ...
+  'CData',iconRead(...
+  [DEFAULT_PATH_FILE 'tsg_icon' filesep 'startlimit.mat']),...
+  'HandleVisibility','callback', ...
+  'ClickedCallback', @TimeLimitCallback);
+hEndlimitPushtool  = uipushtool(...   % Open toolbar button
+  'Parent',hToolbar,...
+  'TooltipString','End time',...
+  'Tag', 'off', ...
+  'CData',iconRead(...
+  [DEFAULT_PATH_FILE 'tsg_icon' filesep 'endlimit.mat']),...
+  'HandleVisibility','callback', ...
+  'ClickedCallback', @TimeLimitCallback);
+
+% Static text that displays the position, salinity and temperature
+% ----------------------------------------------------------------
+hInfoText = uicontrol(...
+  'Parent', hTsgCorGUI, ...
+  'Style', 'text', ...
+  'Fontsize', 12, ...
+  'Fontweight', 'bold', ...
+  'Visible','on',...
+  'Units', 'normalized',...
+  'String', 'Information sur la position du curseur', ...
+  'Position', [.05, .95, .9, .03]);
+
+% Construct the plot axes
+% -----------------------
+hPlotAxes(1) = axes(...     % the axes for plotting Salinity
+  'Parent', hTsgCorGUI, ...
+  'Units', 'normalized', ...
+  'Visible', 'off', ...
+  'HandleVisibility','callback', ...
+  'Position',[.25, .6, .7, .32]);
+hPlotAxes(2) = axes(...     % the axes for plotting sample
+  'Parent', hTsgCorGUI, ...
+  'Units', 'normalized', ...
+  'Visible', 'off', ...
+  'HandleVisibility','callback', ...
+  'Position',[.25, .3, .7, .25]);
+hPlotAxes(3) = axes(...     % the axes for plotting ship velocity
                 'Parent', hTsgCorGUI, ...
                 'Units', 'normalized', ...
                 'Visible', 'off', ...
-- 
GitLab