Skip to content
Snippets Groups Projects
Commit 10c8016c authored by jacques.grelet_ird.fr's avatar jacques.grelet_ird.fr
Browse files

Renomme la fonction imbriquee QC_ZoomCallback en QC_SelectCallback

Desactive le callback ButtonMotion dans QC_SelectCallback
Renome le handle hQCPushtool en hQCToggletool
parent 64c13398
No related branches found
No related tags found
No related merge requests found
......@@ -143,7 +143,7 @@ hPanPushtool = uipushtool(... % Open Pan toolbar button
'Tag','PUSHTOOL_PAN',...
'Enable', 'off',...
'ClickedCallback', @PanMenuCallback);
hQCPushtool = uitoggletool(... % Open QC toolbar button
hQCToggletool = uitoggletool(... % Open QC toolbar button
'Parent',hToolbar,...
'TooltipString','Validation codes',...
'Separator', 'on', ...
......@@ -155,7 +155,7 @@ hQCPushtool = uitoggletool(... % Open QC toolbar button
'Enable', 'off',...
'OffCallback', @QC_OffMenuCallback,...
'ONCallback', @QC_OnMenuCallback);
hMapPushtool = uitoggletool(... % Open Map toolbar button
hMapToggletool = uitoggletool(... % Open Map toolbar button
'Parent',hToolbar,...
'TooltipString','Map and ship track',...
'Separator', 'on', ...
......@@ -167,7 +167,7 @@ hMapPushtool = uitoggletool(... % Open Map toolbar button
'Enable', 'off',...
'OffCallback', @Map_OffMenuCallback,...
'ONCallback', @Map_OnMenuCallback);
hClimPushtool = uitoggletool(... % Open Climatology toolbar button
hClimToggletool = uitoggletool(... % Open Climatology toolbar button
'Parent',hToolbar,...
'TooltipString','Climatology',...
'Separator', 'on', ...
......@@ -568,6 +568,7 @@ tsg_initialisation(hMainFig, hQcCmenu)
zoomAdaptiveDateTicks('off');
case 'off'
pan off
% Desactivate the QC toggle button
% --------------------------------
set(hQCPushtool, 'state', 'off' );
......@@ -597,7 +598,6 @@ tsg_initialisation(hMainFig, hQcCmenu)
% Desactivate the QC toggle button
% --------------------------------
set(hQCPushtool, 'state', 'off' );
pan on
panAdaptiveDateTicks('on');
......@@ -636,7 +636,7 @@ tsg_initialisation(hMainFig, hQcCmenu)
% Activate clic mouse menu on first axes (salinity)
% -------------------------------------------------
set(hPlotAxes(1),'ButtonDownFcn', @QC_ZoomCallback);
set(hPlotAxes(1),'ButtonDownFcn', @QC_SelectCallback);
% Try to make visible the context menu a the top of
% the figure. DOESN'T WORK
......@@ -653,8 +653,12 @@ tsg_initialisation(hMainFig, hQcCmenu)
% -------------------------------------------------------------
% nested function on mouse clic
% -------------------------------------------------------------
function QC_ZoomCallback(gcbo, eventdata)
function QC_SelectCallback(gcbo, eventdata)
% disable ButtonMotion on main fig during select
% ----------------------------------------------
set( hMainFig, 'WindowButtonMotionFcn', []);
% Retrieve named application data
% -------------------------------
tsg = getappdata( hMainFig, 'tsg_data');
......@@ -693,6 +697,10 @@ tsg_initialisation(hMainFig, hQcCmenu)
% Save the modifications
% ----------------------
setappdata( hMainFig, 'tsg_data', tsg);
% disable ButtonMotion on main fig during select
% ----------------------------------------------
set( hMainFig, 'WindowButtonMotionFcn', @MouseMotion);
end
end
......@@ -708,26 +716,26 @@ tsg_initialisation(hMainFig, hQcCmenu)
%
% % Toggle the tag of the Qc pushbutton to 'on' or 'off'
% % ----------------------------------------------------
% switch get(hQCPushtool, 'UserData');
% switch get(hQCToggletool, 'UserData');
% case 'off'
% set(hQCPushtool, 'UserData', 'on' );
% set(hQCToggletool, 'UserData', 'on' );
% set(hPlotAxes(1),'UIContextMenu', hQcCmenu);
% set( hMainFig, 'Pointer', 'crosshair');
% case 'on'
% set(hQCPushtool, 'UserData', 'off' );
% set(hQCToggletool, 'UserData', 'off' );
% set(hPlotAxes(1),'UIContextMenu', []);
% set(hMainFig,'Pointer','arrow');
% end
%
% qualityCode = -1;
% ind = [];
% while strcmp( get(hQCPushtool, 'UserData'),'on')
% while strcmp( get(hQCToggletool, 'UserData'),'on')
%
% k = waitforbuttonpress;
%
% % If the QC pushbutton is pressed we quit the callback
% % ----------------------------------------------------
% if strcmp( get(hQCPushtool, 'UserData'),'off')
% if strcmp( get(hQCToggletool, 'UserData'),'off')
%
% % Desactivate the context menu use to choose the Quality Codes
% % ------------------------------------------------------------
......@@ -836,7 +844,7 @@ tsg_initialisation(hMainFig, hQcCmenu)
% uiwait in the QCMenuCallback function
% -------------------------------------
uiresume
%uiresume
end
%---------------------------------------------------------------------
......@@ -1231,12 +1239,11 @@ tsg_initialisation(hMainFig, hQcCmenu)
end
% -----------------------------------------------------------------
% call from:
% QuitMenuCallback
% callback 'CloseRequestFcn', @QuitProgram
% -----------------------------------------------------------------
function QuitProgram(hObject, eventdata)
% needed during QC operation if waitbuttonpress is active
% -------------------------------------------------------
uiresume;
% close the main windows
% ----------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment